/* ═══ ds.css — the component grid ══════════════════════════════════════════
   Twelve tiles, three columns. Each holds one live component from the Famly
   prototypes, with a scripted cursor demonstrating it until you take over.

   These are NOT iframes. The rigs further up the page embed the prototype
   document, which costs an iframe, a cursor mirror and a hover shim each;
   twelve of those would be a second page's worth of work for components
   that are a few dozen elements apiece. Built into this document instead,
   the visitor's own pointer gets real :hover with no machinery at all, and
   the scripted cursor borrows it through a twin class — every rule below
   that styles :hover also styles .ds-hv.
   ───────────────────────────────────────────────────────────────────── */

/* MatterUI — Famly's own face — is declared in styles.css, next to the
   other @font-face rules, because the rebuilt screens in famly-ui.css need
   it too and that sheet loads before this one. */

.dsx {
  /* Famly's own tokens, copied from the prototype so the components here
     and the ones inside the rigs cannot drift apart. */
  --n0: #fff;
  --n50: #f9f9fb;
  --n75: #f1f1f4;
  --n100: #e2e2e9;
  --n200: #c6c6d2;
  --n300: #656581;
  --n400: #2d2d39;
  --p50: #f9f6fe;
  --p400: #4e169c;
  --brand: #6910e7;
  --r400: #c20a0a;
  --ok: #1a7f46;
  --ok-bg: #ebf7f0;
  --select-bg: #f5f3fe;
  --elev-2: 0 3px 2px rgba(104, 111, 125, .04), 0 5px 3px rgba(104, 111, 125, .08);

  /* ── type ──────────────────────────────────────────────────────────
     Seven steps. There were nine, and four of them were duplicates
     hiding behind half a pixel — 13 beside 13.5, 12 beside 12.5, 11
     beside 11.5. Nobody can see that difference; all it meant was the
     system had no answer to "what size is small text". */
  --t-xl:   30px;   /* a display number: the stepper                     */
  --t-lg:   20px;   /* a card's own title                                */
  --t-md:   16px;   /* primary text, and the system's body size          */
  --t-sm:   15px;   /* primary text inside a dense card                  */
  --t-xs:   13.5px; /* secondary: the line under a title                 */
  --t-2xs:  12.5px; /* meta: timestamps, field labels, tile captions     */
  --t-3xs:  11.5px; /* badges                                            */

  /* ── motion ────────────────────────────────────────────────────────
     Three curves. There were eleven, five of them springs differing in
     the second decimal — which reads as accumulated rather than chosen.
     What varies between components is duration and delay, not the shape
     of the movement. */
  --e-out:    cubic-bezier(.22, 1, .36, 1);    /* settling into place      */
  --e-spring: cubic-bezier(.28, 1.4, .5, 1);   /* arriving, with overshoot */
  --e-in:     cubic-bezier(.4, 0, 1, 1);       /* leaving, accelerating    */

  /* ── corners ───────────────────────────────────────────────────────
     Four steps, assigned by what a thing is rather than how big it is.
     There were seven in the card-to-control range: 8, 9 and 10 were
     three values doing one job, and 14 sat beside 16 doing another.
     Round stays round (a circle is a rule, not a step), and avatars keep
     their own rule — a quarter of their width, whatever that is. */
  --r-sm: 8px;    /* a control: button, icon button, day cell, bar     */
  --r-md: 12px;   /* a row, an input, a container inside a card        */
  --r-lg: 16px;   /* a card                                            */
  --r-xl: 20px;   /* the largest floating surface: the parent menu     */

  --tile: #efeff1;          /* the grey square */
  --tile-r: 28px;
  --fast: .15s;
  --faster: .1s;

  font-family: "MatterUI", "Matter", var(--font-sans, system-ui), sans-serif;
  color: var(--n400);
}

/* A face is never a circle in this system: every avatar is a rounded
   square whose corner is a quarter of its width. Written as 25% rather
   than a pixel value per size, so the rule holds wherever one is used and
   cannot drift as sizes change. The status dot on a shift track stays
   round — it is a dot, not a face. */

/* ── the grid ───────────────────────────────────────────────────────────
   Three fixed columns rather than auto-fit: each component is drawn at one
   size, and a column that stretches would leave them swimming. */
/* Three columns, each stacking its own tiles, rather than one grid of
   twelve. A grid locks every tile in a row to the tallest of them, which
   gives four hard horizontal lines across the section and leaves the small
   components swimming in stretched boxes. Stacked columns let a tile be as
   tall as what is in it, and let the columns start at different heights —
   so nothing lines up, and the eye reads down a column instead of scanning
   a table. */
.dsx__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 20px;
}
.dsx__col {
  display: flex; flex-direction: column; gap: 20px;
  will-change: transform;        /* ds.js drifts these on scroll */
}
/* The offsets. Small enough to read as a stagger rather than three
   separate things, and uneven so it does not look like a staircase. */
.dsx__col:nth-child(2) { margin-top: 64px; }
.dsx__col:nth-child(3) { margin-top: 26px; }

/* Arriving, the same way the rigs and the stills do. Opacity and a
   transform only — neither affects layout, so the height lock measured at
   startup still measures the real thing. The columns already sit at
   different heights, so a tile in the middle column arrives a beat after
   its neighbours without any stagger being written down. */
.dsx__tile {
  opacity: .5;
  transform: translateY(38px);
  transition: opacity 380ms ease-out,
              transform 740ms var(--e-out);
}
.dsx__tile.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .dsx__tile { opacity: 1; transform: none; transition: none; }
}

.dsx__tile {
  position: relative;
  min-height: 280px;
  padding: 32px;
  border-radius: var(--tile-r);
  background: var(--tile);
  display: grid;
  place-items: center;
  overflow: hidden;
  /* Nothing inside is a scroll container, and the cursor is positioned
     against this box. */
  contain: paint;
}

/* The label sits in the corner the way a plate does on a specimen, out of
   the component's way. It is not a control, so it does not light up. */
.dsx__name {
  position: absolute;
  left: 20px;
  bottom: 18px;
  font-size: var(--t-2xs);
  letter-spacing: .01em;
  color: var(--n300);
  pointer-events: none;
  user-select: none;
}

/* A tile the visitor has taken over says so, quietly, where the scripted
   cursor used to be. */
.dsx__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px rgba(105, 16, 231, 0);
  transition: box-shadow 220ms ease-out;
  pointer-events: none;
}
/* Two states, because they mean different things. Hovering says the tile
   is live and you may touch it — the scene keeps playing. Pressing takes
   it over, and the firmer ring says the cursor you see is yours. */
.dsx__tile.is-hover::after { box-shadow: inset 0 0 0 1.5px rgba(105, 16, 231, .12); }
.dsx__tile.is-live::after,
.dsx__tile.is-live.is-hover::after { box-shadow: inset 0 0 0 1.5px rgba(105, 16, 231, .32); }

/* ── the scripted cursor ────────────────────────────────────────────────
   Same two glyphs as the rigs, at page scale — these components are drawn
   1:1, so there is no transform to divide out. */
.dsx__cursor {
  position: absolute;
  left: 0; top: 0;
  width: 24px; height: 24px;
  margin: -3px 0 0 -2px;        /* the arrow's hotspot */
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease-out;
  z-index: 5;
  filter: drop-shadow(0 1px 2px rgba(20, 20, 30, .28));
}
.dsx__cursor.on { opacity: 1; }
.dsx__cursor.hand { margin: -2px 0 0 -9px; }
.dsx__cursor svg { display: block; width: 100%; height: 100%; }
/* The press. Scaling the glyph about its hotspot reads as a click without
   moving the point it is clicking. */
.dsx__cursor.press { transform: scale(.82); }
.dsx__cursor { transform-origin: 3px 3px; transition: opacity 180ms ease-out, transform 90ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .dsx__cursor { display: none; }
}

/* ══ components ═════════════════════════════════════════════════════════
   Everything below is lifted from the prototypes at its real size. Each
   hover rule carries .ds-hv so the scripted cursor produces the same state
   a real pointer would. */

/* Form controls do not inherit the page's font or colour, so they are told
   to. Wrapped in :where() so the whole thing weighs nothing: at (0,1,1) it
   out-specified every component rule below, which is how buttons ended up
   with the article's 19px body size and how the primary button lost its
   white text to the inherited ink. Font-size is left out entirely — each
   component states its own. */
:where(.dsx) button,
:where(.dsx) input { font-family: inherit; font-weight: inherit; letter-spacing: inherit; color: inherit; }

/* 1 — buttons ------------------------------------------------------------ */
.dsb {
  height: 42px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: var(--t-md); font-weight: 400; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsb--primary   { background: var(--brand); color: #fff; }
.dsb--primary:hover,   .dsb--primary.ds-hv   { background: #5a0dc6; transition-duration: var(--faster); }
.dsb--secondary { background: var(--n0); border-color: var(--n100); }
.dsb--secondary:hover, .dsb--secondary.ds-hv { background: var(--n75); border-color: var(--n200); transition-duration: var(--faster); }
.dsb--ghost     { background: transparent; color: var(--brand); }
.dsb--ghost:hover,     .dsb--ghost.ds-hv     { background: var(--p50); transition-duration: var(--faster); }
.dsb--critical  { background: var(--n0); border-color: var(--n100); color: var(--r400); }
.dsb--critical:hover,  .dsb--critical.ds-hv  { background: #fff4f5; border-color: #f3c9cd; transition-duration: var(--faster); }
.dsb:active { transform: translateY(.5px); }
.dsb[disabled] { background: var(--n75); color: var(--n200); cursor: default; border-color: transparent; }

/* 2 — icon buttons ------------------------------------------------------- */
.dsi {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--n100);
  background: var(--n0); color: var(--n400); cursor: pointer;
  display: grid; place-items: center;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsi:hover, .dsi.ds-hv { background: var(--n75); border-color: var(--n200); transition-duration: var(--faster); }
.dsi.is-on { background: var(--p50); border-color: var(--brand); color: var(--brand); }
.dsi svg { display: block; }

/* 3 — toggle ------------------------------------------------------------- */
.dst {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  font-size: var(--t-md); user-select: none;
}
.dst__track {
  width: 44px; height: 26px; border-radius: 999px; background: var(--n200);
  padding: 3px; flex: none; display: flex; align-items: center;
  transition: background-color 220ms var(--e-out);
}
.dst__knob {
  display: block;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 30, .25);
  transition: transform 220ms var(--e-out);
}
.dst.is-on .dst__track { background: var(--brand); }
.dst.is-on .dst__knob  { transform: translateX(18px); }

/* 4 — segmented control -------------------------------------------------- */
.dsg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--n100); border-radius: var(--r-md);
}
.dsg__o {
  position: relative; z-index: 1;
  height: 34px; padding: 0 18px; border-radius: var(--r-sm); border: 0; background: none;
  font-size: var(--t-md); cursor: pointer; color: var(--n300);
  transition: color var(--fast) ease-out;
}
.dsg__o.is-on { color: var(--n400); font-weight: 500; }
.dsg__ind {
  position: absolute; z-index: 0; top: 3px; bottom: 3px;
  left: var(--gl, 3px); width: var(--gw, 0);
  background: var(--n0); border-radius: var(--r-sm); box-shadow: var(--elev-2);
  transition: left 280ms var(--e-out), width 280ms var(--e-out);
}
.dsg { position: relative; }

/* 5 — filter pills ------------------------------------------------------- */
.dsp {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--n100);
  background: var(--n0); color: var(--n300); font-size: var(--t-sm); cursor: pointer;
  display: inline-flex; align-items: center;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsp:hover, .dsp.ds-hv { background: var(--n75); transition-duration: var(--faster); }
/* Only the chosen pill carries weight — three at 500 read as three headings. */
.dsp.is-on, .dsp.is-on:hover, .dsp.is-on.ds-hv {
  font-weight: 500; color: var(--brand); border-color: var(--brand); background: var(--p50);
}

/* 6 — checkboxes --------------------------------------------------------- */
.dsc { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.dsc + .dsc { margin-top: 18px; }
.dsc__box {
  width: 22px; height: 22px; border-radius: var(--r-sm); border: 1.5px solid var(--n200);
  background: var(--n0); flex: none; display: grid; place-items: center; margin-top: 1px;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsc:hover .dsc__box, .dsc.ds-hv .dsc__box { border-color: var(--n300); }
.dsc.is-on .dsc__box { background: var(--brand); border-color: var(--brand); }
.dsc__box svg { opacity: 0; transform: scale(.7); transition: opacity 140ms ease-out, transform 200ms var(--e-spring); }
.dsc.is-on .dsc__box svg { opacity: 1; transform: none; }
.dsc__t { display: block; font-size: var(--t-md); line-height: 1.35; }
.dsc__h { display: block; font-size: var(--t-xs); color: var(--n300); line-height: 1.35; margin-top: 1px; }

/* 7 — text field --------------------------------------------------------- */
.dsf { display: block; width: 260px; }
.dsf__l { display: block; font-size: var(--t-xs); color: var(--n300); margin-bottom: 7px; }
.dsf__i {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 13px; border-radius: var(--r-md);
  border: 1px solid var(--n100); background: var(--n0);
  transition: border-color var(--fast) ease-out, box-shadow var(--fast) ease-out;
}
.dsf__i:hover, .dsf__i.ds-hv { border-color: var(--n200); }
.dsf__i:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(105, 16, 231, .12); }
.dsf__i input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font: inherit; font-size: var(--t-md); color: var(--n400);
}
.dsf__i input::placeholder { color: var(--n200); }
.dsf.is-bad .dsf__i { border-color: var(--r400); }
.dsf.is-bad .dsf__i:focus-within { box-shadow: 0 0 0 3px rgba(194, 10, 10, .1); }
.dsf__m {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--t-2xs); color: var(--r400); margin-top: 7px;
  opacity: 0; transform: translateY(-2px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}
.dsf.is-bad .dsf__m { opacity: 1; transform: none; }

/* 8 — date picker -------------------------------------------------------- */
.dsd {
  width: 288px; padding: 16px; border-radius: var(--r-lg);
  background: var(--n0); box-shadow: var(--elev-2); border: 1px solid var(--n100);
}
.dsd__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dsd__m { font-size: var(--t-sm); font-weight: 500; }
.dsd__nav {
  width: 30px; height: 30px; border-radius: var(--r-sm); border: 0; background: none;
  color: var(--n300); cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--fast) ease-out;
}
.dsd__nav:hover, .dsd__nav.ds-hv { background: var(--n75); transition-duration: var(--faster); }
.dsd__g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dsd__w { font-size: var(--t-2xs); color: var(--n300); text-align: center; padding-bottom: 5px; }
.dsd__d {
  height: 32px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: var(--t-xs); color: var(--n400);
  transition: background-color var(--fast) ease-out;
}
.dsd__d:hover, .dsd__d.ds-hv { background: var(--n75); transition-duration: var(--faster); }
.dsd__d.is-mute { color: var(--n200); }
.dsd__d.is-on, .dsd__d.is-on:hover, .dsd__d.is-on.ds-hv { background: var(--brand); color: #fff; font-weight: 500; }

/* 9 — tabs --------------------------------------------------------------- */
.dstb { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--n100); }
.dstb__t {
  border: 0; background: none; cursor: pointer; font: inherit;
  padding: 0 13px 13px; font-size: var(--t-md); color: var(--n300);
  transition: color var(--fast) ease-out;
}
.dstb__t:hover, .dstb__t.ds-hv { color: var(--n400); }
.dstb__t.is-on { color: var(--n400); font-weight: 500; }
.dstb__ind {
  position: absolute; bottom: -1px; height: 2px; background: var(--brand);
  left: var(--tl, 0); width: var(--tw, 0);
  transition: left 300ms var(--e-out), width 300ms var(--e-out);
}

/* 10 — attendance stat --------------------------------------------------- */
.dss {
  height: 40px; border: 1px solid var(--n100); border-radius: var(--r-md); padding: 0 2px;
  background: var(--n0); display: flex; align-items: center; gap: 2px; font-size: var(--t-md);
}
.dss__h { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border-radius: var(--r-sm); cursor: pointer;
          transition: background-color var(--fast) ease-out; }
.dss__h:hover, .dss__h.ds-hv { background: var(--n75); transition-duration: var(--faster); }
.dss__h.is-on, .dss__h.is-on:hover, .dss__h.is-on.ds-hv { background: var(--select-bg); color: var(--p400); }
.dss__tick { width: 20px; height: 20px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; flex: none; }
.dss__n { display: inline-block; }
.dss__n.bump { animation: dss-bump 420ms var(--e-spring); }
@keyframes dss-bump { 0% { transform: scale(1); } 34% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* 11 — reactions --------------------------------------------------------- */
.dsr { display: flex; gap: 6px; }
.dsr__p {
  height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--n100);
  background: var(--n0); cursor: pointer; font: inherit; font-size: var(--t-md);
  display: inline-flex; align-items: center; gap: 5px;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsr__p:hover, .dsr__p.ds-hv { background: var(--n75); transition-duration: var(--faster); }
.dsr__p.is-on, .dsr__p.is-on:hover, .dsr__p.is-on.ds-hv {
  background: var(--p50); border-color: var(--brand); color: var(--brand);
}
.dsr__g { display: inline-block; line-height: 1; }
.dsr__p.pop .dsr__g { animation: dsr-pop 440ms var(--e-spring); }
@keyframes dsr-pop { 0% { transform: scale(1); } 36% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* 12 — the toast stack --------------------------------------------------
   Not one alert but a stack of them, because that is the state a busy
   room is actually in. Three levels — something needs doing, something
   happened, something to know — and the one that needs doing carries the
   doing: an action in the toast, so the fix does not start with hunting
   for where it lives.

   They arrive the way a stack does: one card, then the other two out from
   behind it, one up and one down. That needs the middle card to hold
   still while the others move, which a flow layout cannot do — opening a
   row above something pushes it down. So the three sit at fixed slots in
   a fixed box. It can be fixed, because every card is one line of title
   over one line of detail; if a line ever wrapped the slots would stop
   lining up, which is why the copy is short and set to nowrap. */
.dstk {
  position: relative; width: 100%; max-width: 420px;
  --card: 64px; --gap: 8px;
  height: calc(var(--card) * 3 + var(--gap) * 2);
}
.dsto {
  position: absolute; left: 0; right: 0; top: 0;
  transform: translateY(var(--y));
  transition: transform 320ms var(--e-out), opacity 180ms ease-out;
}
/* --y is set by ds.js, not by a slot: the live toasts are laid out around
   the stack's middle line, so dismissing one re-centres the rest instead
   of leaving a hole where it was. */
/* Stacked: the outer two sit on the same line as the middle one, a touch
   smaller and invisible, so fanning reads as them coming out from behind
   it rather than arriving from nowhere. */
.dsto.is-behind { opacity: 0; }
.dsto.is-behind .dsto__c { transform: scale(.94); }
/* Coming back they pop rather than slide: each lands at its own slot and
   springs up, middle first and the outer two just behind. Sliding them in
   from a stack took two beats — collapse, then fan — where this takes one. */
.dsto.is-pop { opacity: 1; }
.dsto.is-pop .dsto__c {
  animation: dsto-pop 240ms var(--e-spring) both;
  animation-delay: var(--pd, 0ms);
}
@keyframes dsto-pop { from { opacity: 0; transform: scale(.9); } }
/* While popping, the slot is already correct, so nothing tweens to it —
   the spring is the whole movement. */
.dstk.is-popping .dsto { transition: none; }
/* Dismissed: it fades where it stands. Moving it as well would read as
   two things happening instead of one. */
.dsto.is-gone { opacity: 0; pointer-events: none; }
.dsto.is-gone .dsto__c { transform: scale(.96); }

.dsto__c {
  display: flex; align-items: center; gap: 12px;
  height: var(--card, 64px); padding: 0 14px; border-radius: var(--r-lg);
  background: var(--n0); border: 1px solid var(--n100); box-shadow: var(--elev-2);
  transition: transform 320ms var(--e-out);
}
.dsto__ic { width: 24px; height: 24px; flex: none; display: grid; place-items: center; }
.dsto__b { flex: 1; min-width: 0; }
.dsto__t { display: block; font-size: var(--t-sm); font-weight: 500; line-height: 1.3; white-space: nowrap; }
.dsto__s { display: block; font-size: var(--t-xs); color: var(--n300); line-height: 1.35; margin-top: 2px; white-space: nowrap; }
/* The action. A quiet fill rather than a bordered button: it belongs to
   the toast, and an outline here would read as a second card edge. */
.dsto__a {
  flex: none; height: 30px; padding: 0 11px; border-radius: var(--r-sm); border: 0;
  background: var(--n75); color: var(--n400); font-size: var(--t-xs); font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: background-color var(--fast) ease-out;
}
.dsto__a:hover, .dsto__a.ds-hv { background: var(--n100); transition-duration: var(--faster); }
.dsto__x {
  flex: none; width: 28px; height: 28px; border: 0; background: none; border-radius: var(--r-sm);
  color: var(--n300); cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--fast) ease-out;
}
.dsto__x:hover, .dsto__x.ds-hv { background: var(--n75); transition-duration: var(--faster); }

/* Swapping a toast's level swaps its mark and its words in place, so the
   action resolves where it was taken rather than somewhere else. */
.dsto__swap { display: none; }
.dsto.is-done .dsto__swap { display: block; }
.dsto.is-done .dsto__first { display: none; }
.dsto.is-done .dsto__a { display: none; }

/* The month arrives from the side it came from, so the arrow pressed and
   the direction the calendar moves agree. */
@keyframes dsd-next { from { opacity: 0; transform: translateX(18px); } }
@keyframes dsd-prev { from { opacity: 0; transform: translateX(-18px); } }
.dsd__g.from-next, .dsd__m.from-next { animation: dsd-next 340ms var(--e-out); }
.dsd__g.from-prev, .dsd__m.from-prev { animation: dsd-prev 340ms var(--e-out); }
/* The card clips the slide, so a month never bleeds past the arrows. */
.dsd { overflow: hidden; }

/* ══ the composites ══════════════════════════════════════════════════════
   The bigger pieces: whole things out of the product rather than single
   controls. Each is rebuilt here at its real size, not screenshotted —
   which is the point of the section.
   ───────────────────────────────────────────────────────────────────── */

/* 13 — the absence suggestion -------------------------------------------
   A parent's message is also a record somebody has to make, so the
   composer reads what is being typed and offers the record as a button
   rather than a trip to another part of the product. Three states live
   here: typing, the offer, and the thing done. */
.dsn {
  width: 100%; max-width: 448px;
  background: var(--n0); border-radius: var(--r-lg); box-shadow: var(--elev-2);
  border: 1px solid var(--n100); overflow: hidden;
}
.dsn__h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.dsn__av { width: 32px; height: 32px; border-radius: 25%; object-fit: cover; flex: none; background: var(--n100); }
.dsn__who { font-size: var(--t-md); font-weight: 500; flex: 1; min-width: 0; }
.dsn__body { padding: 0 14px 14px; }

/* The offer. It is not a dialog and it does not take over: it grows into
   the space above the field the staff member is already typing in.
   Animating a grid row from 0fr to 1fr opens it to exactly its own height,
   with no guessed max-height to overshoot. */
.dsn__sug {
  border: 1px solid #e7dcfa; border-radius: var(--r-md);
  background: linear-gradient(180deg, #fbf9ff, #f7f2ff);
  padding: 13px 14px; margin-bottom: 10px;
  display: grid; gap: 11px;
  grid-template-rows: 0fr;
  padding-top: 0; padding-bottom: 0; margin-bottom: 0;
  border-color: transparent; opacity: 0;
  transition: grid-template-rows 320ms var(--e-out),
              padding 320ms var(--e-out),
              margin 320ms var(--e-out),
              opacity 220ms ease-out, border-color 220ms ease-out;
}
.dsn__sug > * { min-height: 0; overflow: hidden; }
.dsn.is-offered .dsn__sug {
  grid-template-rows: 1fr;
  padding-top: 13px; padding-bottom: 13px; margin-bottom: 10px;
  border-color: #e7dcfa; opacity: 1;
}
.dsn__sug-in { display: grid; gap: 11px; }
.dsn__sug-h { display: flex; align-items: center; gap: 9px; font-size: var(--t-md); }
.dsn__sug-h span { flex: 1; }
/* One row, never two: nowrap so a copy change shows as overflow rather
   than silently stacking them. */
.dsn__acts { display: flex; flex-wrap: nowrap; gap: 8px; }
.dsn__a {
  height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--n100);
  background: var(--n0); cursor: pointer; font-size: var(--t-sm);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsn__a:hover, .dsn__a.ds-hv { background: var(--n75); border-color: var(--n200); transition-duration: var(--faster); }
.dsn__x {
  width: 28px; height: 28px; border: 0; background: none; border-radius: var(--r-sm); flex: none;
  color: var(--n300); cursor: pointer; display: grid; place-items: center; margin: -2px -4px -2px 0;
  transition: background-color var(--fast) ease-out;
}
.dsn__x:hover, .dsn__x.ds-hv { background: rgba(105, 16, 231, .07); transition-duration: var(--faster); }

/* Done. The offer is replaced by what it produced, rather than vanishing
   and leaving the staff member to wonder whether it worked. */
.dsn__done {
  display: none; align-items: center; gap: 9px;
  padding: 11px 13px; margin-bottom: 10px; border-radius: var(--r-md);
  background: var(--ok-bg); border: 1px solid #bde3cc;
  font-size: var(--t-sm); color: #11633a;
}
.dsn.is-done .dsn__done { display: flex; animation: dsn-in 300ms var(--e-out); }
@keyframes dsn-in { from { opacity: 0; transform: translateY(-5px); } }

.dsn__field {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 11px 14px; border-radius: var(--r-md);
  border: 1px solid var(--n100); background: var(--n0);
  transition: border-color var(--fast) ease-out;
}
.dsn__field:hover, .dsn__field.ds-hv { border-color: var(--n200); }
.dsn__field:focus-within { border-color: var(--brand); }
.dsn__t {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font: inherit; font-size: var(--t-md); line-height: 1.4; color: var(--n400); resize: none;
  height: 24px; overflow: hidden;
}
.dsn__t::placeholder { color: var(--n200); }
.dsn__mic { color: var(--n300); flex: none; display: grid; place-items: center; }

/* A tile is a specimen case, and a specimen needs air around it. The
   bottom is larger than the top because the label sits down there — the
   component needs the same clearance from the words as from the edge.
   These are minimums: a tile is measured at its tallest state and held
   there, so the air never collapses as a component grows. */
.dsx__tile--wide { padding: 40px 28px 72px; }

/* 14 — the parent menu (mobile) -----------------------------------------
   The one place the parent app asks "what do you want to do?". The plus
   turns into a close, the menu grows out of it, and the rows arrive one
   after another so the eye has time to land on the first. */
.dsm {
  position: relative;
  width: 334px; height: 352px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 6px;
}
.dsm__menu {
  position: absolute; left: 0; right: 0; bottom: 74px;
  padding: 8px 14px; border-radius: var(--r-xl); background: var(--n0);
  border: 1px solid var(--n100);
  filter: drop-shadow(0 5px 1.5px rgba(104, 111, 125, .04)) drop-shadow(0 8px 2.5px rgba(104, 111, 125, .08));
  /* No gap: each row already carries 10px of its own padding, so a gap on
     top of that spaced four related choices like four separate cards. */
  display: flex; flex-direction: column; gap: 0;
  transform-origin: 88% 100%;
  opacity: 0; transform: translateY(12px) scale(.95); pointer-events: none;
  transition: opacity .1s ease-out, transform .1s ease-in;
}
.dsm.is-open .dsm__menu {
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .12s ease-out, transform .22s var(--e-spring);
}
.dsm__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -6px; padding: 10px 8px; border-radius: var(--r-md); cursor: pointer;
  opacity: 0; transform: translateY(6px);
  /* --sd carries the row's place in the stagger on opacity and transform
     alone. As a transition-delay longhand it delayed background-color as
     well, so the hover on the last row waited 105ms for its turn in an
     animation that had already finished. */
  --sd: 0ms;
  transition: opacity .08s ease-out, transform .08s ease-out, background-color var(--fast) ease-out;
}
.dsm.is-open .dsm__item {
  opacity: 1; transform: none;
  transition: opacity .14s ease-out var(--sd), transform .2s var(--e-out) var(--sd), background-color var(--fast) ease-out;
}
/* Staggered, so the menu reads as arriving rather than being switched on. */
.dsm.is-open .dsm__item:nth-child(1) { --sd: 30ms; }
.dsm.is-open .dsm__item:nth-child(2) { --sd: 55ms; }
.dsm.is-open .dsm__item:nth-child(3) { --sd: 80ms; }
.dsm.is-open .dsm__item:nth-child(4) { --sd: 105ms; }
.dsm__item:hover, .dsm__item.ds-hv,
.dsm.is-open .dsm__item:hover, .dsm.is-open .dsm__item.ds-hv {
  background: var(--n50);
  transition: opacity .14s ease-out var(--sd), transform .2s var(--e-out) var(--sd), background-color var(--faster) ease-out;
}
.dsm__item > span:first-child { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dsm__ic { width: 32px; height: 32px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; }
.dsm__ic--blue { background: #ebf5fe; } .dsm__ic--orange { background: #fff3ea; }
.dsm__ic--green { background: #edfcf6; } .dsm__ic--purple { background: #f2ecfc; }
.dsm__t { display: block; font-size: var(--t-md); font-weight: 500; line-height: 1.2; }
.dsm__s { display: block; font-size: var(--t-xs); line-height: 1.25; color: var(--n300); margin-top: 3px; white-space: nowrap; }
.dsm__ch { color: var(--n200); flex: none; }

.dsm__dock { display: flex; gap: 10px; align-items: center; justify-content: center; }
.dsm__nav {
  width: 264px; height: 60px; padding: 4px; border-radius: 999px; background: #ebe2fb;
  display: flex; transition: opacity .14s ease-out;
}
.dsm.is-open .dsm__nav { opacity: .5; }
.dsm__tab {
  position: relative; flex: 1; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: var(--t-xs); font-weight: 500; line-height: 1.2; color: var(--n400);
}
.dsm__tab.is-on { background: var(--n0); color: var(--brand); font-weight: 600; }
.dsm__tab img { display: block; }
.dsm__badge {
  position: absolute; left: 20px; top: 2px; min-width: 19px; height: 19px; padding: 0 4px;
  border-radius: 999px; background: var(--brand); border: 2px solid #ebe2fb;
  display: grid; place-items: center; color: #fff; font-size: var(--t-3xs); font-weight: 700; line-height: 1;
}
.dsm__plus {
  width: 60px; height: 60px; border-radius: 999px; background: #ebe2fb; border: 0;
  cursor: pointer; display: grid; place-items: center; color: var(--n400);
  transition: transform .18s var(--e-out), background-color var(--fast) ease-out;
}
.dsm__plus:hover, .dsm__plus.ds-hv { background: #ded0f8; transition-duration: var(--faster); }
.dsm__plus svg { transition: transform .2s var(--e-spring); }
.dsm.is-open .dsm__plus svg { transform: rotate(45deg); }

/* 15 — the child profile card ------------------------------------------
   Measured off the Figma frame rather than eyeballed: the card insets 20,
   the avatar is 94 with 16 to the text, and each key row is exactly 40
   with a 28 icon slot and 12 to the words. The two marks are the ones
   drawn for this — the filled warning and the balloon — not Tabler
   stand-ins, so they come from the same exports the prototype uses. */
.dsp2 {
  width: 100%; max-width: 320px; padding: 20px; border-radius: var(--r-lg);
  background: var(--n0); border: 1px solid var(--n100); box-shadow: var(--elev-2);
}
.dsp2__h { display: flex; gap: 16px; align-items: flex-start; }
.dsp2__av { width: 94px; height: 94px; border-radius: 25%; object-fit: cover; flex: none; background: var(--n75); }
.dsp2__id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.dsp2__n { font-size: var(--t-lg); font-weight: 500; line-height: 1.32; }
.dsp2__r { font-size: var(--t-sm); color: var(--n300); line-height: 1.27; }
.dsp2__btns { display: flex; gap: 8px; }
.dsp2__b {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--n100);
  background: var(--n0); cursor: pointer; display: grid; place-items: center; flex: none;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsp2__b img { display: block; width: 20px; height: 20px; }
.dsp2__b:hover, .dsp2__b.ds-hv { background: var(--n75); border-color: var(--n200); transition-duration: var(--faster); }

/* No rules between the rows and no chevrons: the design has neither. */
.dsp2__keys { margin-top: 12px; }
.dsp2__row { height: 40px; display: flex; align-items: center; gap: 12px; font-size: var(--t-md); line-height: 1.2; }
.dsp2__ri { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.dsp2__ri img { display: block; width: 22px; height: 22px; }
.dsp2__rt { display: flex; align-items: center; gap: 4px; }
/* The only control on the row. Everything else here is a label, so a
   chevron on each would promise two things that open and one that does
   not — the i marks the one with more behind it, at the 17px it is drawn
   at in the design. */
.dsp2__i {
  width: 17px; height: 17px; border: 0; padding: 0; flex: none;
  background: none; opacity: .8; cursor: pointer; display: grid; place-items: center;
  transition: opacity var(--fast) ease-out;
}
.dsp2__i img { display: block; width: 17px; height: 17px; }
.dsp2__i:hover, .dsp2__i.ds-hv { opacity: 1; transition-duration: var(--faster); }
.dsp2__i.is-on { opacity: 1; }
.dsp2__d { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 280ms var(--e-out); }
.dsp2__d.is-open { grid-template-rows: 1fr; }
.dsp2__d > div { overflow: hidden; min-height: 0; }
.dsp2__d p { margin: 0; padding: 0 0 8px 40px; font-size: var(--t-xs); line-height: 1.45; color: var(--n300); }

/* 16 — shift tracks ------------------------------------------------------
   A day laid out left to right, 7am to 4pm. Everything shares one scale:
   the hour labels, the gridlines, the bars and the line marking now — so
   a bar's width is a real claim about hours, not a block with a caption.
   Without the ruler the line was decoration; with it, the whole row means
   something. The prototype draws it the same way, and skips whichever
   hour label the red pill would sit on top of. */
.dsk {
  --from: 7; --to: 15;                 /* the day, in hours */
  --gut: 48px;                         /* the avatar column the scale clears */
  position: relative;
  width: 100%; max-width: 380px; padding: 14px; border-radius: var(--r-lg);
  background: var(--n0); border: 1px solid var(--n100); box-shadow: var(--elev-2);
}
/* The track area: everything positioned by time lives in this box, so one
   left edge serves the ruler, the gridlines and the now line. */
.dsk__scale { position: absolute; left: calc(14px + var(--gut)); right: 14px; top: 14px; bottom: 14px; pointer-events: none; }
.dsk__ruler { position: absolute; left: 0; right: 0; top: 0; height: 18px; }
/* The labels share the pill's 18px line box, so every time on the ruler
   sits on one baseline. Without it the pill reads as hanging low — same
   top edge, but its text is centred in a capsule and theirs was not. */
.dsk__ruler span {
  position: absolute; left: var(--p); top: 0; transform: translateX(-50%);
  height: 18px; line-height: 18px;
  font-size: var(--t-3xs); color: var(--n300); white-space: nowrap;
}
/* The first and last hour would hang half outside the track, so they pull
   back to its edges rather than centring on the gridline. */
.dsk__ruler span.at-start { transform: none; }
.dsk__ruler span.at-end { transform: translateX(-100%); }
.dsk__grid { position: absolute; left: 0; right: 0; top: 22px; bottom: 0; }
.dsk__grid i { position: absolute; left: var(--p); top: 0; bottom: 0; width: 1px; background: var(--n75); }
/* The current time, drawn through every track at once — the one thing on
   the row that is about the room rather than the person. */
/* Lifted over the bars, and only it. The line marks the moment across
   the whole room, so a bar passing over it would hide the one thing every
   row has in common — but raising the whole scale would bring the
   gridlines up too, and those belong underneath. It stays click-through,
   so the bars behind it are still reachable. */
.dsk__now { position: absolute; left: var(--nx); top: 0; bottom: 0; transform: translateX(-50%); z-index: 2; }
.dsk__now b {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  height: 18px; padding: 0 6px; border-radius: 9px; background: var(--r400);
  color: #fff; font-size: var(--t-3xs); font-weight: 500; line-height: 18px; white-space: nowrap;
}
.dsk__now i { position: absolute; left: 50%; top: 19px; bottom: 0; width: 1.5px; margin-left: -.75px; background: var(--r400); }

.dsk__rows { position: relative; padding-top: 22px; }
.dsk__row { display: flex; align-items: center; gap: 10px; height: 46px; }
.dsk__who { position: relative; width: 38px; height: 38px; flex: none; }
.dsk__who img { width: 38px; height: 38px; border-radius: 25%; object-fit: cover; background: var(--n75); }
.dsk__dot {
  position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--n0); display: grid; place-items: center;
}
.dsk__dot--in { background: var(--ok); }
.dsk__dot--sick { background: var(--r400); }
/* The lane a bar lives in, so the bar can be placed by time rather than
   stretched to fill. */
.dsk__lane { position: relative; flex: 1; min-width: 0; height: 40px; }
/* Neutral, as the product draws it: N50 on an N200 hairline, and hover
   darkens the edge and lifts the bar rather than changing the fill. */
.dsk__bar {
  position: absolute; top: 0; bottom: 0;
  left: var(--s, 0%); right: var(--e, 0%);
  border-radius: var(--r-sm); padding: 5px 9px; cursor: pointer;
  background: var(--n50); border: 1px solid var(--n200);
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  overflow: hidden;
  transition: border-color .2s ease-out, box-shadow .2s ease-out;
}
.dsk__bar:hover, .dsk__bar.ds-hv { border-color: var(--n400); box-shadow: var(--elev-2); transition-duration: var(--faster); }
/* Absent: the hatch is the whole signal. No border and no red ink — the
   product states it that way, and colouring the words as well says the
   same thing three times. Transparent rather than removed so the box
   keeps its size, and hover rings it from the inside, as the bar with no
   border has to. */
.dsk__bar--sick {
  background: repeating-linear-gradient(-45deg, #fde6e8 0 4px, #fff4f5 4px 9px);
  border-color: transparent;
}
.dsk__bar--sick:hover, .dsk__bar--sick.ds-hv {
  background: repeating-linear-gradient(-45deg, #fbd9dc 0 4px, #ffeef0 4px 9px);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px var(--n400), var(--elev-2);
}
.dsk__t { font-size: var(--t-xs); font-weight: 500; line-height: 1.2; white-space: nowrap; }
.dsk__s { font-size: var(--t-2xs); line-height: 1.2; color: var(--n300); white-space: nowrap; }


/* 17 — an activity log entry --------------------------------------------- */
.dsl { width: 100%; max-width: 392px; padding: 16px; border-radius: var(--r-lg);
       background: var(--n0); border: 1px solid var(--n100); box-shadow: var(--elev-2); }
.dsl__h { display: flex; align-items: center; gap: 10px; }
.dsl__av { width: 28px; height: 28px; border-radius: 25%; object-fit: cover; flex: none; background: var(--n75); }
/* 15, not 16: this is a log entry's subject, and at the body size it
   competed with the card it sits in. */
.dsl__t { flex: 1; min-width: 0; font-size: var(--t-sm); font-weight: 500; white-space: nowrap; }
.dsl__time { font-size: var(--t-xs); color: var(--n300); flex: none; }
/* Indented to the title, not to the card edge, now the initials chip that
   used to hold that column is gone. */
.dsl__b { display: flex; align-items: center; margin-top: 6px; padding-left: 38px; }
/* The detail hanging off a log entry. Regular weight: the entry's title
   carries the weight, and this is what it is about. */
.dsl__chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--n100); font-size: var(--t-xs); line-height: 1.2; white-space: nowrap;
}

/* 18 — the channel list --------------------------------------------------- */
.dsch { width: 100%; max-width: 320px; padding: 14px 10px; border-radius: var(--r-lg);
        background: var(--n0); border: 1px solid var(--n100); box-shadow: var(--elev-2); }
.dsch__f { display: flex; align-items: center; gap: 8px; padding: 0 6px 12px; }
.dsch__filt { margin-left: auto; color: var(--n400); display: grid; place-items: center;
              width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: none; cursor: pointer;
              transition: background-color var(--fast) ease-out; }
.dsch__filt:hover, .dsch__filt.ds-hv { background: var(--n75); transition-duration: var(--faster); }
.dsch__c {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px; border-radius: var(--r-md);
  cursor: pointer; font-size: var(--t-md);
  transition: background-color var(--fast) ease-out;
}
.dsch__c:hover, .dsch__c.ds-hv { background: var(--n50); transition-duration: var(--faster); }
.dsch__c.is-on { background: var(--select-bg); }
.dsch__hash { color: var(--n200); font-weight: 500; flex: none; }
.dsch__c.is-on .dsch__hash { color: var(--brand); }
.dsch__nm { flex: 1; min-width: 0; }
.dsch__c.is-on .dsch__nm { font-weight: 500; }
.dsch__n {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--brand);
  color: #fff; font-size: var(--t-3xs); font-weight: 600; line-height: 1;
  display: grid; place-items: center; flex: none;
}

/* 19 — a message, with reactions ------------------------------------------ */
.dsg2 { width: 100%; max-width: 360px; padding: 16px; border-radius: var(--r-lg);
        background: var(--n0); border: 1px solid var(--n100); box-shadow: var(--elev-2);
        display: flex; gap: 12px; }
.dsg2__av { width: 38px; height: 38px; border-radius: 25%; object-fit: cover; flex: none; background: var(--n75); }
.dsg2__b { flex: 1; min-width: 0; }
.dsg2__h { display: flex; align-items: baseline; gap: 8px; }
.dsg2__n { font-size: var(--t-md); font-weight: 600; }
.dsg2__time { font-size: var(--t-xs); color: var(--n300); }
.dsg2__t { font-size: var(--t-md); line-height: 1.45; margin-top: 4px; }
.dsg2__r { margin-top: 10px; }

/* 22 — Priority -----------------------------------------------------------
   The claim is not "a list with a special section". It is that the special
   section is lifted out of the list everyone already reads. So the card
   starts as a plain inbox, and the lift is the animation: the group rises
   off the stream as its own surface — label and row together inside one
   tinted card — floating over the rows beneath rather than shoving them
   down. Opening it puts it back: label gone, count gone, read.

   The group sits over a slot that keeps its height in the flow, which is
   what holds the card's overall height still. A list that grows and
   shrinks under the cursor is the thing this is trying not to be. */
.dsv {
  width: 100%; max-width: 384px; padding: 14px 10px 10px; border-radius: var(--r-lg);
  background: var(--n0); border: 1px solid var(--n100); box-shadow: var(--elev-2);
}
.dsv__h { display: flex; align-items: center; gap: 8px; padding: 0 8px 10px; }
.dsv__t { flex: 1; font-size: var(--t-lg); font-weight: 600; letter-spacing: -.01em; }
.dsv__ib {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid transparent;
  background: none; color: var(--n400); cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.dsv__ib--ring { border-color: var(--n100); }
.dsv__ib:hover, .dsv__ib.ds-hv { background: var(--n75); border-color: var(--n200); transition-duration: var(--faster); }

/* One clipping box, three rows tall. The card's height is this number
   plus its header, and nothing inside can change it — which is the point.
   The slot above the stream is empty until the message arrives; it then
   opens to the height of the group, pushing the stream down so the last
   row slips under the edge. Three heights, three states: nothing yet,
   priority, and read. */
.dsv__list { height: 168px; overflow: hidden; }   /* 3 × 56 */
.dsv__slot {
  position: relative; height: 0; z-index: 2;
  transition: height 420ms var(--e-out);
}
.dsv.is-lifted .dsv__slot { height: 98px; }
.dsv.is-settled .dsv__slot { height: 56px; }
/* Before it arrives there is nothing to see. It comes in from above the
   fold, which is where a new message comes from. */
.dsv__pri {
  position: absolute; top: 0; left: 0; right: 0;
  border: 1px solid transparent; border-radius: var(--r-lg); padding: 0 4px;
  background-image: none;
  box-shadow: 0 0 0 rgba(104, 111, 125, 0);
  opacity: 0; transform: translateY(-10px); pointer-events: none;
  transition: border-color 320ms ease-out, background-color 320ms ease-out,
              box-shadow 360ms var(--e-out),
              padding 360ms var(--e-out),
              opacity 260ms ease-out,
              transform 420ms var(--e-spring);
}
.dsv.is-lifted .dsv__pri, .dsv.is-settled .dsv__pri {
  opacity: 1; transform: none; pointer-events: auto;
}
/* The same tint and outline the absence suggestion wears, because both are
   the product having read something — one surface for that, everywhere. */
.dsv.is-lifted .dsv__pri {
  border-color: #e7dcfa;
  background-image: linear-gradient(180deg, #fbf9ff, #f7f2ff);
  padding: 8px 4px 6px;
  box-shadow: 0 12px 24px rgba(104, 111, 125, .13), 0 2px 6px rgba(104, 111, 125, .08);
}

/* The label lives inside the card with the row, and opens to its own
   height so nothing below it has to be guessed at. */
.dsv__lab {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 380ms var(--e-out), opacity 220ms ease-out;
}
.dsv__lab > span {
  overflow: hidden; min-height: 0;
  display: flex; align-items: center; gap: 7px;
  padding-left: 8px; font-size: var(--t-sm); color: var(--n400);
}
.dsv.is-lifted .dsv__lab { grid-template-rows: 1fr; opacity: 1; }
.dsv.is-lifted .dsv__lab > span { padding-bottom: 8px; }

/* The rest of the stream recedes a shade, so the lift reads as one thing
   coming forward rather than everything moving. */
.dsv__rest { transition: opacity 360ms ease-out; }
.dsv.is-lifted .dsv__rest { opacity: .5; }

/* The hover covers the whole row. A hover inset from its own item reads as
   a second, smaller thing sitting inside it. */
.dsv__row {
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 8px; border-radius: var(--r-md);
  cursor: pointer; transition: background-color var(--fast) ease-out;
}
.dsv__row:hover, .dsv__row.ds-hv { background: var(--n50); transition-duration: var(--faster); }
.dsv.is-lifted .dsv__pri .dsv__row:hover,
.dsv.is-lifted .dsv__pri .dsv__row.ds-hv { background: rgba(105, 16, 231, .06); }
.dsv__av { width: 40px; height: 40px; border-radius: 25%; object-fit: cover; flex: none; background: var(--n75); }
.dsv__b { flex: 1; min-width: 0; }
.dsv__top { display: flex; align-items: baseline; gap: 8px; }
.dsv__n { flex: 1; min-width: 0; font-size: var(--t-sm); font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsv__time { font-size: var(--t-xs); color: var(--n300); flex: none; }
.dsv__row.is-unread .dsv__time { color: var(--n400); font-weight: 500; }
.dsv__p { font-size: var(--t-xs); line-height: 1.3; color: var(--n300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0; }
/* Same badge the Inbox draws. It leaves with the priority state. */
.dsv__n2 {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--brand);
  color: #fff; font-size: var(--t-3xs); font-weight: 600; line-height: 1;
  display: grid; place-items: center; flex: none;
  transition: opacity 180ms ease-out, transform 240ms var(--e-in);
}
.dsv__row.is-read .dsv__n2 { opacity: 0; transform: scale(.55); }
.dsv__row.is-read .dsv__n { font-weight: 500; }

/* ── collections ────────────────────────────────────────────────────────
   Three tiles holding the small parts, grouped by what they are for. One
   control on its own in a tile this size reads as a specimen pinned to a
   board; together they read as a set. */
.dsx__set { display: grid; gap: 26px; justify-items: center; width: 100%; }
.dsx__set > * { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.dsx__rule { width: 72px; height: 1px; background: var(--n100); display: block; }

/* While ds.js measures each tile's tallest state, nothing may animate or
   it would measure a frame mid-transition. */
.dsx.is-measuring * { transition: none !important; animation: none !important; }

/* 20 — the stepper -------------------------------------------------------
   The digits roll rather than swap. A swapped number tells you it changed;
   a rolled one tells you which way, which is the whole question when you
   are counting children. Each column is a strip of ten (eleven for the
   tens, with a blank at the top so 9 does not become 09) translated by
   whole cells, so the type never re-renders and never blurs. */
.dsq { display: flex; align-items: center; gap: 4px; padding: 5px;
       background: var(--n0); border-radius: var(--r-lg); box-shadow: var(--elev-2);
       border: 1px solid var(--n100); }
.dsq__b {
  width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: var(--n75);
  color: var(--n400); cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--fast) ease-out, transform .18s var(--e-out);
}
.dsq__b:hover, .dsq__b.ds-hv { background: var(--n100); transition-duration: var(--faster); }
.dsq__b:active { transform: scale(.93); }
.dsq__b[disabled] { color: var(--n200); cursor: default; background: var(--n50); }
.dsq__v {
  display: flex; justify-content: center; min-width: 76px; height: 44px; overflow: hidden;
  font-size: var(--t-xl); font-weight: 500; line-height: 44px; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.dsq__col { height: 44px; overflow: hidden; }
.dsq__strip {
  display: block;
  transform: translateY(calc(var(--d, 0) * -44px));
  transition: transform 420ms var(--e-out);
}
.dsq__strip > span { display: block; height: 44px; text-align: center; }
/* No roll on the first paint, or every counter animates in from zero. */
.dsq.is-still .dsq__strip { transition: none; }

/* 21 — the button stage --------------------------------------------------
   Four controls that do the same job at different widths, shown one at a
   time in one fixed box.

   The primary does not fade into the four — it splits into them. All four
   start stacked at the primary's own centre, then fly out to their places
   on a spring that overshoots and settles. Crucially they do not fly in
   step: each has its own duration and its own head start, so the group
   arrives ragged and then evens out, which is what reads as fluid rather
   than mechanical. The numbers below are deliberately not a sequence. */
.dsy { position: relative; width: 252px; height: 44px; }
.dsy__cta, .dsy__row, .dsy__seg, .dsy__date {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.dsy__row { --pitch: 50px; gap: 8px; }
.dsy__cta { gap: 12px; }

.dsy__cta, .dsy__row, .dsy__seg, .dsy__date { pointer-events: none; }
.dsy[data-stage="0"] .dsy__cta,
.dsy[data-stage="1"] .dsy__row,
.dsy[data-stage="2"] .dsy__seg,
.dsy[data-stage="3"] .dsy__date { pointer-events: auto; }

/* 0 — the primary. Leaving, it shrinks as the four burst out of it. */
.dsy__cta {
  opacity: 0; transform: scale(.72);
  transition: opacity 110ms ease-out, transform 200ms var(--e-in);
}
.dsy[data-stage="0"] .dsy__cta {
  opacity: 1; transform: none;
  transition: opacity 130ms ease-out 40ms, transform 420ms var(--e-spring) 40ms;
}

/* 1 — the four. Closed, every one sits at the centre point the primary
   occupied; opening deals them outward. */
.dsy__row > * {
  opacity: 0;
  transform: translateX(calc(var(--i) * var(--pitch) * -1)) scale(.3);
  transition: opacity 110ms ease-out, transform 200ms var(--e-in);
}
.dsy[data-stage="1"] .dsy__row > * {
  opacity: 1; transform: none;
  transition: opacity 130ms ease-out, transform var(--sd) var(--e-spring) var(--st);
}
/* Uneven on purpose: the inner pair leads, and neither pair is matched. */
.dsy[data-stage="1"] .dsy__row > :nth-child(1) { --sd: 360ms; --st: 34ms; }
.dsy[data-stage="1"] .dsy__row > :nth-child(2) { --sd: 275ms; --st: 0ms; }
.dsy[data-stage="1"] .dsy__row > :nth-child(3) { --sd: 310ms; --st: 16ms; }
.dsy[data-stage="1"] .dsy__row > :nth-child(4) { --sd: 390ms; --st: 48ms; }

/* 2 and 3 — these arrive whole, so they scale up as one. */
.dsy__seg, .dsy__date {
  opacity: 0; transform: scale(.86);
  transition: opacity 100ms ease-out, transform 180ms var(--e-in);
}
.dsy[data-stage="2"] .dsy__seg,
.dsy[data-stage="3"] .dsy__date {
  opacity: 1; transform: none;
  transition: opacity 150ms ease-out, transform 420ms var(--e-spring);
}

/* The switch: one track, a sliding white tile, icon plus word. */
/* 4px between the options, so a hover never touches the chosen tile —
   two lit surfaces meeting on a shared edge read as one wider control.
   The tile measures its target, so the gap needs no correction. */
.dsw { position: relative; display: inline-flex; gap: 4px; padding: 3px; background: var(--n100); border-radius: var(--r-md); }
.dsw__i {
  position: absolute; z-index: 0; top: 3px; bottom: 3px;
  left: var(--wl, 3px); width: var(--ww, 0);
  background: var(--n0); border-radius: var(--r-sm); box-shadow: var(--elev-2);
  transition: left 300ms var(--e-out), width 300ms var(--e-out);
}
.dsw__o {
  position: relative; z-index: 1;
  height: 36px; padding: 0 14px; border: 0; background: none; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--t-sm); color: var(--n300); cursor: pointer;
  transition: color var(--fast) ease-out;
}
.dsw__o img, .dsw__o svg { display: block; }
.dsw__o img { opacity: .55; transition: opacity var(--fast) ease-out; }
.dsw__o.is-on img { opacity: 1; }
/* Only the option not already chosen: the chosen one already sits on the
   white tile, and a wash under that reads as two surfaces. */
.dsw__o:not(.is-on):hover, .dsw__o:not(.is-on).ds-hv {
  color: var(--n400); background: rgba(45, 45, 57, .055);
}
.dsw__o:hover img, .dsw__o.ds-hv img { opacity: 1; }
.dsw__o { transition: color var(--fast) ease-out, background-color var(--fast) ease-out; }
.dsw__o.is-on { color: var(--n400); font-weight: 500; }

.dsz {
  display: inline-flex; align-items: center; height: 42px; padding: 3px;
  border: 1px solid var(--n100); border-radius: 999px; background: var(--n0);
}
.dsz__b {
  height: 36px; border: 0; background: none; border-radius: 999px; cursor: pointer;
  color: var(--n400); display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--fast) ease-out;
}
.dsz__b:hover, .dsz__b.ds-hv { background: var(--n75); transition-duration: var(--faster); }
.dsz__b:active { background: var(--n100); }
.dsz__arrow { width: 36px; }
/* Wide enough for the longest date it can show, so the pill is one size
   and only the word inside it changes. A control that resizes under the
   cursor is what people notice, instead of the thing that changed. */
.dsz__now {
  width: 132px; padding: 0 8px; font-size: var(--t-md); font-weight: 400;
  white-space: nowrap; overflow: hidden; justify-content: center;
  transition: background-color var(--fast) ease-out;
}
/* The button holds the width; the word holds the hover. Highlighting the
   whole 132px would light a box far wider than the thing being pointed
   at — the reserved space is a layout decision, not a target. */
.dsz__now:hover, .dsz__now.ds-hv { background: none; }
.dsz__now span {
  display: block; padding: 6px 14px; border-radius: 999px;
  transition: background-color var(--fast) ease-out;
}
.dsz__now:hover span, .dsz__now.ds-hv span { background: var(--n75); }
.dsz__now:active span { background: var(--n100); }
/* The new date arrives from the side the arrow points — the same move the
   calendar makes when it steps a month. */
.dsz__now span.from-next { animation: dsd-next 300ms var(--e-out); }
.dsz__now span.from-prev { animation: dsd-prev 300ms var(--e-out); }
.dsz__b[disabled] { color: var(--n200); cursor: default; }
.dsz__b[disabled]:hover { background: none; }
.dsz__b svg { display: block; }

/* The one that latches. Yellow because it is a mark, not a state of the
   control — the others do their thing and are done. */
.dsi.is-star {
  background: #fdf5da; border-color: #f0dd9a; color: #a9790a;
}
.dsi.is-star:hover, .dsi.is-star.ds-hv { background: #fcf0c8; border-color: #e8d074; }
.dsi.is-star svg { fill: #f6c945; }

/* ── narrower screens ───────────────────────────────────────────────────
   Two columns, then one. The components keep their size; the tiles give up
   padding rather than scaling anything down. */
/* ── narrower screens ───────────────────────────────────────────────────
   Two columns all the way down, never one. A component drawn at its real
   size — the phone is 364px, the suggestion card 420 — would fill a phone
   screen edge to edge, and a page of full-bleed specimens reads as a
   series of screenshots rather than a set of parts. So the tiles keep
   their pairing and the components shrink inside them.

   `zoom`, not `transform: scale()`: zoom is taken into account during
   layout, so the tile still sizes itself to what it holds and the
   height-lock in ds.js measures something true. A scaled transform would
   leave every tile reserving its full desktop footprint.

   The steps are computed, not guessed: at each width the column is
   (page − 2 × --page-pad − gap) / 2, less the tile's own padding, over the
   420px of the widest component. */
/* Everything in a tile except its label and its cursor — so this holds for
   all twelve without a wrapper class, and keeps holding through the
   {"restore"} step that rebuilds a tile's markup. The cursor stays at page
   scale: it is the visitor's pointer, not part of the specimen. */
.dsx__tile > :not(.dsx__name):not(.dsx__cursor) { zoom: var(--z, 1); }

@media (max-width: 1100px) {
  /* Two columns, and the three authored ones stop being boxes. A 3-into-2
     grid puts columns 1 and 3 in the same visual column and column 2 on
     its own, so one side ends up with twice the tiles. Multi-column takes
     the twelve as a flat run and balances them by height instead — which
     is the only way to get an even split when the tiles are all different
     sizes.

     The authored columns still group the tiles for reading order on wide
     screens; here they simply get out of the way. */
  .dsx__grid { display: block; columns: 2; column-gap: 20px; }
  .dsx__col { display: contents; }
  .dsx__tile { break-inside: avoid; margin-bottom: 20px; }
}
@media (max-width: 900px) { .dsx { --z: .82; } }
@media (max-width: 760px) {
  .dsx { --z: .68; }
  .dsx__grid { column-gap: 16px; }
  .dsx__tile { margin-bottom: 16px; }
  .dsx { --tile-r: 22px; }
  .dsx__tile { min-height: 230px; padding: 22px; }
  .dsx__tile--wide { padding: 22px 18px 46px; }

}
@media (max-width: 600px) {
  .dsx { --z: .52; }
  .dsx__grid { column-gap: 12px; }
  .dsx__tile { margin-bottom: 12px; }
  .dsx { --tile-r: 18px; }
  .dsx__tile { min-height: 180px; padding: 16px; }
  .dsx__tile--wide { padding: 16px 12px 38px; }
  .dsx__name { left: 14px; bottom: 12px; font-size: var(--t-3xs); }

}
@media (max-width: 450px) {
  .dsx { --z: .4; }
  .dsx__grid { column-gap: 10px; }
  .dsx__tile { margin-bottom: 10px; }
  .dsx { --tile-r: 16px; }
  .dsx__tile { min-height: 150px; padding: 12px; }
  .dsx__tile--wide { padding: 12px 10px 32px; }
  .dsx__name { left: 11px; bottom: 9px; font-size: var(--t-3xs); }

}
