@layer keep.tokens, keep.reset, keep.base, keep.layout, keep.components, keep.utilities;

/* Taurus Grotesk, the UI typeface (decisions.md → UI typeface), self-hosted
   from fonts/ beside this file and licensed for keep.host. Bold covers 600
   and 700 so `strong` never falls through to Black. */
@font-face {
  font-family: "Taurus Grotesk";
  src: url("fonts/TaurusGrotesk-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Taurus Grotesk";
  src: url("fonts/TaurusGrotesk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Taurus Grotesk";
  src: url("fonts/TaurusGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Taurus Grotesk";
  src: url("fonts/TaurusGrotesk-Bold.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Taurus Grotesk";
  src: url("fonts/TaurusGrotesk-Heavy.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Regular Italic, for the book's relationship values (October 26, 2026).
   Not preloaded: only a contact's spread sets it. */
@font-face {
  font-family: "Taurus Grotesk";
  src: url("fonts/TaurusGrotesk-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}


@layer keep.tokens {
  :root {
    color-scheme: light;

    --keep-color-white: #ffffff;
    --keep-color-ivory: #f5f1e8;
    /* Light cream: Ivory's warmth at half strength, for a contained
       surface that should stay close to the page (a summary row). */
    --keep-color-light-cream: #faf8f3;
    --keep-color-travertine: #ded5c5;
    --keep-color-vein: #b8ad9d;
    --keep-color-ink: #07090B;
    --keep-color-graphite: #35322f;
    --keep-color-umber: #6f675e;
    --keep-color-silver: #c8c5be;
    --keep-color-gold: #d8b66a;
    --keep-color-gold-ink: #a8792a;
    --keep-color-electric: #0047ff;
    --keep-color-signal-green: #0bce38;
    --keep-color-ornament-gray: #f1f1f1;
    --keep-color-display-text-gray: #737373;

    --keep-color-canvas: var(--keep-color-white);
    --keep-color-surface: var(--keep-color-white);
    --keep-color-surface-warm: var(--keep-color-ivory);
    /* A wash: White with a touch of Ivory, for broad bands that should read
       as white with warmth rather than as a contained Ivory surface. */
    --keep-color-surface-wash: color-mix(in srgb, var(--keep-color-ivory) 30%, var(--keep-color-white));
    --keep-color-surface-muted: var(--keep-color-travertine);
    --keep-color-text: var(--keep-color-ink);
    --keep-color-text-soft: var(--keep-color-umber);
    --keep-color-accent: var(--keep-color-electric);
    --keep-color-on-accent: var(--keep-color-white);
    --keep-color-border: color-mix(in srgb, var(--keep-color-ink) 16%, transparent);
    --keep-color-focus: #2864dc;
    --keep-color-danger: #a42b22;
    --keep-color-success: #25704a;

    --keep-font-sans: "Taurus Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --keep-font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
    --keep-font-size-sm: 0.8125rem;
    --keep-font-size-body: 1rem;
    --keep-font-size-title: clamp(1.25rem, 2vw, 1.625rem);
    --keep-line-body: 1.5;

    --keep-space-1: 0.25rem;
    --keep-space-2: 0.5rem;
    --keep-space-3: 0.75rem;
    --keep-space-4: 1rem;
    --keep-space-5: 1.5rem;
    --keep-space-6: 2rem;
    --keep-space-7: 3rem;
    --keep-space-8: 5rem;
    --keep-baseline: 8px;

    --keep-radius-sm: 0.375rem;
    --keep-radius-md: 0.75rem;
    --keep-radius-lg: 1.25rem;
    --keep-shadow-contact: 0 1px 1px rgb(7 9 11 / 13%);
    --keep-shadow-soft: 0 0.25rem 0.5rem rgb(7 9 11 / 5.5%),
      0 0.75rem 1.5rem rgb(7 9 11 / 5.5%);
    --keep-content-wide: 76rem;
    --keep-content-reading: 42rem;
    --keep-breakpoint-s: 36rem;
    --keep-breakpoint-m: 42rem;
    --keep-breakpoint-l: 64rem;
    --keep-page-gutter: clamp(1rem, 4vw, 4rem);
    --keep-transition-fast: 140ms;
  }
}

@layer keep.reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    text-size-adjust: 100%;
  }

  body,
  h1,
  h2,
  h3,
  p,
  figure {
    margin: 0;
  }

  button,
  input,
  select,
  textarea {
    color: inherit;
    font: inherit;
  }

  img,
  svg {
    display: block;
    max-width: 100%;
  }
}

@layer keep.base {
  /* The page reaches under Safari's status bar and toolbar
     (viewport-fit=cover in the head), so a fixed layer such as a modal's
     underlay covers the whole screen and the bars show it; the body keeps
     its content out of the safe areas with padding, which fixed layers
     ignore. */
  body {
    background: var(--keep-color-canvas);
    box-sizing: border-box;
    color: var(--keep-color-text);
    /* Out from under a phone's bars, the insets rounded up to the grid so
       what follows stays on it (59px → 64, 34 → 40). */
    padding-block: round(up, env(safe-area-inset-top, 0px), var(--keep-baseline))
      round(up, env(safe-area-inset-bottom, 0px), var(--keep-baseline));
    padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
    font-family: var(--keep-font-sans);
    font-feature-settings: "ss01" 1;
    font-kerning: normal;
    font-size: var(--keep-font-size-body);
    font-synthesis: none;
    line-height: var(--keep-line-body);
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
  }

  a {
    color: currentColor;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
  }

  :focus-visible {
    outline: 0.1875rem solid var(--keep-color-focus);
    outline-offset: 0.1875rem;
  }

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

@layer keep.layout {
  .keep-layout-page {
    margin-inline: auto;
    max-width: var(--keep-content-wide);
    padding: var(--keep-space-7) var(--keep-page-gutter) var(--keep-space-8);
  }

  .keep-layout-stack {
    display: flex;
    flex-direction: column;
    gap: var(--keep-stack-gap, var(--keep-space-4));
  }

  .keep-layout-cluster {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-cluster-gap, var(--keep-space-3));
  }

  .keep-layout-reading {
    max-width: var(--keep-content-reading);
  }

  /* Centers one block in the viewport and keeps it on the baseline grid.
     The grid centers the item; the exact center usually falls between grid
     lines, so the item nudges itself by the difference between the rounded
     and the exact offset, computed from the viewport and its own height.
     The item must be a whole number of grid units tall. A browser without
     round() still centers, at most 4px off the grid. */
  .keep-layout-center {
    align-content: center;
    display: grid;
    min-height: 100vh;
  }

  .keep-layout-center__item {
    transform: translateY(calc(round(nearest, 50vh - 50%, var(--keep-baseline)) - (50vh - 50%)));
  }
}

@layer keep.components {
  /* The brand lockup, shared by the onboarding wordmark and the footer
     colophon. */
  .keep-brand {
    /* Cap height (0.74em) of exactly 17px: 17px / 0.74 is 22.97px. The
       line box is trimmed to 29.28px so that, with the face's 1.045em
       ascender and 1.275em content area, the baseline falls 24px below the
       top of the box and lands on the 40px line. */
    --keep-brand-cap: 17px;
    --keep-brand-mark: calc(var(--keep-baseline) * 3);
    font-size: calc(var(--keep-brand-cap) / 0.74);
    /* The wordmark is kerned by hand, pair by pair. Font kerning is off and
       tracking is zero, so each gap is the two glyphs' sidebearings plus the
       pair's own value below. At this size Bold's sidebearings alone give
       K-e 0.040em, e-e 0.067em, e-p 0.093em (1.1px, 1.8px, 2.5px); the pair
       values add to those. These were set by eye with the catalog's kerning
       tool on October 12, 2026: the K's arm tucks over the e, and the round
       pairs close to under a pixel. Medium was tried here and read limp. */
    --keep-brand-kern-ke: -0.085em;
    --keep-brand-kern-ee: -0.045em;
    --keep-brand-kern-ep: -0.050em;
    color: var(--keep-color-ink);
    font-kerning: none;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 29.28px;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
  }

  /* letter-spacing on a glyph adds space after it, so each span carries the
     value for the pair it starts. The last glyph gets none. */
  .keep-brand__glyph:nth-of-type(1) {
    letter-spacing: var(--keep-brand-kern-ke);
  }

  .keep-brand__glyph:nth-of-type(2) {
    letter-spacing: var(--keep-brand-kern-ee);
  }

  .keep-brand__glyph:nth-of-type(3) {
    letter-spacing: var(--keep-brand-kern-ep);
  }

  /* Logo placeholder: an Ornament gray 24px circle centered on the 17px cap
     height, so it overshoots the caps by 3.5px above and below, the way a
     mark usually sits beside its wordmark. The visual gap to the K is 0.55
     of the cap height (about 10px), measured ink to ink: the K's own left
     sidebearing in Bold (0.066em) is subtracted from the margin. */
  .keep-brand::before {
    background: var(--keep-color-ornament-gray);
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: var(--keep-brand-mark);
    margin-right: calc(var(--keep-brand-cap) * 0.55 - 0.066em);
    vertical-align: calc((var(--keep-brand-cap) - var(--keep-brand-mark)) / 2);
    width: var(--keep-brand-mark);
  }

  /* The one section-title style: Regular, tight, and never larger than the
     hero. Components add their own margins beside it. */
  .keep-heading {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0;
    text-wrap: balance;
  }

  .keep-eyebrow {
    color: var(--keep-color-text-soft);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .keep-title {
    font-size: clamp(2.5rem, 7vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 0.94;
  }

  .keep-intro {
    margin: var(--keep-space-6) auto 0;
    max-width: var(--keep-content-wide);
    padding-inline: var(--keep-page-gutter);
    position: relative;
  }

  /* Centered in the viewport, the intro gives up its top margin: the layout
     owns the vertical position. */
  .keep-layout-center .keep-intro {
    margin-top: 0;
  }

  /* Accolades: a pill and a laurel accolade above the headline. The row is
     32px tall and takes its room out of the hero's top padding, so the
     headline stays on the same grid line as before: 3 units above the row,
     3 below it, then the hero's own 7.5px baseline offset. */
  .keep-accolades {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-space-2) var(--keep-space-5);
    min-height: calc(var(--keep-baseline) * 4);
    /* Padding, not margin: a margin here would collapse into the intro's
       own top margin and lift the whole hero by a beat. */
    padding-top: calc(var(--keep-baseline) * 3);
  }

  .keep-size-s .keep-accolades {
    padding-top: calc(var(--keep-baseline) * 9);
  }

  .keep-accolades__pill {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-accent) 8%, var(--keep-color-white));
    border-radius: 999px;
    color: var(--keep-color-accent);
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.35rem;
    height: calc(var(--keep-baseline) * 4);
    padding: 0 0.85rem;
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-accolades__pill:hover {
    background: color-mix(in srgb, var(--keep-color-accent) 14%, var(--keep-color-white));
  }

  /* Hidden below the small size so the row never wraps on phones and the
     hero stays on its grid line. */
  .keep-accolades__laurels {
    align-items: center;
    color: var(--keep-color-text-soft);
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.35rem;
    height: calc(var(--keep-baseline) * 4);
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-size-s .keep-accolades__laurels {
    display: inline-flex;
  }

  .keep-accolades__laurels:hover {
    color: var(--keep-color-ink);
  }

  /* The laurel is the left half of Tabler Icons' laurel-wreath (MIT): an
     outline branch in the soft text color, mirrored for the right side. */
  .keep-accolades__laurel {
    color: var(--keep-color-text-soft);
    fill: none;
    height: 1.75rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
    width: 0.875rem;
  }

  .keep-accolades__laurel--right {
    transform: scaleX(-1);
  }

  /* The hero is the one peak of the page: Bold, and the largest type. At
     the large size it steps up to 56px in a 64px line box; the padding's
     fractional part keeps the first baseline on the grid at each size
     (7.5px for 40px type, 1.18px for 56px). */
  .keep-hero {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: calc(var(--keep-baseline) * 6);
    margin: 0 0 0 -3px;
    padding-top: calc(7.5px + var(--keep-baseline) * 3);
    text-align: left;
  }

  .keep-size-l .keep-hero {
    font-size: 3.5rem;
    line-height: calc(var(--keep-baseline) * 8);
    margin-left: -4px;
    padding-top: calc(1.18px + var(--keep-baseline) * 3);
  }

  .keep-lede {
    color: var(--keep-color-text-soft);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 21.5px 0 0;
    max-width: 36rem;
  }

  .keep-caption {
    color: var(--keep-color-text-soft);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 2);
    margin: 21.5px 0 0;
    max-width: 36rem;
  }

  /* The hero's one action: the Electric pill, the same size and weight as
     the closing action, so the page opens and closes with one voice. It sits
     four grid units below the headline's last baseline and is 40px tall, so
     the next element starts on a grid line. Use it once per page. */
  .keep-intro__action {
    background: var(--keep-color-accent);
    border-radius: 999px;
    color: var(--keep-color-on-accent);
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 5);
    margin-top: calc(var(--keep-baseline) * 4);
    padding: 0 1.25rem;
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-intro__action:hover {
    background: color-mix(in srgb, var(--keep-color-ink) 14%, var(--keep-color-accent));
  }

  /* A small title over the hero's body copy: the body size in Bold, one
     line on the 16px baseline, with two grid units of air under it. Its
     5.5px top padding lands the baseline on a grid line; the paragraph that
     follows drops its own top padding, so its first baseline is 40px below
     the title's. */
  .keep-intro__title {
    font-size: var(--keep-font-size-body);
    font-weight: 700;
    line-height: calc(var(--keep-baseline) * 3);
    max-width: 36rem;
    padding: 5.5px 0 calc(var(--keep-baseline) * 2);
  }

  .keep-intro__title + .keep-intro__text {
    padding-top: 0;
  }

  /* Body copy in the hero: Regular at the body size, every line on the 16px
     baseline in a 24px line box. The 5.5px top padding lands the first
     baseline on a grid line and the 2.5px bottom padding rounds the box to
     whole units, so whatever follows starts on the grid. */
  .keep-intro__text {
    font-size: var(--keep-font-size-body);
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 3);
    max-width: 36rem;
    padding: 5.5px 0 2.5px;
  }

  /* PublicFooter (partials/public-footer.leaf.html): the foot of the
     signed-out pages, three rows in the page's gutter under a hairline.
     FooterLinkColumnsRow: columns of links under 12px titles in the soft
     ink, as many across as fit at 10rem each, so a phone gets two or
     three and a window all of them. FooterBrandMomentRow: the address set
     as a wordmark, large, in the brand's weight. FooterUtilityRow: the
     appearance switch at the end. A page that doesn't fill the window
     keeps the footer at its foot. */
  .keep-public-footer {
    border-block-start: 1px solid color-mix(in srgb, var(--keep-color-ink) 8%, transparent);
    color: var(--keep-color-text-soft);
    display: grid;
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 2);
    margin: auto var(--keep-page-gutter, 1rem) 0;
    padding-block: calc(var(--keep-baseline) * 4 - 1px) calc(var(--keep-baseline) * 3);
    row-gap: calc(var(--keep-baseline) * 4);
  }

  body:has(> .keep-public-footer) {
    display: flex;
    flex-direction: column;
    /* The viewport's height rounded down to the grid, so the footer, pinned
       to the bottom, lands on it; the few pixels left under the body show
       the page's own background. */
    min-block-size: round(down, 100vh, var(--keep-baseline));
  }

  /* In the column, a step or hero keeps its full width: its auto margins
     would otherwise shrink it to its content and center that. */
  body:has(> .keep-public-footer) > .keep-intro {
    box-sizing: border-box;
    inline-size: 100%;
  }

  /* A centered page with the footer: the item centers in the room above
     the footer by its margins, not by the viewport transform. */
  body.keep-layout-center:has(> .keep-public-footer) > .keep-layout-center__item {
    margin-block: auto;
    transform: none;
  }

  .keep-public-footer__columns {
    display: grid;
    gap: calc(var(--keep-baseline) * 3) var(--keep-space-5);
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  }

  .keep-public-footer__title {
    color: var(--keep-color-ink);
    font-size: 1rem;
    font-weight: 500;
    /* Its baseline on the guide, two units into its three-unit line. */
    inset-block-start: -2.5px;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
    position: relative;
  }

  .keep-public-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  /* Each link is a row four baselines tall across its column, a thumb's
     target on a phone, at 16px. */
  .keep-public-footer__link {
    -webkit-tap-highlight-color: transparent;
    color: #949494;
    display: block;
    font-size: 1rem;
    font-weight: 500;
    /* Its baseline on the guide, three units into its four-unit row. */
    inset-block-start: 1.5px;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 4);
    position: relative;
    text-decoration: none;
    transition: color 200ms ease;
  }

  /* An outbound link's mark: Tabler's arrow-up-right at 14px after the
     word, 2px off it. */
  .keep-public-footer__outbound {
    block-size: 14px;
    display: inline-block;
    inline-size: 14px;
    margin-inline-start: 2px;
    vertical-align: -2px;
  }

  /* Fading to the ink on hover, no underline. */
  .keep-public-footer__link:hover {
    color: var(--keep-color-ink);
  }

  /* The brand row stands eight units clear of the utility row, past the
     footer's own gap. */
  .keep-public-footer__brand {
    margin-block-end: calc(var(--keep-baseline) * 8);
  }

  /* The brand moment: the address in the brand's face and weight, a size
     up from the step's title on a phone, the ink; a link home with no
     underline. */
  .keep-public-footer__wordmark {
    color: var(--keep-color-ink);
    display: inline-block;
    font-family: "Taurus Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-kerning: none;
    /* The columns' size, so the brand reads as one more of them. */
    font-size: 1rem;
    font-weight: 700;
    /* Its baseline on the guide, two units into its three-unit line. */
    inset-block-start: -2.5px;
    letter-spacing: -0.02em;
    /* Three baselines, so the tagline under it stays on the grid. */
    line-height: calc(var(--keep-baseline) * 3);
    position: relative;
    text-decoration: none;
    vertical-align: top;
  }

  /* The line under the wordmark, a row like a column's links: 16px on
     four units, in the ink. */
  .keep-public-footer__tagline {
    color: var(--keep-color-ink);
    font-size: 1rem;
    font-weight: 400;
    /* Its baseline on the guide, three units into its four-unit row. */
    inset-block-start: 1.5px;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 4);
    /* Pulled up a unit, its baseline two under the wordmark's. */
    margin: calc(var(--keep-baseline) * -1) 0 0;
    position: relative;
  }

  .keep-public-footer__utility {
    align-items: center;
    display: flex;
    justify-content: space-between;
  }

  /* The utility row's controls are four units tall, for a thumb: the
     status chip, a rounded rectangle filled in the service's color
     (green, orange, red) with its word in white in
     the mono face in capitals, a link when there is a status page; and the appearance switch's buttons, four units tall
     and five wide here. */
  .keep-status-chip {
    --keep-status-color: #3ec412;
    align-items: center;
    background: var(--keep-status-fill);
    block-size: calc(var(--keep-baseline) * 3.5);
    border-radius: 8px;
    color: var(--keep-status-ink);
    display: inline-flex;
    font-family: var(--keep-font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding-inline: var(--keep-space-2);
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
  }

  button.keep-status-chip {
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-family: var(--keep-font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .keep-status-chip:hover {
    filter: brightness(0.95);
  }

  /* The status's icon before the word: Tabler's circle-check, alarm, or
     alert-triangle-filled at 18px. The filled one is solid white; the
     status color shows through its cutouts. */
  .keep-status-chip__icon {
    block-size: 18px;
    flex: none;
    inline-size: 18px;
    margin-inline-end: calc(var(--keep-space-1) + 1px);
  }

  /* The word and the time share a baseline inside the centered chip. */
  .keep-status-chip__text {
    align-items: baseline;
    display: inline-flex;
  }

  /* When the status last changed, after the word: Taurus Regular at 12px,
     not capitals or tracked, a shade quieter. */
  .keep-status-chip__ago {
    font-family: var(--keep-font-sans);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0;
    margin-inline-start: calc(var(--keep-space-2) - 2px);
    opacity: 0.72;
    text-transform: none;
  }

  .keep-status-chip[data-keep-status="degraded"] {
    --keep-status-color: #ff6d05;
  }

  .keep-status-chip[data-keep-status="down"] {
    /* Tyler's red, not the danger brick. */
    --keep-status-color: #ff2a00;
  }

  /* The fill is the status color, solid, and the word white, in both
     modes. */
  .keep-status-chip {
    --keep-status-fill: var(--keep-status-color);
    --keep-status-ink: #fff;
  }

  /* In the modal's text the chip is a smaller tag, three units tall. */
  .keep-modal__text .keep-status-chip {
    block-size: calc(var(--keep-baseline) * 3);
    padding-inline: var(--keep-space-3);
  }

  /* In the public footer the switch's three buttons share one indicator:
     a pill the size of a button that slides to the chosen one
     (public-appearance.js sets --keep-appearance-index, 0 to 2), so the
     buttons themselves paint no fill. A device set to less motion gets
     the move without the slide. (These rules sit after the chip's and
     the modal tag's on purpose: an edit to the chip has twice replaced
     the block they shared.) */
  .keep-public-footer .keep-appearance {
    --keep-appearance-index: 0;
    isolation: isolate;
    position: relative;
  }

  .keep-public-footer .keep-appearance::before {
    background: color-mix(in srgb, var(--keep-color-ink) 8%, transparent);
    block-size: calc(var(--keep-baseline) * 4);
    border-radius: 999px;
    content: "";
    inline-size: calc(var(--keep-baseline) * 5);
    inset-block-start: 0;
    inset-inline-start: 0;
    position: absolute;
    transform: translateX(calc(var(--keep-appearance-index) * (var(--keep-baseline) * 5 + 2px)));
    transition: transform 240ms cubic-bezier(0.2, 0, 0, 1);
    z-index: -1;
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-public-footer .keep-appearance::before {
      transition: none;
    }
  }

  .keep-public-footer .keep-appearance__choice {
    -webkit-tap-highlight-color: transparent;
    block-size: calc(var(--keep-baseline) * 4);
    inline-size: calc(var(--keep-baseline) * 5);
  }

  .keep-public-footer .keep-appearance__choice[aria-pressed="true"] {
    background: transparent;
    box-shadow: none;
    color: var(--keep-color-ink);
  }

  .keep-public-footer .keep-appearance__icon {
    block-size: 20px;
    inline-size: 20px;
  }

  /* A modal in two layers (modal.js): the underlay over the whole window,
     the page behind dimmed in ink and blurred; the overlay above it, the
     box centered in it, the page's white with the dialog's corner and
     shadow, 32rem at most and a gutter from a phone's edges. The page
     behind stops scrolling while one is showing. */
  .keep-modal {
    inset: 0;
    position: fixed;
    z-index: 20;
  }

  .keep-modal[hidden] {
    display: none;
  }

  /* The underlay veils the page in the veil color (--keep-modal-veil:
     white in light mode, black in dark) at 55% over a blur. Safari paints
     its status bar and toolbar in one flat color taken from the document's
     background (no page content ever shows under them), so while a modal
     shows the document takes the veil color, and the underlay fades to it,
     solid, along its top and bottom, so the bars and the underlay meet in
     one color. */
  .keep-modal__underlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background:
      linear-gradient(
        to bottom,
        var(--keep-modal-dim-flat) 0,
        var(--keep-modal-dim) calc(var(--keep-baseline) * 10),
        var(--keep-modal-dim) calc(100% - var(--keep-baseline) * 14),
        var(--keep-modal-dim-flat) 100%
      );
    inset: 0;
    position: absolute;
  }

  .keep-modal {
    --keep-modal-dim: color-mix(in srgb, var(--keep-modal-veil) 55%, transparent);
    --keep-modal-dim-flat: var(--keep-modal-veil);
  }

  .keep-modal__overlay {
    align-items: center;
    display: grid;
    inset: 0;
    justify-items: center;
    padding: max(var(--keep-page-gutter, 1rem), env(safe-area-inset-top, 0px))
      max(var(--keep-page-gutter, 1rem), env(safe-area-inset-right, 0px))
      max(var(--keep-page-gutter, 1rem), env(safe-area-inset-bottom, 0px))
      max(var(--keep-page-gutter, 1rem), env(safe-area-inset-left, 0px));
    pointer-events: none;
    position: absolute;
  }

  .keep-modal__box {
    background: var(--keep-color-white);
    border: 1px solid color-mix(in srgb, var(--keep-color-ink) 10%, transparent);
    border-radius: 1rem;
    box-sizing: border-box;
    color: var(--keep-color-text);
    inline-size: min(32rem, 100%);
    outline: none;
    padding: var(--keep-space-3) calc(var(--keep-space-4) + 2px) var(--keep-space-4);
    pointer-events: auto;
  }

  /* ModalNavBar: the box's first row, four units tall, the title at the
     start in the body size, Medium, on the row's line, and the close at
     the end, the two the same height. */
  .keep-modal__bar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-block-size: calc(var(--keep-baseline) * 4);
  }

  .keep-modal__title {
    font-size: var(--keep-font-size-body);
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 4);
    margin: 0;
  }

  .keep-modal__text {
    align-items: center;
    color: var(--keep-color-text-soft);
    column-gap: var(--keep-space-2);
    display: flex;
    font-size: 0.875rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin: var(--keep-baseline) 0 0;
  }

  /* The bar's close: Tabler's x in a four-unit square at the bar's end,
     the soft ink firming on hover; its square overhangs the box's padding
     by a unit so the x's strokes sit on the text's right edge. */
  .keep-modal__dismiss {
    align-items: center;
    appearance: none;
    background: none;
    block-size: calc(var(--keep-baseline) * 4);
    border: 0;
    border-radius: 999px;
    color: var(--keep-color-text-soft);
    cursor: pointer;
    display: inline-flex;
    inline-size: calc(var(--keep-baseline) * 4);
    justify-content: center;
    margin-inline-end: calc(var(--keep-baseline) * -1);
    padding: 0;
  }

  .keep-modal__dismiss:hover {
    color: var(--keep-color-ink);
  }

  .keep-modal__dismiss-icon {
    block-size: 20px;
    inline-size: 20px;
  }

  /* A non-closeable modal's response: Cancel and Okay side by side at the
     end of the box, four units tall, two units under what the box says;
     Cancel in a hairline, Okay solid ink. */
  .keep-modal__response {
    column-gap: var(--keep-space-2);
    display: flex;
    justify-content: flex-end;
    margin-block-start: calc(var(--keep-baseline) * 3);
  }

  .keep-modal__cancel,
  .keep-modal__okay {
    appearance: none;
    block-size: calc(var(--keep-baseline) * 4);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    min-inline-size: calc(var(--keep-baseline) * 10);
    padding-inline: var(--keep-space-4);
  }

  .keep-modal__cancel {
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--keep-color-ink) 16%, transparent);
    color: var(--keep-color-ink);
  }

  .keep-modal__cancel:hover {
    border-color: color-mix(in srgb, var(--keep-color-ink) 32%, transparent);
  }

  .keep-modal__okay {
    background: var(--keep-color-ink);
    border: 1px solid var(--keep-color-ink);
    color: var(--keep-color-white);
  }

  html[data-keep-modal-showing] {
    overflow: hidden;
  }

  html[data-keep-modal-showing],
  html[data-keep-modal-showing] body {
    background: var(--keep-modal-veil);
  }

  /* The centered wordmark sits on the underlay, not under it: crisp, and
     still the link home, above the modal's layers. */
  html[data-keep-modal-showing] .keep-onboarding__brand {
    z-index: 21;
  }

  /* A legal page (pages/legal.leaf.html), an onboarding step without a
     form: prose on the baseline under the title, 36rem wide, two units
     under the title, the PublicFooter after it. The version and effective
     date are the step's eyebrow. */
  .keep-legal__body {
    margin-block-start: calc(var(--keep-baseline) * 2);
    max-width: 36rem;
  }

  /* The text's baselines on the guide: 16px on three units sits 2.5px low,
     so each text block lifts by that, its layout untouched; the rules of a
     table, a quote, and an hr stay on the lines. */
  .keep-legal__body :is(h2, h3, h4, p, li, th, td) {
    inset-block-start: -2.5px;
    position: relative;
  }

  /* Under the small title, taking back the half pixel its padding leaves,
     as the recording and the form do, so the prose and the footer after it
     stay on the grid. */
  .keep-onboarding__title--small + .keep-legal__body {
    margin-block-start: calc(var(--keep-baseline) * 2 - 0.5px);
  }

  /* With I agree pinned under a page that can run long (a document a
     member was sent to from the updated-policies page, or that page's
     cards), the page ends fourteen units early so the group covers
     neither the last lines nor the footer. */
  body:has(.keep-legal__agree, .keep-link-summaries) {
    padding-block-end: calc(var(--keep-baseline) * 14);
  }

  /* The group over a long page: on the canvas, fading in over three
     units at its top, down to the window's edge, so what is under it
     scrolls under it and stays readable above it. */
  body:has(.keep-legal__agree, .keep-link-summaries) .keep-onboarding-buttons {
    background: linear-gradient(to top, var(--keep-color-canvas) calc(100% - var(--keep-baseline) * 3), transparent);
    /* Lifted onto the guide like any group, and reaching a unit past the
       window's edge with a unit more padding, so the lift (under a unit)
       never opens a gap under the backdrop; the fine print still ends a
       unit above the edge, on the guide. The buttons come a unit closer
       to it. */
    gap: var(--keep-baseline);
    inset-block-end: calc(-1 * var(--keep-baseline));
    padding-block: calc(var(--keep-baseline) * 3) calc(var(--keep-baseline) * 2 + env(safe-area-inset-bottom, 0px));
  }

  .keep-legal__body h2,
  .keep-legal__body h3,
  .keep-legal__body h4 {
    font-size: var(--keep-font-size-body);
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 3);
    margin: calc(var(--keep-baseline) * 3) 0 0;
  }

  .keep-legal__body p,
  .keep-legal__body li {
    font-size: var(--keep-font-size-body);
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
  }

  /* Three units between blocks; a heading's own text follows it at once. */
  .keep-legal__body :not(h2, h3, h4) + p,
  .keep-legal__body ul,
  .keep-legal__body ol {
    margin-block-start: calc(var(--keep-baseline) * 3);
  }

  .keep-legal__body ul,
  .keep-legal__body ol {
    padding-inline-start: 1.25rem;
  }

  .keep-legal__body a {
    color: inherit;
  }

  /* The rest of a document's shapes, plain and on the grid until they are
     designed: a quote set off by a rule at its side, a table of rows three
     units tall, a horizontal rule, and code in the mono face. */
  .keep-legal__body blockquote {
    border-inline-start: 2px solid color-mix(in srgb, var(--keep-color-ink) 16%, transparent);
    margin: calc(var(--keep-baseline) * 3) 0 0;
    padding-inline-start: var(--keep-space-4);
  }

  .keep-legal__body table {
    border-collapse: collapse;
    font-size: var(--keep-font-size-body);
    inline-size: 100%;
    line-height: calc(var(--keep-baseline) * 3);
    margin-block-start: calc(var(--keep-baseline) * 3);
  }

  /* The rule under each row is drawn inside the cell, so the rows stay a
     whole number of units tall. */
  .keep-legal__body th,
  .keep-legal__body td {
    box-shadow: inset 0 -1px color-mix(in srgb, var(--keep-color-ink) 10%, transparent);
    padding: 0 var(--keep-space-3) 0 0;
    text-align: start;
    vertical-align: top;
  }

  .keep-legal__body th {
    font-weight: 500;
  }

  /* The rule's pixel comes out of the three units above it. */
  .keep-legal__body hr {
    border: 0;
    border-block-start: 1px solid color-mix(in srgb, var(--keep-color-ink) 10%, transparent);
    margin: calc(var(--keep-baseline) * 3 - 1px) 0 0;
  }

  /* No line box of its own, or the mono face's metrics would stretch the
     line it sits in. */
  .keep-legal__body code {
    font-family: var(--keep-font-mono);
    font-size: 0.875em;
    line-height: 0;
  }

  /* A row of pills offering the reader a choice. The paragraph's box ends
     one unit under its last baseline, and three more units put the row 32px
     below that baseline. The 24px pills keep the row on the grid. The row
     is six units tall whatever it holds, room for the invitation form's
     error line, so a centered page keeps its place when the row swaps for
     the form and when the form gains the error. */
  .keep-choices {
    align-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-space-2);
    margin-top: calc(var(--keep-baseline) * 3);
    min-block-size: calc(var(--keep-baseline) * 6);
  }

  .keep-frame {
    margin-top: 45.5px;
    position: relative;
  }

  /* Placeholder for the product visual: the wash with an Ornament stroke,
     the same treatment as the app tiles, so it sits inside the palette. */
  .keep-placeholder {
    background: var(--keep-color-surface-wash);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 1rem;
    height: 336px;
  }

  .keep-bubble {
    display: none;
    --keep-bubble-blue: #0a84fe;
    background: linear-gradient(
      180deg,
      #6cb8ff 0%,
      #2d96f8 48%,
      var(--keep-bubble-blue) 64%,
      var(--keep-bubble-blue) 100%
    );
    border-radius: 32px;
    border-bottom-right-radius: 36px;
    color: var(--keep-color-white);
    filter: drop-shadow(0 0.25rem 0.5rem rgb(7 9 11 / 5.5%))
      drop-shadow(0 0.75rem 1.5rem rgb(7 9 11 / 5.5%));
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.25;
    padding: 1.35rem 1.5rem 1.5rem;
    position: absolute;
    right: var(--keep-page-gutter);
    top: 0;
    transform: scale(0.65);
    transform-origin: top right;
    width: min(26rem, 92%);
    z-index: 0;
  }

  .keep-bubble__tail {
    bottom: -12px;
    color: var(--keep-bubble-blue);
    display: block;
    height: 50px;
    pointer-events: none;
    position: absolute;
    right: -2px;
    width: 76px;
  }

  .keep-bubble p {
    margin: 0;
  }

  .keep-hero__line {
    display: block;
    white-space: nowrap;
  }

  .keep-changelog {
    align-items: baseline;
    display: flex;
    gap: 0.85rem;
    margin: calc(var(--keep-baseline) * 3) 0 0;
  }

  .keep-changelog__label,
  .keep-changelog__link {
    color: var(--keep-color-ink);
    font-size: 0.9375rem;
    line-height: 1.4;
    text-decoration: none;
  }

  .keep-changelog__label {
    font-weight: 600;
  }

  .keep-changelog__link {
    font-weight: 400;
  }

  .keep-changelog__link:hover {
    color: var(--keep-color-text-soft);
  }

  .keep-statement {
    font-size: 1.625rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: calc(var(--keep-baseline) * 4);
    margin: 24.5px 0 0 -2px;
    max-width: 40rem;
  }

  .keep-statement__lead {
    color: var(--keep-color-ink);
  }

  .keep-statement__rest {
    color: var(--keep-color-display-text-gray);
  }

  /* Cities: a trust block of city cards. Each card leads with the city,
     then a headline stat, then one person from that city as the example:
     avatar, name, and their most popular handle with the network's glyph.
     Centered caption above and a link below. Stats, names, and handles are
     placeholders until real figures and consented people replace them. */
  .keep-cities {
    margin-top: calc(var(--keep-baseline) * 12);
  }

  .keep-cities__caption {
    color: var(--keep-color-text-soft);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 4);
    margin: 0;
    text-wrap: balance;
  }

  .keep-cities__list {
    display: grid;
    gap: var(--keep-space-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    list-style: none;
    margin: calc(var(--keep-baseline) * 8) 0 0;
    padding: 0;
    text-align: left;
  }

  .keep-size-m .keep-cities__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .keep-size-l .keep-cities__list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .keep-cities__card {
    background: var(--keep-color-surface-wash);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: calc(var(--keep-baseline) * 2);
  }

  .keep-cities__city {
    font-size: var(--keep-font-size-sm);
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 2);
    margin: 0;
  }

  .keep-cities__stat {
    display: flex;
    flex-direction: column;
    margin: calc(var(--keep-baseline) * 2) 0 0;
  }

  .keep-cities__number {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: calc(var(--keep-baseline) * 4);
  }

  .keep-cities__label {
    color: var(--keep-color-text-soft);
    font-size: var(--keep-font-size-sm);
    line-height: calc(var(--keep-baseline) * 2);
  }

  .keep-cities__person {
    align-items: center;
    border-top: 1px solid var(--keep-color-ornament-gray);
    display: flex;
    gap: var(--keep-space-2);
    margin-top: calc(var(--keep-baseline) * 3);
    min-width: 0;
    padding-top: calc(var(--keep-baseline) * 2 - 1px);
  }

  .keep-cities__avatar {
    background: color-mix(in srgb, var(--keep-color-ink) 10%, var(--keep-color-white));
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    height: calc(var(--keep-baseline) * 4);
    width: calc(var(--keep-baseline) * 4);
  }

  .keep-cities__who {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .keep-cities__name {
    font-size: var(--keep-font-size-sm);
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-cities__handle {
    align-items: center;
    color: var(--keep-color-text-soft);
    display: inline-flex;
    font-size: 0.75rem;
    gap: 0.3rem;
    line-height: calc(var(--keep-baseline) * 2);
    min-width: 0;
    text-decoration: none;
  }

  .keep-cities__handle:hover {
    color: var(--keep-color-ink);
  }

  .keep-cities__handle svg {
    fill: currentColor;
    flex-shrink: 0;
    height: 0.7rem;
    width: 0.7rem;
  }

  .keep-cities__link {
    color: var(--keep-color-text-soft);
    display: inline-block;
    font-size: var(--keep-font-size-body);
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 3);
    margin-top: calc(var(--keep-baseline) * 8);
    text-decoration: none;
  }

  .keep-cities__link:hover {
    color: var(--keep-color-ink);
  }

  /* Features: a two-by-two grid of feature cards between the cities and
     the integrations. Each card is a title, a short description, and a
     visual area at the bottom, a placeholder until real product footage
     exists. One column at the base size, two from the medium size. */
  .keep-features {
    margin-top: calc(var(--keep-baseline) * 12);
  }

  .keep-features__grid {
    display: grid;
    gap: var(--keep-space-4);
    grid-template-columns: minmax(0, 1fr);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .keep-size-m .keep-features__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* The card is square; the visual takes whatever height the text leaves. */
  .keep-features__card {
    aspect-ratio: 1;
    background: var(--keep-color-surface-wash);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: calc(var(--keep-baseline) * 3);
  }

  .keep-features__title {
    font-size: var(--keep-font-size-body);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
    text-wrap: balance;
  }

  .keep-features__copy {
    color: var(--keep-color-text-soft);
    font-size: 0.9375rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin: var(--keep-baseline) 0 calc(var(--keep-baseline) * 3);
    max-width: 34rem;
  }

  /* Fills the rest of the square below the text and sits at the bottom, so
     the visuals in a row share a bottom edge. */
  .keep-features__visual {
    background: var(--keep-color-white);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 0.5rem;
    flex: 1 1 auto;
    margin-top: auto;
    min-height: calc(var(--keep-baseline) * 12);
    width: 100%;
  }

  /* Specs: benchmark rows under the feature grid. A header with a title
     and a lede; then a list of metrics, each a small-caps
     label and two bars: the competitor's, short and gray, and Keep's, long
     and Electric-tinted, with a success-colored delta badge. Bar lengths
     come from the --keep-bar custom property set on each bar; the hidden
     text after each name carries the actual value. A footnote closes it.
     Figures are placeholders until a real benchmark exists. */
  .keep-specs {
    margin-top: calc(var(--keep-baseline) * 12);
  }

  .keep-specs__header {
    max-width: 40rem;
  }

  .keep-specs__title {
    margin: 0;
  }

  .keep-specs__lede {
    color: var(--keep-color-text-soft);
    font-size: 1.125rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin: var(--keep-baseline) 0 0;
    max-width: 36rem;
  }

  .keep-specs__list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--keep-baseline) * 3);
    margin: calc(var(--keep-baseline) * 4) 0 0;
  }

  .keep-specs__metric {
    display: flex;
    flex-direction: column;
    gap: calc(var(--keep-baseline) / 2);
  }

  /* The label leads with the theme word in Ink, then the metric in soft. */
  .keep-specs__label {
    color: var(--keep-color-ink);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: calc(var(--keep-baseline) * 3);
    margin-bottom: calc(var(--keep-baseline) / 2);
    text-transform: uppercase;
  }

  .keep-specs__sub {
    color: var(--keep-color-text-soft);
    font-weight: 500;
  }

  .keep-specs__sub::before {
    color: var(--keep-color-vein);
    content: "·";
    margin-inline: 0.5rem;
  }

  .keep-specs__bar {
    align-items: center;
    display: flex;
    gap: var(--keep-space-2);
    margin: 0;
    min-width: 0;
  }

  /* The fill's width is a share of the space left after the name and
     badge, so the longest bar reaches toward the right edge. */
  .keep-specs__fill {
    border-radius: 0.375rem;
    flex: 0 1 calc(var(--keep-bar, 100%) * 0.62);
    height: calc(var(--keep-baseline) * 3);
    min-width: calc(var(--keep-baseline) * 5);
  }

  .keep-specs__bar--other .keep-specs__fill {
    background: color-mix(in srgb, var(--keep-color-ink) 10%, var(--keep-color-white));
  }

  .keep-specs__bar--keep .keep-specs__fill {
    background: color-mix(in srgb, var(--keep-color-accent) 18%, var(--keep-color-white));
  }

  .keep-specs__who {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    font-size: var(--keep-font-size-sm);
    font-weight: 500;
    gap: 0.4rem;
    white-space: nowrap;
  }

  .keep-specs__icon,
  .keep-specs__mark {
    border-radius: 0.25rem;
    display: block;
    flex-shrink: 0;
    height: 1.125rem;
    width: 1.125rem;
  }

  .keep-specs__icon {
    background: var(--keep-color-ink);
    fill: var(--keep-color-white);
    padding: 0.2rem;
  }

  .keep-specs__mark {
    background: var(--keep-color-accent);
  }

  .keep-specs__delta {
    background: color-mix(in srgb, var(--keep-color-accent) 10%, var(--keep-color-white));
    border-radius: 0.375rem;
    color: var(--keep-color-accent);
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 2.5);
    padding: 0 0.45rem;
    white-space: nowrap;
  }

  .keep-specs__note {
    color: var(--keep-color-text-soft);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    line-height: calc(var(--keep-baseline) * 3);
    margin: calc(var(--keep-baseline) * 3) 0 0;
    text-transform: uppercase;
  }

  /* Apps: an integrations block after the people. A centered header, then
     a band of app tiles that slides continuously. The band breaks out of
     the page gutter to the viewport edges. Glyphs are from Simple Icons
     (CC0); the track is duplicated, with the copy hidden from assistive
     tech, so the loop has no seam. */
  .keep-apps {
    margin-top: calc(var(--keep-baseline) * 12);
  }

  .keep-apps__header {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    max-width: 40rem;
  }

  .keep-apps__title {
    margin: 0;
  }

  .keep-apps__lede {
    color: var(--keep-color-text-soft);
    font-size: 1.125rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin: calc(var(--keep-baseline) * 2) 0 0;
    text-wrap: balance;
  }

  .keep-apps__action {
    border: 1px solid var(--keep-color-border);
    border-radius: 999px;
    color: var(--keep-color-ink);
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 5 - 2px);
    margin-top: calc(var(--keep-baseline) * 4);
    padding: 0 1.1rem;
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-apps__action:hover {
    border-color: var(--keep-color-vein);
  }

  .keep-apps__band {
    display: flex;
    margin-inline: calc(-1 * var(--keep-page-gutter));
    margin-top: calc(var(--keep-baseline) * 10);
    overflow: hidden;
    /* Fade the ends so tiles enter and leave softly. */
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  }

  .keep-apps__track {
    animation: keep-apps 60s linear infinite;
    display: flex;
    flex-shrink: 0;
    gap: var(--keep-space-4);
    list-style: none;
    margin: 0;
    padding: 0 calc(var(--keep-space-4) / 2);
  }

  .keep-apps__tile {
    align-items: center;
    background: var(--keep-color-surface-wash);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 1rem;
    display: flex;
    flex-shrink: 0;
    height: calc(var(--keep-baseline) * 9);
    justify-content: center;
    width: calc(var(--keep-baseline) * 9);
  }

  .keep-apps__tile svg {
    fill: var(--keep-color-ink);
    height: 1.625rem;
    width: 1.625rem;
  }

  @keyframes keep-apps {
    from {
      transform: translateX(0);
    }

    to {
      transform: translateX(-100%);
    }
  }

  .keep-compare-section {
    margin-top: calc(var(--keep-baseline) * 12);
  }

  .keep-compare__lede {
    color: var(--keep-color-text-soft);
    font-size: 1.125rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin: var(--keep-baseline) 0 0;
    max-width: 36rem;
  }

  .keep-compare-scroll {
    margin-top: calc(var(--keep-baseline) * 4);
    overflow-x: auto;
  }

  .keep-compare {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
  }

  .keep-compare__feature {
    width: 32%;
  }

  .keep-compare caption {
    caption-side: top;
  }

  .keep-compare th,
  .keep-compare td {
    border-bottom: 0;
    font-size: 0.9375rem;
    font-weight: 400;
    padding: 0.85rem 0.35rem;
    text-align: center;
    vertical-align: middle;
  }

  .keep-compare thead th {
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 3);
    padding-bottom: 10.5px;
    padding-top: 8.5px;
  }

  .keep-compare thead th:last-child {
    font-weight: 500;
  }

  .keep-compare tbody th {
    font-size: 0;
    line-height: 0;
    padding-bottom: 14.5px;
    padding-left: 0;
    padding-right: 0.75rem;
    padding-top: 17.5px;
    text-align: left;
    vertical-align: top;
    width: 32%;
  }

  .keep-compare__label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 2);
  }

  .keep-compare tbody td {
    font-size: 0;
    line-height: 0;
    padding-bottom: 14.5px;
    padding-top: 17.5px;
  }

  .keep-compare tbody tr:not(:last-child) th,
  .keep-compare tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--keep-color-border);
    padding-bottom: 13.5px;
  }

  /* Keep's column carries the wash so the eye finds it first. */
  .keep-compare th:last-child,
  .keep-compare td:last-child {
    background: var(--keep-color-surface-wash);
  }

  .keep-compare tbody tr:hover th,
  .keep-compare tbody tr:hover td {
    background: #f3f3f3;
  }

  .keep-compare__mark {
    align-items: center;
    display: inline-flex;
    justify-content: center;
  }

  .keep-compare__mark svg {
    fill: none;
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
    width: 1rem;
  }

  .keep-compare__mark--yes {
    color: var(--keep-color-success);
  }

  .keep-compare__mark--no {
    color: #c4c4c4;
  }

  @media (max-width: 36rem) {
    .keep-compare__feature {
      width: 28%;
    }

    .keep-compare thead th {
      font-size: 0.75rem;
      line-height: calc(var(--keep-baseline) * 2);
      padding-bottom: 13px;
      padding-inline: 0;
      padding-top: 14px;
    }
  }

  /* Phrase band: things people ask Keep to do, as a static row of quoted
     chips that wraps. It used to scroll; the app band already moves, and
     the phrases read better standing still. */
  .keep-phrase-band {
    margin: calc(var(--keep-baseline) * 12) auto;
    max-width: var(--keep-content-wide);
    padding-inline: var(--keep-page-gutter);
  }

  .keep-phrase-band__title {
    margin: 0;
  }

  .keep-phrase-band__lede {
    color: var(--keep-color-text-soft);
    font-size: 1.125rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin: var(--keep-baseline) 0 0;
    max-width: 36rem;
  }

  .keep-phrase-band__line {
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-space-2);
    margin: calc(var(--keep-baseline) * 4) 0 0;
  }

  .keep-phrase-band__line[aria-hidden="true"] {
    display: none;
  }

  .keep-phrase-band__phrase {
    background: var(--keep-color-surface-wash);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 999px;
    font-size: var(--keep-font-size-body);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 5 - 2px);
    padding: 0 0.9rem;
    white-space: nowrap;
  }

  /* Closing call to action: a centered Ivory band between the phrase band
     and the footer. Vertical rhythm is in baseline units: 12 above and
     below, 4 between the title and lede, 5 before the action, 6 after it. */
  .keep-closing {
    background: var(--keep-color-surface-wash);
    padding: calc(var(--keep-baseline) * 12) var(--keep-page-gutter);
    text-align: center;
  }

  .keep-closing__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-inline: auto;
    max-width: 52rem;
  }

  .keep-closing__title {
    margin: 0;
  }

  .keep-closing__lede {
    font-size: 1.375rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 4);
    margin: calc(var(--keep-baseline) * 4) 0 0;
    text-wrap: balance;
  }

  .keep-closing__action {
    background: var(--keep-color-accent);
    border-radius: 999px;
    color: var(--keep-color-on-accent);
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 5);
    margin-top: calc(var(--keep-baseline) * 5);
    padding: 0 1.25rem;
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-closing__action:hover {
    background: color-mix(in srgb, var(--keep-color-ink) 14%, var(--keep-color-accent));
  }

  .keep-closing__fine {
    color: var(--keep-color-text-soft);
    font-size: var(--keep-font-size-body);
    line-height: calc(var(--keep-baseline) * 3);
    margin: calc(var(--keep-baseline) * 6) 0 0;
  }

  .keep-closing__link {
    color: var(--keep-color-text-soft);
    font-size: var(--keep-font-size-body);
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 3);
    margin-top: var(--keep-baseline);
    text-decoration: none;
  }

  .keep-closing__link:hover {
    color: var(--keep-color-ink);
  }

  .keep-footer {
    background: var(--keep-color-surface-wash);
    color: var(--keep-color-ink);
    font-family: "Taurus Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    margin-top: 0;
    padding: var(--keep-space-8) var(--keep-page-gutter) var(--keep-space-7);
  }

  /* The link groups are direct grid items, so the column count is set by
     width alone: one below the small breakpoint, two from there, three from
     the medium breakpoint up. */
  .keep-footer__inner {
    display: grid;
    gap: 2.75rem clamp(2.5rem, 8vw, 6rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: auto;
    max-width: var(--keep-content-wide);
  }

  @media (width >= 42rem) {
    .keep-footer__inner {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  .keep-footer__title {
    color: var(--keep-color-text-soft);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.4;
    margin: 0 0 0.8rem;
  }

  .keep-footer__links {
    display: flex;
    flex-direction: column;
    gap: calc(0.4rem - 6px);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .keep-footer__link {
    color: var(--keep-color-ink);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
  }

  .keep-footer__link:hover {
    color: var(--keep-color-text-soft);
  }

  /* Outbound links carry a small up-right arrow (Tabler arrow-up-right,
     MIT) in the soft color, and a hidden "opens in a new tab" note. It sits
     inside a keep-nowrap span with the link's last word, so a long label
     still wraps between its words and the arrow never wraps alone. */
  .keep-footer__outbound {
    color: var(--keep-color-text-soft);
    display: inline;
    fill: none;
    height: 0.75rem;
    margin-inline-start: 0.1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    vertical-align: 0;
    width: 0.75rem;
  }

  /* Colophon: the lockup, social links, and fine print under the link
     groups. An Ornament gray hairline separates it; the padding below the
     line keeps the first row starting on a grid line. */
  .keep-footer__colophon {
    border-top: 1px solid var(--keep-color-ornament-gray);
    display: grid;
    gap: calc(var(--keep-baseline) * 3) var(--keep-space-5);
    grid-template-columns: 1fr auto;
    margin-inline: auto;
    margin-top: calc(var(--keep-baseline) * 8);
    max-width: var(--keep-content-wide);
    padding-top: calc(var(--keep-baseline) * 4 - 1px);
  }

  .keep-footer__colophon .keep-brand {
    align-self: center;
    justify-self: start;
  }

  .keep-footer__social {
    align-items: center;
    align-self: center;
    display: flex;
    gap: var(--keep-space-2);
    list-style: none;
    /* Each 18px icon sits in a 32px round hit area. Pulling the list out by
       the 7px difference puts the icon ink, not the hit area, on the gutter
       line at whichever edge the list sits. */
    margin: 0 calc((1.125rem - var(--keep-baseline) * 4) / 2);
    padding: 0;
  }

  .keep-footer__social-link {
    align-items: center;
    border-radius: 999px;
    color: var(--keep-color-text-soft);
    display: inline-flex;
    height: calc(var(--keep-baseline) * 4);
    justify-content: center;
    width: calc(var(--keep-baseline) * 4);
  }

  .keep-footer__social-link:hover {
    color: var(--keep-color-ink);
  }

  .keep-footer__social-link svg {
    fill: currentColor;
    height: 1.125rem;
    width: 1.125rem;
  }

  .keep-footer__fine {
    align-items: baseline;
    color: var(--keep-color-text-soft);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--keep-font-size-sm);
    gap: var(--keep-space-2) var(--keep-space-5);
    grid-column: 1 / -1;
    line-height: calc(var(--keep-baseline) * 2);
    margin: 0;
  }

  .keep-footer__fine-links {
    display: flex;
    gap: var(--keep-space-4);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .keep-footer__fine-link {
    color: var(--keep-color-text-soft);
    text-decoration: none;
  }

  .keep-footer__fine-link:hover {
    color: var(--keep-color-ink);
  }

  .keep-button {
    align-items: center;
    appearance: none;
    background: var(--keep-color-ink);
    border: 1px solid var(--keep-color-ink);
    border-radius: var(--keep-radius-sm);
    color: var(--keep-color-ivory);
    cursor: pointer;
    display: inline-flex;
    font-weight: 600;
    gap: var(--keep-space-2);
    justify-content: center;
    line-height: 1.2;
    min-block-size: 2.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition:
      background-color var(--keep-transition-fast) ease,
      border-color var(--keep-transition-fast) ease,
      color var(--keep-transition-fast) ease;
  }

  .keep-button:hover {
    background: var(--keep-color-graphite);
    border-color: var(--keep-color-graphite);
  }

  .keep-button--secondary {
    background: var(--keep-color-white);
    border-color: var(--keep-color-border);
    color: var(--keep-color-ink);
  }

  .keep-button--secondary:hover {
    background: var(--keep-color-ivory);
    border-color: var(--keep-color-vein);
  }

  .keep-button--danger {
    background: var(--keep-color-danger);
    border-color: var(--keep-color-danger);
    color: var(--keep-color-white);
  }

  .keep-button:disabled,
  .keep-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
  }

  /* Small monochrome pill: 24px tall, a 4px corner, an Ornament stroke, ink
     text at 12px in Regular. The quiet counterpart to the Electric
     action, for links or buttons that offer a choice rather than press one. */
  .keep-pill {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 4px;
    color: var(--keep-color-ink);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 3 - 2px);
    padding: 0 var(--keep-space-2);
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-pill:hover {
    border-color: color-mix(in srgb, var(--keep-color-ink) 16%, var(--keep-color-white));
  }

  /* The solid pill: ink with white text, for the one choice the page leans
     toward. Same height and type as the outlined pill. */
  .keep-pill--solid {
    background: var(--keep-color-ink);
    border-color: var(--keep-color-ink);
    color: var(--keep-color-white);
  }

  .keep-pill--solid:hover {
    background: var(--keep-color-graphite);
    border-color: var(--keep-color-graphite);
  }

  /* The detail head: what a page is, at its top, under the navigation
     (after libraries.dev's component pages). A seven-unit icon tile with a
     16px corner in the panel's fill and hairline, then the title at 28px
     on a four-unit line in Medium, tracked -0.03em, then the lede at 14px
     in the soft ink. Two units clear of what is above, two between the tile and
     the title, one between the title and the lede. */
  .keep-detail-head {
    display: flex;
    flex-direction: column;
    gap: var(--keep-baseline);
    margin-block: var(--keep-space-4) var(--keep-baseline);
  }

  .keep-detail-head__icon {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-ink) 5%, transparent);
    block-size: calc(var(--keep-baseline) * 7);
    border: 1px solid color-mix(in srgb, var(--keep-color-ink) 8%, transparent);
    border-radius: 1rem;
    color: var(--keep-color-text-soft);
    display: inline-flex;
    font-size: 1.25rem;
    font-weight: 500;
    inline-size: calc(var(--keep-baseline) * 7);
    justify-content: center;
    margin-block-end: var(--keep-baseline);
  }

  /* The title and the lede are lifted onto the baseline guide (3.5px and
     1.5px), every line of them, without moving what follows. */
  .keep-detail-head__title {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: calc(var(--keep-baseline) * 4);
    position: relative;
    top: -3.5px;
  }

  .keep-detail-head__lede {
    color: var(--keep-color-text-soft);
    font-size: 0.875rem;
    line-height: calc(var(--keep-baseline) * 3);
    position: relative;
    top: -1.5px;
  }

  /* The panel link: a whole card that is one link, for a page worth a
     picture (after libraries.dev's cards). A subtle gray panel with a
     hairline stroke and a 20px corner holds the media, a 1.85:1 image
     with a 12px corner (a gray placeholder until there is one), and under
     it the foot: a 48px icon tile, then the title in Medium and a soft
     line under it. Low contrast on purpose; hover firms up the stroke. */
  .keep-panel-link {
    background: color-mix(in srgb, var(--keep-color-ink) 3%, transparent);
    border: 1px solid color-mix(in srgb, var(--keep-color-ink) 8%, transparent);
    border-radius: var(--keep-radius-lg);
    color: var(--keep-color-ink);
    display: flex;
    flex-direction: column;
    gap: var(--keep-space-3);
    max-inline-size: 32rem;
    padding: var(--keep-space-3);
    text-decoration: none;
  }

  .keep-panel-link:hover {
    border-color: color-mix(in srgb, var(--keep-color-ink) 16%, transparent);
  }

  .keep-panel-link__media {
    aspect-ratio: 1.85;
    background: color-mix(in srgb, var(--keep-color-ink) 6%, transparent);
    border-radius: var(--keep-radius-md);
    display: block;
    object-fit: cover;
    overflow: hidden;
    inline-size: 100%;
  }

  .keep-panel-link__foot {
    align-items: center;
    display: flex;
    gap: var(--keep-space-4);
    padding: var(--keep-space-1);
  }

  .keep-panel-link__icon {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-ink) 5%, transparent);
    block-size: calc(var(--keep-baseline) * 6);
    border: 1px solid color-mix(in srgb, var(--keep-color-ink) 8%, transparent);
    border-radius: var(--keep-radius-md);
    color: var(--keep-color-text-soft);
    display: inline-flex;
    flex: none;
    font-weight: 500;
    inline-size: calc(var(--keep-baseline) * 6);
    justify-content: center;
  }

  .keep-panel-link__text {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
  }

  .keep-panel-link__title {
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 3);
  }

  .keep-panel-link__subtitle {
    color: var(--keep-color-text-soft);
    font-size: var(--keep-font-size-sm);
    line-height: calc(var(--keep-baseline) * 3);
  }

  /* The panel link row: the panel link's smaller sibling, for a link that
     needs no picture. One word or a few, centered, in Medium on a seven-unit
     row with the panel's gray fill and a 12px corner; no stroke. Hover
     deepens the fill. Several stack in keep-panel-link-rows, a baseline
     apart. */
  .keep-panel-link-rows {
    display: flex;
    flex-direction: column;
    gap: var(--keep-baseline);
  }

  .keep-panel-link-row {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-ink) 4%, transparent);
    border-radius: var(--keep-radius-md);
    color: var(--keep-color-ink);
    display: flex;
    font-weight: 500;
    justify-content: center;
    max-inline-size: 32rem;
    min-block-size: calc(var(--keep-baseline) * 7);
    padding: 0 var(--keep-space-4);
    text-align: center;
    text-decoration: none;
  }

  .keep-panel-link-row:hover {
    background: color-mix(in srgb, var(--keep-color-ink) 7%, transparent);
  }

  /* The tall row: twelve units, for the one link a list leads with. */
  .keep-panel-link-row--tall {
    min-block-size: calc(var(--keep-baseline) * 12);
  }

  /* The navigation link carousel: a row of large pills that link between
     pages, one line that scrolls sideways when it outgrows the column. On a
     phone it runs to the screen's edges; each edge fades over 24px only
     while there is more to scroll that way (carousel.js sets the two fades;
     without it the row still scrolls, unfaded). Pills are 40px tall, five
     baselines, a tinted fill with no stroke, 14px text in Medium; the
     current page (aria-current) is filled stronger. */
  @property --keep-carousel-start {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
  }

  @property --keep-carousel-end {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
  }

  .keep-carousel {
    --keep-carousel-start: 0px;
    --keep-carousel-end: 0px;
    -webkit-mask-image: linear-gradient(
      to right, transparent, black var(--keep-carousel-start),
      black calc(100% - var(--keep-carousel-end)), transparent);
    mask-image: linear-gradient(
      to right, transparent, black var(--keep-carousel-start),
      black calc(100% - var(--keep-carousel-end)), transparent);
    margin-inline: calc(-1 * var(--keep-page-gutter));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: var(--keep-page-gutter);
    scrollbar-width: none;
    transition: --keep-carousel-start 160ms ease-out, --keep-carousel-end 160ms ease-out;
  }

  .keep-carousel::-webkit-scrollbar {
    display: none;
  }

  .keep-carousel[data-keep-carousel-start] {
    --keep-carousel-start: 24px;
  }

  .keep-carousel[data-keep-carousel-end] {
    --keep-carousel-end: 24px;
  }

  .keep-carousel__list {
    display: flex;
    gap: 6px;
    inline-size: max-content;
    list-style: none;
    margin: 0;
    padding: 0 var(--keep-page-gutter);
  }

  .keep-carousel__link {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-ink) 6%, transparent);
    border-radius: var(--keep-radius-md);
    color: var(--keep-color-ink);
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 500;
    min-block-size: calc(var(--keep-baseline) * 5);
    padding: 0 var(--keep-space-4);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
  }

  .keep-carousel__link:hover {
    background: color-mix(in srgb, var(--keep-color-ink) 10%, transparent);
  }

  .keep-carousel__link[aria-current] {
    background: color-mix(in srgb, var(--keep-color-ink) 16%, transparent);
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-carousel {
      transition: none;
    }
  }

  /* A pill while its form is on its way: the label has changed to the
     pending word ("Redeeming") and one to three dots cycle after it. The
     dots sit in a fixed box so the pill does not jitter, and the alternative
     text is empty so assistive tech reads only the word. */
  .keep-pill--pending {
    pointer-events: none;
  }

  .keep-pill--pending::after {
    animation: keep-pending-dots 1.2s steps(1, end) infinite;
    content: "." / "";
    display: inline-block;
    inline-size: 1em;
    text-align: start;
  }

  @keyframes keep-pending-dots {
    0% { content: "." / ""; }
    33% { content: ".." / ""; }
    66% { content: "..." / ""; }
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-pill--pending::after {
      animation: none;
      content: "…" / "";
    }
  }

  /* A reveal form takes the place of the choice row: sign-in or the
     invitation code. It is hidden until a choice link targets it by
     fragment, which needs no script: the row disappears and the form appears
     on the same grid line, 32px under the paragraph's last baseline, in the
     same six-unit box, so nothing around it moves. The server opens it the
     same way with keep-reveal--open when it answers a submission. Cancel is
     a link to "#", which clears the target and brings the row back. */
  .keep-reveal {
    align-content: flex-start;
    display: none;
    flex-wrap: wrap;
    gap: var(--keep-space-2);
    margin-top: calc(var(--keep-baseline) * 3);
    min-block-size: calc(var(--keep-baseline) * 6);
  }

  .keep-reveal:target,
  .keep-reveal--open {
    display: flex;
  }

  .keep-choices:has(~ .keep-reveal:target),
  .keep-choices:has(~ .keep-reveal--open) {
    display: none;
  }

  /* A reveal that answers with words rather than a field, as the signed-in
     page's CardDAV details do: one pill, then the note. Capped at the
     reading measure so the note can never share the pill's line. */
  .keep-reveal--reading {
    max-inline-size: 36rem;
  }

  /* Form rows in the reveal idiom, for a form with more than one field: the
     label, the control, and the server's word under it, all at 12px on the
     8px grid. A stack of rows (keep-rows) puts 16px between rows and holds
     the pill row at its end. A row is a grid: label over control by default;
     keep-rows--aligned puts the label beside the control in a 7rem column,
     and falls back to stacked below the small breakpoint. */
  .keep-rows {
    display: flex;
    flex-direction: column;
    gap: calc(var(--keep-baseline) * 2);
    margin-top: calc(var(--keep-baseline) * 3);
    max-inline-size: 36rem;
  }

  .keep-rows > .keep-choices {
    margin-top: 0;
    min-block-size: 0;
  }

  /* Rows inside a reveal take its whole line; the reveal already stands
     three units under the paragraph. */
  .keep-reveal > .keep-rows {
    flex-basis: 100%;
    margin-top: 0;
  }

  .keep-row {
    display: grid;
    grid-template-areas: "label" "control" "note";
    grid-template-columns: minmax(0, 1fr);
  }

  /* The label: 12px Medium in a 16px line box, its baseline on the grid.
     In an aligned row it shares the control's 24px line instead. */
  .keep-row__label {
    color: var(--keep-color-ink);
    font-size: 0.75rem;
    font-weight: 500;
    grid-area: label;
    line-height: calc(var(--keep-baseline) * 2);
    padding: 3.5px 0 4.5px;
  }

  .keep-row__control {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-space-2);
    grid-area: control;
    min-block-size: calc(var(--keep-baseline) * 3);
  }

  /* The note and the error share the reveal's voice: 12px in a 16px line
     box, soft or red, under the control. */
  .keep-row__note,
  .keep-row__error {
    font-size: 0.75rem;
    grid-area: note;
    line-height: calc(var(--keep-baseline) * 2);
    padding: 3.5px 0 4.5px;
  }

  .keep-row__note {
    color: var(--keep-color-text-soft);
  }

  .keep-row__error {
    color: var(--keep-color-danger);
  }

  .keep-rows--aligned .keep-row {
    column-gap: var(--keep-space-3);
    grid-template-areas: "label control" ". note";
    grid-template-columns: 7rem minmax(0, 1fr);
  }

  /* Beside the control, the label is the same 24px box as the field, its
     text centered the way the field's is, so the two read as one line. */
  .keep-rows--aligned .keep-row__label {
    line-height: calc(var(--keep-baseline) * 3);
    padding: 0;
  }

  .keep-rows--aligned .keep-row__note,
  .keep-rows--aligned .keep-row__error {
    margin-top: 0;
  }

  @media (width < 36rem) {
    .keep-rows--aligned .keep-row {
      grid-template-areas: "label" "control" "note";
      grid-template-columns: minmax(0, 1fr);
    }

    .keep-rows--aligned .keep-row__label {
      line-height: calc(var(--keep-baseline) * 2);
      padding: 3.5px 0 4.5px;
    }
  }

  /* A list of things in a reveal, such as the member's devices: each item
     is the name in Medium on one 24px line, its facts soft on the next, and
     the item's link at the end of the first. An Ornament hairline rules
     each item after the first, taking its pixel from the 8px gap so the
     lines stay on the grid. */
  .keep-list {
    display: flex;
    flex-basis: 100%;
    flex-direction: column;
    list-style: none;
    margin: 0;
    max-inline-size: 36rem;
    padding: 0;
  }

  .keep-list__item {
    column-gap: var(--keep-space-3);
    display: grid;
    font-size: 0.75rem;
    grid-template-columns: minmax(0, 1fr) auto;
    line-height: calc(var(--keep-baseline) * 3);
  }

  .keep-list__name {
    font-weight: 500;
  }

  .keep-list__facts {
    color: var(--keep-color-text-soft);
    grid-column: 1;
    overflow-wrap: anywhere;
  }

  /* The mono face has taller metrics than Taurus; as an inline box aligned
     to the line's top it fills the 24px line exactly instead of growing it. */
  .keep-list__facts--mono {
    display: inline-block;
    font-family: var(--keep-font-mono);
    line-height: inherit;
    vertical-align: top;
  }

  .keep-list__action {
    align-self: start;
    grid-column: 2;
    grid-row: 1;
  }

  /* Editing a contact's fields in place (contact-edit.js): an editable
     field hints on hover and focus, and opens a row of boxes and pills
     where it stands; the error reads in the danger ink under them. */
  .keep-contact__editable {
    border-radius: 4px;
    cursor: text;
  }

  .keep-contact__editable:hover,
  .keep-contact__editable:focus-visible {
    background: color-mix(in srgb, currentColor 6%, transparent);
    outline: none;
  }

  .keep-contact__editor {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-space-2);
    margin-block: var(--keep-baseline);
  }

  .keep-contact__input {
    flex: 1 1 8rem;
    font: inherit;
    font-size: 0.75rem;
    min-inline-size: 0;
  }

  textarea.keep-contact__input {
    block-size: calc(var(--keep-baseline) * 9);
    flex-basis: 100%;
    line-height: calc(var(--keep-baseline) * 2);
    resize: vertical;
  }

  .keep-contact__edit-error {
    color: var(--keep-color-danger);
    flex-basis: 100%;
    font-size: 0.75rem;
    margin: 0;
  }

  .keep-contact__edit-error:empty {
    display: none;
  }

  .keep-contact__add {
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-space-2);
    margin-top: calc(var(--keep-baseline) * 3);
  }

  .keep-contact__add[hidden] {
    display: none;
  }

  /* A contact's name that links to their page, in a list's row or inside
     a suggestion's title: the text's own ink, underlined on hover. The
     book's lists hover in its accent instead. */
  a.keep-list__name,
  .keep-list__name a {
    color: inherit;
    text-decoration: none;
  }

  a.keep-list__name:hover,
  .keep-list__name a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* A row's own answers, such as a suggestion's Add, Not them, and Not
     now: a line of pills a baseline under the row's text, so the row
     decides in place without a review. */
  .keep-list__decisions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-space-2);
    grid-column: 1 / -1;
    margin-block: var(--keep-baseline) 0;
  }

  .keep-list__decisions form {
    margin: 0;
  }

  /* A suggested photo beside its row's text: six baselines square, round
     like the book's portraits, in the action column across the name and
     the reason. */
  .keep-list__photo {
    block-size: calc(var(--keep-baseline) * 6);
    border-radius: 50%;
    grid-column: 2;
    grid-row: 1 / span 2;
    inline-size: calc(var(--keep-baseline) * 6);
    object-fit: cover;
  }

  /* Find suggestions heads the Suggestions page and stands apart from the
     list it fills: three baselines under it, as between the rows. */
  .keep-suggestions__find {
    margin-block: 0 calc(var(--keep-baseline) * 3);
    min-block-size: 0;
  }

  /* Rows that carry their own answers stand further apart, so each line
     of pills plainly belongs to the row above it: three baselines on each
     side of the rule instead of one, the rule's pixel taken from below so
     the next row stays on the grid. */
  :is(.keep-list__item:has(.keep-list__decisions) + .keep-list__item,
    .keep-list__item + .keep-list__item:has(.keep-list__decisions)) {
    margin-top: calc(var(--keep-baseline) * 3);
    padding-top: calc(var(--keep-baseline) * 3 - 1px);
  }

  .keep-list__item + .keep-list__item {
    border-top: 1px solid var(--keep-color-ornament-gray);
    margin-top: var(--keep-space-2);
    padding-top: 7px;
  }

  /* A field that fills its row, for a form row rather than the reveal's
     inline field. Same 24px box, stroke, corner, and focus. */
  .keep-reveal__field--wide {
    inline-size: 100%;
    max-inline-size: 20rem;
  }

  /* A select in the field's shape: the native control with its chrome
     removed, the value at 12px, and an ink chevron drawn at the end. */
  .keep-select {
    appearance: none;
    background: var(--keep-color-white)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2307090B' stroke-width='1.25'/%3E%3C/svg%3E")
      no-repeat right var(--keep-space-2) center;
    block-size: calc(var(--keep-baseline) * 3);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 4px;
    color: var(--keep-color-ink);
    font-family: inherit;
    font-size: 0.75rem;
    inline-size: 100%;
    max-inline-size: 20rem;
    padding: 0 calc(var(--keep-space-2) * 3) 0 var(--keep-space-2);
  }

  .keep-select:hover {
    border-color: color-mix(in srgb, var(--keep-color-ink) 16%, var(--keep-color-white));
  }

  .keep-select:focus {
    border-color: var(--keep-color-ink);
    outline: none;
  }

  .keep-select[aria-invalid="true"] {
    border-color: var(--keep-color-danger);
  }

  /* A value to copy out of a note, such as a device's username or its
     one-time password: the mono face at the note's size, breakable so a
     long token never widens the page. */
  .keep-reveal__code {
    font-family: var(--keep-font-mono);
    overflow-wrap: anywhere;
    user-select: all;
  }

  /* The field is a 24px box in the pill's shape. An email field is set in
     the text face at a reading width; a code field is set in the mono face,
     tracked, and short. */
  .keep-reveal__field {
    appearance: none;
    background: var(--keep-color-white);
    block-size: calc(var(--keep-baseline) * 3);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 4px;
    color: var(--keep-color-ink);
    font-size: 0.75rem;
    inline-size: 14rem;
    padding: 0 var(--keep-space-2);
  }

  .keep-reveal__field--code {
    font-family: var(--keep-font-mono);
    inline-size: 6rem;
    letter-spacing: 0.04em;
  }

  .keep-reveal__field::placeholder {
    color: var(--keep-color-text-soft);
    font-family: var(--keep-font-sans);
    letter-spacing: normal;
  }

  .keep-reveal__field:hover {
    border-color: color-mix(in srgb, var(--keep-color-ink) 16%, var(--keep-color-white));
  }

  /* Focus shows as the stroke turning ink, in place of the browser ring:
     the field keeps a visible focus state without a second outline. */
  .keep-reveal__field:focus {
    border-color: var(--keep-color-ink);
    outline: none;
  }

  .keep-reveal__field[aria-invalid="true"] {
    border-color: var(--keep-color-danger);
  }

  /* The server's word under the controls: a red error line, or a note in
     the soft text color. Both are 12px in a 24px line box and take the
     whole flex line, so they wrap under the controls; the negative top
     margin cancels the row gap, the 7.5px top padding puts the baseline on
     the grid, 24px under the row's bottom edge, and the negative bottom
     margin gives back the 8px the line box runs past the six-unit box, so
     the form stays 48px tall with or without the line. A note that stands
     alone, as after a link is sent, starts on the first line instead and
     may run to two. */
  .keep-reveal__error,
  .keep-reveal__note {
    flex-basis: 100%;
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin-block: calc(-1 * var(--keep-space-2));
    padding: 7.5px 0 0.5px;
  }

  .keep-reveal__error {
    color: var(--keep-color-danger);
  }

  /* The note is set tighter, two units per line instead of three: the
     3.5px top padding lands its baselines on the grid at 16px steps and the
     4.5px bottom padding keeps the box in whole units. */
  .keep-reveal__note {
    color: var(--keep-color-text-soft);
    line-height: calc(var(--keep-baseline) * 2);
    max-width: 36rem;
    padding: 3.5px 0 4.5px;
  }

  .keep-reveal__note:first-child {
    margin-block-start: 0;
  }

  /* Keycaps at the end of a pill, naming its keyboard shortcut: 17px
     squares with a hairline stroke, the symbol at 75% of the pill's text
     color, centered inside the 24px pill. The symbols are set in the system mono face. The caps follow the label after 7px, and a pill
     that carries them pulls its trailing padding in to 4px. */
  .keep-pill__keys {
    display: inline-flex;
    gap: 2px;
    margin-inline-start: 7px;
  }

  .keep-pill:has(.keep-pill__keys) {
    padding-inline-end: 4px;
  }

  .keep-pill__key {
    align-items: center;
    /* The symbol is 75% of the pill's text color. The stroke is 40% of the
       pill's text color, which is 53.3% of the symbol's. */
    border: 0.5px solid color-mix(in srgb, currentColor 53.3%, transparent);
    border-radius: 3px;
    block-size: 17px;
    color: color-mix(in srgb, currentColor 75%, transparent);
    display: inline-flex;
    font-family: var(--keep-font-mono);
    font-size: 0.875rem;
    justify-content: center;
    line-height: 1;
    min-inline-size: 17px;
    padding: 0 2px;
  }

  /* SF Mono draws the command symbol about 1px above the center of its
     line box, where the return arrow is centered; the pad evens them out. */
  .keep-pill__key[data-keep-key="meta"] {
    padding-block-start: 1px;
  }

  .keep-notice {
    align-items: center;
    background: var(--keep-color-surface);
    border: 1px solid var(--keep-color-border);
    border-radius: var(--keep-radius-lg);
    box-shadow: var(--keep-shadow-contact), var(--keep-shadow-soft);
    display: grid;
    gap: var(--keep-space-5);
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    isolation: isolate;
    min-height: 7rem;
    overflow: hidden;
    padding: var(--keep-space-4);
    position: relative;
  }

  .keep-notice::before {
    border: 1px solid color-mix(in srgb, var(--keep-color-ink) 5.5%, transparent);
    border-radius: calc(var(--keep-radius-lg) + 0.25rem);
    content: "";
    inset: -0.25rem;
    pointer-events: none;
    position: absolute;
  }

  .keep-notice__mark {
    align-self: stretch;
    background:
      radial-gradient(circle at 25% 15%, rgb(255 255 255 / 5%), transparent 36%),
      var(--keep-color-ink);
    border-radius: calc(var(--keep-radius-lg) - var(--keep-space-2));
    min-height: 4.75rem;
    position: relative;
  }

  .keep-notice__mark::after {
    background: var(--keep-color-gold);
    content: "";
    height: 1px;
    left: 25%;
    position: absolute;
    right: 25%;
    top: 50%;
  }

  .keep-notice__body {
    min-width: 0;
  }

  .keep-notice__title {
    font-size: var(--keep-font-size-title);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.15;
  }

  .keep-notice__copy {
    color: var(--keep-color-text-soft);
    margin-block-start: var(--keep-space-2);
    max-width: 52rem;
  }

  .keep-badge {
    background: var(--keep-color-surface-warm);
    border: 1px solid var(--keep-color-border);
    border-radius: 999px;
    display: inline-flex;
    font-size: var(--keep-font-size-sm);
    font-weight: 600;
    line-height: 1;
    padding: 0.4rem 0.625rem;
  }

  /* A small Electric badge for a link that is new. It sits in the text
     flow after the link, so it follows the last word even when the label
     wraps. */
  .keep-badge--new {
    background: var(--keep-color-accent);
    border-color: var(--keep-color-accent);
    color: var(--keep-color-on-accent);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    /* Placed inside a keep-nowrap span with the link's last word, so it can
       never wrap away from it. The margin provides the gap. */
    margin-inline-start: 0.45rem;
    padding: 0.2rem 0.45rem;
    vertical-align: 0.1em;
  }

  .keep-field {
    display: grid;
    gap: var(--keep-space-2);
  }

  .keep-field__label {
    font-size: var(--keep-font-size-sm);
    font-weight: 600;
  }

  .keep-field__control {
    background: var(--keep-color-white);
    border: 1px solid var(--keep-color-vein);
    border-radius: var(--keep-radius-sm);
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    width: 100%;
  }

  .keep-field__control[aria-invalid="true"] {
    border-color: var(--keep-color-danger);
  }

  .keep-field__hint,
  .keep-field__error {
    font-size: var(--keep-font-size-sm);
  }

  .keep-field__hint {
    color: var(--keep-color-text-soft);
  }

  .keep-field__error {
    color: var(--keep-color-danger);
    font-weight: 600;
  }

  .keep-dialog {
    background: var(--keep-color-surface);
    border: 1px solid var(--keep-color-border);
    border-radius: var(--keep-radius-lg);
    box-shadow: var(--keep-shadow-contact), var(--keep-shadow-soft);
    color: var(--keep-color-text);
    max-width: min(32rem, calc(100vw - 2rem));
    padding: var(--keep-space-6);
  }

  .keep-dialog::backdrop {
    background: rgb(7 9 11 / 48%);
  }

  @media (max-width: 42rem) {
    .keep-notice {
      align-items: start;
      grid-template-columns: 3.5rem minmax(0, 1fr);
    }

    .keep-notice > .keep-button {
      grid-column: 2;
      justify-self: start;
    }
  }

  /* Narrower than --keep-breakpoint-s. */
  @media (max-width: 36rem) {
    .keep-footer__inner {
      grid-template-columns: 1fr;
    }

    .keep-footer__colophon {
      grid-template-columns: 1fr;
    }

    .keep-footer__social {
      justify-self: start;
    }
  }
}

@layer keep.utilities {
  /* Binds a word to a decoration after it (a badge, an arrow) so a line
     never breaks between them. Wrap only the last word, so the label can
     still wrap between its own words. */
  .keep-nowrap {
    white-space: nowrap;
  }

  .keep-visually-hidden {
    block-size: 1px;
    clip-path: inset(50%);
    inline-size: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------------
   The app shell: the frame of every signed-in page. Four regions: a rail
   of sections on the left, the page in the center, an aside of facts on
   the right, and a line of fine print across the bottom. There is no bar
   across the top for now (October 24, 2026): the columns start at the top
   of the viewport, and the rail's tool row is the first thing on the
   page. The fine print is on every page; the three columns hold whatever
   the page is about.

   The three columns share one vertical structure. Each starts three units
   (24px) under the top, opens with a title line whose baseline is 24px
   under that, and stacks blocks that are whole units tall, so a line in
   the rail, a line in the page, and a line in the aside sit on the same
   grid line. The page's title is 16px Bold; the rail's and the aside's are
   12px Medium in the soft color. Both are set in a 24px line box whose top
   padding lands the baseline 24px under the box's top.

   Three layouts, by viewport width, at the named steps:
   - below 42rem: one column. The rail is a row of sections at the top,
     scrolling sideways when it must; the aside follows the page.
   - from 42rem: the rail stands on the left; the aside still follows the
     page, under a hairline.
   - from 64rem: all three side by side.
   The layout answers the viewport; what is inside a column answers the
   column, since each column is an inline-size container. */

@layer keep.tokens {
  :root {
    --keep-app-rail: 12rem;
    --keep-app-aside: 16rem;
    --keep-app-gutter: var(--keep-space-4);
    /* The fine print's height, which a column standing beside the page
       leaves clear at the bottom of the viewport. */
    --keep-app-foot: calc(var(--keep-baseline) * 4);
    /* Presence: how long the keyboard and mouse rest before the chrome
       (the rail, the aside, the fine print) fades, what it fades to,
       and how long the fade takes; it comes back in a sixth of that.
       presence.js reads the delay from here. */
    --keep-presence-delay: 10s;
    --keep-presence-opacity: 0.25;
    --keep-presence-fade: 1200ms;
  }

  @media (width >= 42rem) {
    :root {
      --keep-app-gutter: var(--keep-space-5);
    }
  }
}

@layer keep.layout {
  /* An app page draws no scrollbar of its own either: the page scrolls
     by wheel, trackpad, and keyboard, like the aside. */
  html:has(> body.keep-app) {
    scrollbar-width: none;
  }

  html:has(> body.keep-app)::-webkit-scrollbar {
    display: none;
  }

  /* On body: the columns and the fine print, with the columns taking
     whatever height the viewport leaves so the fine print is never above
     the bottom of a short page. */
  .keep-app {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 100vh;
  }

  /* The body spans the window, so the rail and the aside sit against its
     edges at any width; the page's own content keeps its reading measure.
     The body fills the height the fine print leaves, and its last row
     takes whatever is left, so on a short page the rail and the page keep
     their content height and the column hairlines still run to the fine
     print. */
  .keep-app__body {
    display: grid;
    grid-template-areas: "rail" "main" "aside";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    inline-size: 100%;
  }

  .keep-app__rail {
    grid-area: rail;
  }

  /* Presence: the chrome fades to the resting opacity when html carries
     data-keep-away (presence.js, after the delay with no key or mouse)
     and comes back quickly on the first movement. */
  .keep-app__rail,
  .keep-app__aside,
  .keep-app__foot {
    transition: opacity calc(var(--keep-presence-fade) / 6) ease;
  }

  [data-keep-away] .keep-app__rail,
  [data-keep-away] .keep-app__aside,
  [data-keep-away] .keep-app__foot {
    opacity: var(--keep-presence-opacity);
    transition: opacity var(--keep-presence-fade) ease;
  }

  .keep-app__main {
    grid-area: main;
  }

  .keep-app__aside {
    grid-area: aside;
  }

  /* The columns' shared structure: three units above, six below, the
     gutter at each side, and each one a container for what it holds. */
  .keep-app__rail,
  .keep-app__main,
  .keep-app__aside {
    container-type: inline-size;
    min-inline-size: 0;
    padding: calc(var(--keep-baseline) * 3) var(--keep-app-gutter) calc(var(--keep-baseline) * 6);
  }

  /* One column: the rail is a 48px row at the top, its hairline taking
     the pixel from the bottom padding, and the aside follows the page under
     a hairline that takes its pixel from the aside's top padding. */
  .keep-app__rail {
    border-bottom: 1px solid var(--keep-color-ornament-gray);
    padding-block: 0 0;
  }

  .keep-app__aside {
    border-top: 1px solid var(--keep-color-ornament-gray);
    padding-top: calc(var(--keep-baseline) * 3 - 1px);
  }

  /* Two columns: the rail stands on the left of both the page and the
     aside, ruled on its right. Standing, it is its own scroll like the
     aside: stuck to the top of the viewport, as tall as the viewport less
     the fine print, scrolling inside itself with no scrollbar drawn, so
     the index stays put while the page scrolls. */
  @media (width >= 42rem) {
    .keep-app__body {
      grid-template-areas: "rail main" "rail aside";
      grid-template-columns: var(--keep-app-rail) minmax(0, 1fr);
      grid-template-rows: auto 1fr;
    }

    .keep-app__rail {
      align-self: start;
      block-size: calc(100vh - var(--keep-app-foot));
      border-bottom: 0;
      border-inline-end: 1px solid var(--keep-color-ornament-gray);
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-block: calc(var(--keep-baseline) * 3) calc(var(--keep-baseline) * 6);
      position: sticky;
      scrollbar-width: none;
      top: 0;
    }

    .keep-app__rail::-webkit-scrollbar {
      display: none;
    }
  }

  /* Three columns: the aside stands on the right of the page, ruled on
     its left, and starts on the same line as the other two. Beside the
     page it keeps two units inside its hairline, not the full gutter, and
     it is its own scroll: stuck to the top of the viewport, as tall as the
     viewport less the fine print, scrolling inside itself while the page
     scrolls with the document, with no scrollbar drawn. */
  @media (width >= 64rem) {
    .keep-app__body {
      grid-template-areas: "rail main aside";
      grid-template-columns: var(--keep-app-rail) minmax(0, 1fr) var(--keep-app-aside);
      grid-template-rows: 1fr;
    }

    .keep-app__aside {
      align-self: start;
      block-size: calc(100vh - var(--keep-app-foot));
      border-inline-start: 1px solid var(--keep-color-ornament-gray);
      border-top: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-inline-start: var(--keep-space-4);
      padding-top: calc(var(--keep-baseline) * 3);
      position: sticky;
      scrollbar-width: none;
      top: 0;
    }

    .keep-app__aside::-webkit-scrollbar {
      display: none;
    }
  }
}

@layer keep.components {
  /* A link to the page for keyboards, visible only while focused: the
     first thing in the body, so Tab lands on it before the rail's tools. */
  .keep-app__skip {
    background: var(--keep-color-ink);
    border-radius: 4px;
    color: var(--keep-color-white);
    font-size: 0.75rem;
    left: var(--keep-app-gutter);
    line-height: calc(var(--keep-baseline) * 3);
    padding: 0 var(--keep-space-2);
    position: absolute;
    text-decoration: none;
    top: calc(var(--keep-baseline) / 2);
    transform: translateY(-200%);
  }

  .keep-app__skip:focus {
    transform: none;
    z-index: 1;
  }

  /* The fine print: a 32px band under a hairline, one 16px line with a
     unit less half the hairline above and below. Its first cell is the
     rail's width, ruled on its right like the rail, and holds the signed-in
     account: the avatar and the handle, a link to the account page. The
     rest is 12px in the soft color, the lockup's name at the start and
     the links at the end. It sticks to the bottom of the viewport while a
     long page scrolls beneath its translucent background, and sits at the
     page's end when the page is short. */
  .keep-app__foot {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--keep-color-white) 94%, transparent);
    border-top: 1px solid var(--keep-color-ornament-gray);
    bottom: 0;
    color: var(--keep-color-text-soft);
    display: grid;
    font-size: 0.75rem;
    grid-template-columns: var(--keep-app-rail) minmax(0, 1fr);
    line-height: calc(var(--keep-baseline) * 2);
    position: sticky;
    z-index: 1;
  }

  /* The account cell: a line-height avatar, two units across, centered
     in the band, the handle beside it in Medium, cut with an ellipsis. */
  .keep-app__account {
    align-items: center;
    border-inline-end: 1px solid var(--keep-color-ornament-gray);
    color: var(--keep-color-ink);
    display: flex;
    gap: var(--keep-space-2);
    min-inline-size: 0;
    padding: 7.5px var(--keep-app-gutter) 7.5px;
    text-decoration: none;
  }

  .keep-app__account .keep-avatar {
    flex-shrink: 0;
  }

  /* An avatar the height of a 16px line: two units across, the initial
     at 10px. The compound selector outranks the avatar's own size, which
     is declared later. */
  .keep-avatar.keep-avatar--line {
    block-size: calc(var(--keep-baseline) * 2);
    font-size: 0.625rem;
    inline-size: calc(var(--keep-baseline) * 2);
  }

  .keep-app__account-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-app__account:hover .keep-app__account-name {
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
  }

  .keep-app__foot-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--keep-space-4);
    justify-content: space-between;
    padding: 7.5px var(--keep-app-gutter) 7.5px;
  }

  /* The appearance at the fine print's end: three icon buttons on the
     band's 16px line (match the system, light, dark: Tabler's
     device-desktop, sun, and moon), each 24px wide with a 12px glyph in
     the soft ink; the member's on a small raised tile, the ink over the
     ground at 10% with a hairline, as the current segment is, its glyph
     in the body ink. Every signed-in page has it, so the mode can change
     wherever the member is; it posts and comes back to the page. */
  .keep-appearance {
    display: flex;
    gap: 2px;
    margin: 0;
  }

  .keep-appearance__choice {
    align-items: center;
    appearance: none;
    background: none;
    block-size: calc(var(--keep-baseline) * 2);
    border: 0;
    border-radius: 5px;
    color: var(--keep-color-text-soft);
    cursor: pointer;
    display: inline-flex;
    inline-size: calc(var(--keep-baseline) * 3);
    justify-content: center;
    padding: 0;
    transition: background-color 120ms ease, color 120ms ease;
  }

  .keep-appearance__choice:hover {
    color: var(--keep-color-ink);
  }

  .keep-appearance__choice[aria-pressed="true"] {
    background: color-mix(in srgb, var(--keep-color-ink) 10%, var(--keep-color-white));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--keep-color-ink) 12%, transparent);
    color: var(--keep-color-ink);
    cursor: default;
  }

  .keep-appearance__choice:focus-visible {
    outline: 2px solid var(--keep-color-focus);
    outline-offset: 1px;
  }

  .keep-appearance__icon {
    block-size: 12px;
    inline-size: 12px;
  }

  /* With the rail collapsed, the cell is the rail's strip and shows the
     avatar alone. Below 42rem the rail is a row, so the cell is only as
     wide as it needs and the fine print's line gives way to the links. */
  @media (width >= 42rem) {
    html.keep-rail-collapsed .keep-app__account {
      padding-inline: calc(var(--keep-baseline) / 2);
    }

    html.keep-rail-collapsed .keep-app__account-name {
      display: none;
    }
  }

  @media (width < 42rem) {
    .keep-app__foot {
      grid-template-columns: auto minmax(0, 1fr);
    }

    .keep-app__foot-line {
      display: none;
    }
  }

  /* The tool row at the top of the rail, the first thing on the page: 24px
     icon buttons in a 32px box (the button and a unit under it), so the
     title line follows on the grid. The first tool shows and hides the index; it is a button that
     only the rail enhancement reveals, since without a script the index
     simply stays. In the one-column layout the rail is a row and the
     tools are not shown. */
  .keep-tools {
    display: flex;
    gap: var(--keep-space-2);
    margin-bottom: var(--keep-space-2);
    /* Six pixels into the gutter: the icon's drawn edge sits a little
       inside its 24px box, and this lands it on the entries' edge. */
    margin-inline-start: -6px;
    min-block-size: calc(var(--keep-baseline) * 3);
  }

  /* A tool: a 24px square with no stroke, just a 16px icon drawn in ink.
     The pill's corner is kept for the focus ring and the hover, which
     shows as the Ornament wash behind the icon. */
  .keep-tool {
    align-items: center;
    appearance: none;
    background: transparent;
    block-size: calc(var(--keep-baseline) * 3);
    border: 0;
    border-radius: 4px;
    color: var(--keep-color-ink);
    cursor: pointer;
    display: inline-flex;
    inline-size: calc(var(--keep-baseline) * 3);
    justify-content: center;
    padding: 0;
  }

  .keep-tool:hover {
    background: var(--keep-color-ornament-gray);
  }

  .keep-tool__icon {
    block-size: 1rem;
    inline-size: 1rem;
  }

  @media (width < 42rem) {
    .keep-tools {
      display: none;
    }
  }

  /* The collapsed rail: the enhancement puts keep-rail-collapsed on html
     before first paint when the browser remembers the choice. The rail
     narrows to one tool with half a unit of padding at each side, and the
     index is hidden. The width token is overridden at the root, where it is
     declared, and this layer wins over the tokens layer. */
  @media (width >= 42rem) {
    html.keep-rail-collapsed {
      /* Half a unit, one tool, half a unit, and the hairline on the right. */
      --keep-app-rail: calc(var(--keep-baseline) * 4 + 1px);
    }

    html.keep-rail-collapsed .keep-app__rail {
      padding-inline: calc(var(--keep-baseline) / 2);
    }

    html.keep-rail-collapsed .keep-app__rail-index {
      display: none;
    }
  }

  /* The collapsed rail gives up 10rem (12rem less its 2rem strip), so
     from 10rem under the large step the page is as wide as the
     three-column layout makes it, and the aside comes up beside the page.
     Narrower than that, it stays beneath. */
  @media (width >= 54rem) {
    html.keep-rail-collapsed .keep-app__body {
      grid-template-areas: "rail main aside";
      grid-template-columns: var(--keep-app-rail) minmax(0, 1fr) var(--keep-app-aside);
      grid-template-rows: 1fr;
    }

    html.keep-rail-collapsed .keep-app__aside {
      align-self: start;
      block-size: calc(100vh - var(--keep-app-foot));
      border-inline-start: 1px solid var(--keep-color-ornament-gray);
      border-top: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-inline-start: var(--keep-space-4);
      padding-top: calc(var(--keep-baseline) * 3);
      position: sticky;
      scrollbar-width: none;
      top: 0;
    }

    .keep-app__aside::-webkit-scrollbar {
      display: none;
    }
  }

  /* The title line of the rail and the aside: 12px Medium, soft, in a
     24px line box with its baseline 24px under the top of the box, so it
     shares a grid line with the page's title. */
  .keep-column__title {
    color: var(--keep-color-text-soft);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
    padding: 7.5px 0 0.5px;
  }

  /* The index: the sections, one to a 24px line, 12px, flush with the
     rail's gutter, the current one in Medium and nothing more. Counts,
     such as the suggestions waiting, follow the name in the soft color. */
  .keep-index {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .keep-index__link {
    color: var(--keep-color-ink);
    display: block;
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 3);
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-index__link:hover {
    color: var(--keep-color-graphite);
  }

  .keep-index__link[aria-current="page"] {
    font-weight: 500;
  }

  .keep-index__count {
    color: var(--keep-color-text-soft);
    font-weight: 400;
  }

  /* An entry whose page is not here yet: the same line in the soft color,
     not a link, unchanged on hover. */
  .keep-index__link--unlinked,
  .keep-index__link--unlinked:hover {
    color: var(--keep-color-text-soft);
    cursor: default;
  }

  /* The rail holds groups of entries, one list each, stacked with two
     units between a group and the next. A column's second title line,
     such as the index's in the rail or Activity in the contacts aside,
     stands two units under whatever came before it. */
  .keep-index + .keep-index,
  .keep-column__title:not(:first-child),
  .keep-column__head:not(:first-child) {
    margin-top: calc(var(--keep-baseline) * 2);
  }

  /* A title line with a tool at its end, such as Activity with its
     source menu: the two share the title's baseline. */
  .keep-column__head {
    align-items: baseline;
    display: flex;
    gap: var(--keep-space-2);
    justify-content: space-between;
  }

  /* A menu: a native disclosure. The button is 12px Medium in the soft
     color on the title's 24px line, with a chevron; open, it turns ink
     and the list hangs under its end: white, an Ornament stroke, the
     soft shadow, 12px links on 24px lines. The current choice is Medium.
     The menu.js enhancement closes it on a click outside or Escape. */
  .keep-menu {
    position: relative;
  }

  .keep-menu__button {
    align-items: center;
    color: var(--keep-color-text-soft);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 0.25rem;
    line-height: calc(var(--keep-baseline) * 3);
    list-style: none;
    padding: 7.5px 0 0.5px;
    white-space: nowrap;
  }

  .keep-menu__button::-webkit-details-marker {
    display: none;
  }

  .keep-menu__button:hover,
  .keep-menu[open] .keep-menu__button {
    color: var(--keep-color-ink);
  }

  .keep-menu__chevron {
    block-size: 0.75rem;
    inline-size: 0.75rem;
  }

  .keep-menu[open] .keep-menu__chevron {
    transform: rotate(180deg);
  }

  .keep-menu__list {
    background: var(--keep-color-white);
    border: 1px solid var(--keep-color-ornament-gray);
    border-radius: 4px;
    box-shadow: var(--keep-shadow-soft);
    inset-inline-end: 0;
    list-style: none;
    margin: 0;
    min-inline-size: 10rem;
    padding: var(--keep-space-2) 0;
    position: absolute;
    top: 100%;
    z-index: 2;
  }

  .keep-menu__item {
    color: var(--keep-color-ink);
    display: block;
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 3);
    padding: 0 var(--keep-space-3);
    text-decoration: none;
    white-space: nowrap;
  }

  .keep-menu__item:hover {
    background: var(--keep-color-ornament-gray);
  }

  .keep-menu__item[aria-current="true"] {
    font-weight: 500;
  }

  /* In the one-column layout the rail is a row: every group's entries
     join one line (the lists become display: contents, with two units
     between one group and the next), the links keep their 24px line in a
     48px band, and the row runs past the gutter to the viewport's edge so
     a long row scrolls sideways with its ends cut, not squeezed. */
  @media (width < 42rem) {
    .keep-app__rail .keep-column__title {
      display: none;
    }

    .keep-app__rail-index {
      display: flex;
      gap: var(--keep-space-2);
      margin-inline: calc(-1 * var(--keep-app-gutter));
      overflow-x: auto;
      padding-inline: var(--keep-app-gutter);
      scrollbar-width: none;
    }

    .keep-app__rail-index::-webkit-scrollbar {
      display: none;
    }

    .keep-index {
      display: contents;
    }

    .keep-index + .keep-index > li:first-child {
      margin-inline-start: var(--keep-space-4);
    }

    .keep-index__link {
      padding: 12px 0 11px;
    }
  }

  /* The page's head: the title in Bold and a lede in Regular, both 16px
     in 24px lines, each box 32px tall so the next block starts on the
     grid. */
  .keep-page__title {
    font-size: var(--keep-font-size-body);
    font-weight: 700;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
    max-width: 36rem;
    padding: 5.5px 0 2.5px;
  }

  .keep-page__lede {
    font-size: var(--keep-font-size-body);
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
    max-width: 36rem;
    padding: 5.5px 0 2.5px;
  }

  /* A section of the page: its title line in 12px Medium ink, 24px under
     whatever came before, then its list, rows, or choices. A section after
     another is ruled, the hairline taking its pixel from the gap. */
  .keep-section {
    padding-top: calc(var(--keep-baseline) * 3);
  }

  .keep-section + .keep-section {
    border-top: 1px solid var(--keep-color-ornament-gray);
    margin-top: calc(var(--keep-baseline) * 3);
    padding-top: calc(var(--keep-baseline) * 3 - 1px);
  }

  .keep-section__title {
    color: var(--keep-color-ink);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
    padding: 7.5px 0 0.5px;
  }

  /* Inside a section, a choice row and a reveal stand one unit under the
     title, not the three the intro gave them, and a row is only as tall
     as its pills. */
  .keep-section > .keep-choices,
  .keep-section > .keep-reveal,
  .keep-section > .keep-rows {
    margin-top: var(--keep-space-2);
    min-block-size: 0;
  }

  .keep-section > .keep-list {
    margin-top: var(--keep-space-2);
  }

  /* Facts, for the aside: a term and its value on one 24px line, 12px,
     the term in the soft color in a column just wide enough for the
     longest term, the value in ink. */
  .keep-facts {
    column-gap: var(--keep-space-3);
    display: grid;
    font-size: 0.75rem;
    grid-template-columns: minmax(4rem, max-content) minmax(0, 1fr);
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
  }

  .keep-facts__term {
    color: var(--keep-color-text-soft);
  }

  .keep-facts__value {
    margin: 0;
    overflow-wrap: anywhere;
  }

  .keep-facts__value--mono {
    font-family: var(--keep-font-mono);
  }

  /* An activity row in a list: a 32px avatar at the start, centered on
     the row's two lines, the name with when at the line's end, and what
     happened on the next line, set in a 16px line box so it sits one unit
     closer than a list's usual second line and the row is five units
     tall. Both lines are cut with an ellipsis rather than wrapped, so a
     row is always two lines and the avatar is always centered on them.
     The full text is in the title. */
  .keep-list__item--avatar {
    column-gap: var(--keep-space-2);
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  /* Both lines are 12px in a 16px line box, which puts the baseline 12.5px
     under the box's top. The first line's 3.5px top padding lands its
     baseline on the 16px line (and the 4.5px below rounds the box to 24).
     The second line starts 4.5px into that bottom padding, so its baseline
     is exactly two units under the first, on the 32px line. */
  .keep-list__item--avatar .keep-list__name,
  .keep-list__item--avatar .keep-list__when {
    line-height: calc(var(--keep-baseline) * 2);
    padding: 3.5px 0 4.5px;
  }

  .keep-list__item--avatar .keep-list__name {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-list__item--avatar .keep-list__facts {
    grid-column: 2 / -1;
    grid-row: 2;
    line-height: calc(var(--keep-baseline) * 2);
    /* The box is pulled up into the first line's bottom padding and padded
       back down by the same, so its track stays two units. */
    margin-top: -4.5px;
    overflow: hidden;
    overflow-wrap: normal;
    padding-bottom: 4.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-list__when {
    color: var(--keep-color-text-soft);
    grid-column: 3;
    grid-row: 1;
    white-space: nowrap;
  }

  /* A row the live enhancement has just put in: a short fade and a
     four-pixel settle, nothing more; none with reduced motion. */
  .keep-list__item--entering {
    animation: keep-row-enter 240ms ease-out;
  }

  @keyframes keep-row-enter {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-list__item--entering {
      animation: none;
    }
  }

  /* The avatar: an Ornament gray circle four units across, centered on
     the row's two lines, with the initials in the soft color until the
     card's photo is served. */
  .keep-avatar {
    align-items: center;
    align-self: center;
    background: var(--keep-color-ornament-gray);
    block-size: calc(var(--keep-baseline) * 4);
    border-radius: 50%;
    color: var(--keep-color-text-soft);
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 500;
    grid-column: 1;
    grid-row: 1 / span 2;
    inline-size: calc(var(--keep-baseline) * 4);
    justify-content: center;
    letter-spacing: 0.02em;
    overflow: hidden;
  }

  /* The card's photo, when it has one: fills the circle, cropped to it. */
  .keep-avatar__image {
    block-size: 100%;
    display: block;
    inline-size: 100%;
    object-fit: cover;
  }

  /* A note that stands on its own in a column: 12px in the soft color, two
     units to the line, padded so its baselines are on the grid and its box
     is whole units. The same voice as the note under a reveal, without
     the reveal's negative margins. */
  .keep-note {
    color: var(--keep-color-text-soft);
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 2);
    margin: 0;
    max-width: 36rem;
    padding: 3.5px 0 4.5px;
  }

  .keep-note + .keep-note,
  .keep-facts + .keep-note,
  .keep-note + .keep-facts {
    margin-top: var(--keep-space-2);
  }

  .keep-note code {
    font-family: var(--keep-font-mono);
    overflow-wrap: anywhere;
    user-select: all;
  }
}

/* ---------------------------------------------------------------------
   The book: the contacts page's frame inside the app shell, decided
   October 26, 2026 (`decisions.md` → Contacts as a book). The page
   column is an open book: two pages in a thin cover, meeting at the
   spine, with two tabs printed on the right page, centered in the room
   the rail, the aside, and the fine print leave. The summary is on the
   verso of the first spread and the list opens on the recto; every
   turn after shows two new pages. Around the book, on the desk: the
   wordmark at the top, the search under it, the settings tool and the
   keys caption at the book's foot, and the settings panel the book
   rises to reveal.

   The book has a fixed size up to its reference, 26rem pages, and
   shrinks as a whole when the window cannot hold the rail, the book,
   and the aside at its narrowest, or is too short for it, so the row
   never scrolls. Everything on the pages is laid out for the reference
   book and zoomed by the pages' real width over it, so at full size it
   is the library's markup at the library's sizes, and at any other
   width type, lines, spacing, and hairlines scale together. The cover,
   the tabs, and the desk do not scale; where a placed piece on the
   pages reckons from the cover it divides the cover by the zoom.

   The page is `body.keep-app--book`; `book.js` lays the pages, turns
   them, marks the letters, opens the settings, and narrows the list as
   the search is typed. Without it the stylesheet's columns lay the
   first spread, the search submits, and the settings panel's forms
   post. */

@layer keep.tokens {
  :root {
    /* The book's theme (BookstoreTheme.swift; web-ui.md → Book themes):
       four inks and three papers, the only colors on a book page. A
       member's theme is written over these in the page's head, so these
       are the standard theme's values and the fallback.
       The inks: the body in high and low contrast, and the accent, the
       red of the first tab, in high and low. The papers: the page, the
       cover, and the edge of the block of pages beneath. */
    --keep-book-ink: #07090b;
    --keep-book-ink-soft: #6b6b6b;
    --keep-book-accent: #ff4a14;
    /* The soft accent is made, not picked: the accent over the page. A
       theme may still set its own. */
    --keep-book-accent-soft: color-mix(in srgb, var(--keep-book-accent) 40%, var(--keep-book-page));
    --keep-book-page: #f0eee9;
    --keep-book-cover-color: #e8e8e8;
    --keep-book-edge: #e4e2dc;
    --keep-book-desk: #ffffff;
    /* The cover around the pages: at the sides, and at the top and
       bottom. The spine between the pages. */
    --keep-book-cover: 0.75rem;
    --keep-book-cover-y: 0.1875rem;
    --keep-book-spine: 0px;
    --keep-book-tab: 2rem;
    /* The aside beside the book: its floor, and its cap, past which the
       room goes to the page column, between the book and the stream. */
    --keep-book-aside-min: 14rem;
    --keep-book-aside-max: 16rem;
    /* The rail's second group, the parts of Keep, has this many
       entries; it stands at the row's center, like the book. */
    /* The rail's centered block: the times' group and the parts' group,
       two units apart, placed together at the row's center. */
    --keep-book-rail-time-entries: 5;
    --keep-book-rail-parts-entries: 4;
    --keep-book-rail-connected-entries: 2;
    --keep-book-rail-block: calc((var(--keep-book-rail-time-entries) + var(--keep-book-rail-parts-entries)) * var(--keep-baseline) * 3 + var(--keep-baseline) * 2);
    --keep-book-rail-block-top: round(
      nearest,
      calc((100vh - var(--keep-app-foot) - var(--keep-book-rail-block)) / 2),
      var(--keep-baseline)
    );
    /* The book, cover to cover, in the open iPhone Duo's proportion:
       its inner display is 1878 by 2670, so 1.4217 to 1 wide in
       landscape. */
    --keep-book-ratio: 1.4217;
    /* The reference: a page is this wide at full size. The scale is the
       pages' real width over two of these (the cover does not scale), so
       in the zoomed space the two pages are always two reference pages
       wide. tan(atan2()) divides one length by another into a number. */
    --keep-book-ref-page: 26rem;
    /* The height rule leaves twenty units of the row to the desk: ten
       above the book for the wordmark and the search, ten below for the
       caption and the tool, since the book is centered in the row. */
    /* book.js sets this on html as a plain number as well, from the
       book's measured width: Safari does not resolve the expression.
       The pieces on the pages are scaled by it with a transform. */
    --keep-book-zoom: tan(atan2(
      calc(var(--keep-book-page-width) * 2 + var(--keep-book-spine)),
      calc(var(--keep-book-ref-page) * 2 + var(--keep-book-spine))
    ));
    --keep-book-page-width: min(
      var(--keep-book-ref-page),
      calc((100vw - var(--keep-app-rail) - var(--keep-book-aside-min) - var(--keep-app-gutter) * 2 - var(--keep-book-cover) * 2 - var(--keep-book-spine)) / 2),
      calc(((100vh - var(--keep-app-foot) - var(--keep-baseline) * 20) * var(--keep-book-ratio) - var(--keep-book-cover) * 2 - var(--keep-book-spine)) / 2)
    );
    --keep-book-width: calc(var(--keep-book-page-width) * 2 + var(--keep-book-cover) * 2 + var(--keep-book-spine));
    --keep-book-height: calc(var(--keep-book-width) / var(--keep-book-ratio));
    --keep-book-page-height: calc(var(--keep-book-height) - var(--keep-book-cover-y) * 2);
    /* The page's margins in baseline units, in the zoomed space: four at
       the top, the spine side, and the outer edge; the measure is what
       they leave of a reference page. */
    --keep-book-margin: calc(var(--keep-baseline) * 4);
    --keep-book-margin-outer: calc(var(--keep-baseline) * 4);
    --keep-book-measure: calc(var(--keep-book-ref-page) - var(--keep-book-margin) - var(--keep-book-margin-outer));
    /* The book's place in the row, and where it goes when a panel
       opens (the settings, the connection walkthrough): shrunk to half
       about its top center, ten units from the row's top, under the
       wordmark, the panel beneath it. */
    --keep-book-top: calc((100vh - var(--keep-app-foot) - var(--keep-book-height)) / 2);
    --keep-book-panel-top: calc(var(--keep-baseline) * 10);
    --keep-book-panel-width: calc(var(--keep-book-width) * var(--keep-book-shrink));
    --keep-book-shrink: 0.5;
    --keep-book-panel-rise: calc(var(--keep-book-panel-top) - var(--keep-book-top));
    --keep-book-panel-ease: 480ms cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Dark mode, for signed-in pages (`html[data-keep-mode]`, the member's
   appearance from the bookstore): the palette's colors are pointed at
   the theme's dark inks and papers, so the desk, the rail, the aside, the
   fine print, and every pill and field go dark with the book. White, the
   app's ground, is the theme's desk; ink and Graphite its light body ink;
   Umber and Vein its soft ink; the grays the fills are made of are its
   body ink over the desk at a few strengths. Declared on :root, where the
   semantic tokens are, so they resolve again from these. `system` turns
   dark only where the device is set dark; signed-out pages carry no mode
   and stay light. */
/* A modal's veil (the underlay's color): white in light mode, black in
   dark, pure rather than the theme's desk. */
@layer keep.tokens {
  :root {
    --keep-modal-veil: #fff;
  }

  :root[data-keep-mode="dark"] {
    --keep-modal-veil: #000;
  }

  @media (prefers-color-scheme: dark) {
    :root[data-keep-mode="system"] {
      --keep-modal-veil: #000;
    }
  }
}

@layer keep.tokens {
  :root[data-keep-mode="dark"] {
    color-scheme: dark;
    --keep-color-white: var(--keep-book-desk);
    --keep-color-ink: var(--keep-book-ink);
    --keep-color-graphite: var(--keep-book-ink);
    --keep-color-umber: var(--keep-book-ink-soft);
    --keep-color-vein: var(--keep-book-ink-soft);
    --keep-color-display-text-gray: var(--keep-book-ink-soft);
    --keep-color-ornament-gray: color-mix(in srgb, var(--keep-book-ink) 9%, var(--keep-book-desk));
    --keep-color-travertine: color-mix(in srgb, var(--keep-book-ink) 18%, var(--keep-book-desk));
    --keep-color-ivory: color-mix(in srgb, var(--keep-book-ink) 5%, var(--keep-book-desk));
    --keep-color-light-cream: color-mix(in srgb, var(--keep-book-ink) 3%, var(--keep-book-desk));
    --keep-color-silver: color-mix(in srgb, var(--keep-book-ink) 30%, var(--keep-book-desk));
    --keep-color-border: color-mix(in srgb, var(--keep-book-ink) 16%, transparent);
  }

  @media (prefers-color-scheme: dark) {
    :root[data-keep-mode="system"] {
      color-scheme: dark;
      --keep-color-white: var(--keep-book-desk);
      --keep-color-ink: var(--keep-book-ink);
      --keep-color-graphite: var(--keep-book-ink);
      --keep-color-umber: var(--keep-book-ink-soft);
      --keep-color-vein: var(--keep-book-ink-soft);
      --keep-color-display-text-gray: var(--keep-book-ink-soft);
      --keep-color-ornament-gray: color-mix(in srgb, var(--keep-book-ink) 9%, var(--keep-book-desk));
      --keep-color-travertine: color-mix(in srgb, var(--keep-book-ink) 18%, var(--keep-book-desk));
      --keep-color-ivory: color-mix(in srgb, var(--keep-book-ink) 5%, var(--keep-book-desk));
      --keep-color-light-cream: color-mix(in srgb, var(--keep-book-ink) 3%, var(--keep-book-desk));
      --keep-color-silver: color-mix(in srgb, var(--keep-book-ink) 30%, var(--keep-book-desk));
      --keep-color-border: color-mix(in srgb, var(--keep-book-ink) 16%, transparent);
    }
  }
}

/* A data URI cannot read a token: in dark mode the select's chevron is
   drawn again in the dark body ink, the same in every theme. */
@layer keep.components {
  :root[data-keep-mode="dark"] .keep-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ecebe8' stroke-width='1.25'/%3E%3C/svg%3E");
  }

  @media (prefers-color-scheme: dark) {
    :root[data-keep-mode="system"] .keep-select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ecebe8' stroke-width='1.25'/%3E%3C/svg%3E");
    }
  }
}

/* On a book page every text color is one of the theme's four inks: the
   palette's ink and Graphite are the body ink, Umber and Vein (and the
   soft text built on Umber) the soft body ink, so the warm grays never
   reach the page and a theme swaps every ink at once. Declared on the
   book's body, so the semantic tokens resolve again there; a fill that
   mixed a warm gray mixes the soft ink instead. */
@layer keep.tokens {
  .keep-app--book {
    --keep-color-ink: var(--keep-book-ink);
    --keep-color-text: var(--keep-book-ink);
    --keep-color-graphite: var(--keep-book-ink);
    --keep-color-umber: var(--keep-book-ink-soft);
    --keep-color-vein: var(--keep-book-ink-soft);
    --keep-color-text-soft: var(--keep-book-ink-soft);
    --keep-color-travertine: color-mix(in srgb, var(--keep-book-ink-soft) 30%, var(--keep-book-page));
  }
}

@layer keep.layout {
  /* The desk furniture, the tabs, and the panel exist only in the book;
     the page's lede and its search form are off the pages (the search
     is on the desk). */
  .keep-book__brand,
  .keep-book__search,
  .keep-book__panel,
  .keep-book__expand,
  .keep-book__hint,
  .keep-book__actions,
  .keep-letters,
  .keep-pages__nav {
    display: none;
  }

  /* Without the book (a narrow window, a phone) there is no desk, but a
     panel that is linked to still shows, in the flow after the page, so
     an empty book's Import and Connect links lead somewhere. */
  .keep-book__panel:is(.keep-book__panel--open, :target) {
    display: block;
  }

  @media (width >= 42rem) {
    /* Three columns from the two-column step: the page column is the
       book and its gutters and whatever the aside leaves past its cap,
       and the aside takes the rest between its floor and its cap. No
       hairlines between the columns; the book's shadow is the only
       edge. */
    .keep-app--book .keep-app__body {
      grid-template-areas: "rail main aside";
      grid-template-columns:
        var(--keep-app-rail)
        minmax(calc(var(--keep-book-width) + var(--keep-app-gutter) * 2), 1fr)
        minmax(var(--keep-book-aside-min), var(--keep-book-aside-max));
      grid-template-rows: 1fr;
    }

    .keep-app--book .keep-app__rail {
      border: 0;
    }

    .keep-app--book .keep-app__aside {
      align-self: start;
      block-size: calc(100vh - var(--keep-app-foot));
      border: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-inline-start: var(--keep-space-4);
      /* Three units lower than the shell's three: the rail's tool row
         stands above its index, so this puts the Activity line on
         Home's baseline and the first row's first line on Suggestions'. */
      padding-top: calc(var(--keep-baseline) * 6);
      position: sticky;
      scrollbar-width: none;
      top: 0;
    }

    /* The rail's groups after the first are placed in the rail's box
       (sticky, so it is the box): the second and third, the times and
       the parts of Keep, together at the row's center, as near as the
       grid allows, the block's top the row's half less half the
       block's height rounded to a unit, the parts following the times
       two units on; the fourth and fifth, the bookstore's and the
       connected, at the rail's foot, the last ending two units above
       it, on the Activity line's level across the row, the bookstore's
       two units above that. Each entry's line stays on the baseline. */
    .keep-app--book .keep-app__rail .keep-index:nth-child(n + 2) {
      inset-inline-start: var(--keep-app-gutter);
      position: absolute;
    }

    .keep-app--book .keep-app__rail .keep-index:nth-child(2) {
      inset-block-start: var(--keep-book-rail-block-top);
    }

    .keep-app--book .keep-app__rail .keep-index:nth-child(3) {
      inset-block-start: calc(var(--keep-book-rail-block-top) + var(--keep-book-rail-time-entries) * var(--keep-baseline) * 3 + var(--keep-baseline) * 2);
    }

    .keep-app--book .keep-app__rail .keep-index:nth-child(4) {
      inset-block-end: calc(var(--keep-baseline) * 2 + var(--keep-book-rail-connected-entries) * var(--keep-baseline) * 3 + var(--keep-baseline) * 2);
    }

    .keep-app--book .keep-app__rail .keep-index:nth-child(5) {
      inset-block-end: calc(var(--keep-baseline) * 2);
    }

    /* The cover: a thin board with a light edge, resting on its ground
       shadow, darkest right under its bottom edge, centered in its
       column (which is wider than the book when the window's height,
       not its width, sets the book's size). The pages are its
       backgrounds; everything on them is scaled by the book's scale.
       The tabs, the tool, the caption, and the panel are laid in the
       same grid area and centered the same way, so they stay with the
       book. */
    .keep-app--book .keep-app__main {
      align-self: center;
      background: var(--keep-book-cover-color);
      block-size: var(--keep-book-height);
      border-radius: 0.875rem;
      box-shadow:
        0 0 0 1px rgb(0 0 0 / 0.05),
        0 2px 3px rgb(0 0 0 / 0.07),
        0 10px 16px -8px rgb(0 0 0 / 0.26);
      box-sizing: border-box;
      inline-size: var(--keep-book-width);
      isolation: isolate;
      justify-self: center;
      margin-block: 0;
      overflow: hidden;
      padding: var(--keep-book-cover-y) var(--keep-book-cover);
      position: relative;
      transform-origin: 50% 0;
      transition: transform var(--keep-book-panel-ease);
    }

    /* Every piece on the pages is laid out in the reference book's
       measures and scaled about its anchor by a transform (zoom is not
       applied the same way in every browser): its own box is in
       reference pixels, its place on the cover in real ones, so an
       offset from the cover's edge is the reference offset times the
       scale. The column clips, never scrolls. */
    .keep-app--book .keep-app__main > * {
      transform: scale(var(--keep-book-zoom));
      transform-origin: 0 0;
    }

    .keep-app--book .keep-app__main {
      overflow: clip;
    }

    /* The pages: rounded at the outer corners, square at the spine,
       each falling into the binding with a narrow valley and a fainter
       slope, the left a little deeper since the light comes from the
       top left, and a faint rule at the seam. Past each page's outer
       edge the block of pages beneath shows: slivers of paper edge,
       darker than the page, a sheet to the pixel with a faint line
       between each and a firmer one at the block's edge. Each sliver is
       the page's own shape shifted sideways, so the block shows at the
       side only, tapering into the corners. */
    .keep-app--book .keep-app__main::before,
    .keep-app--book .keep-app__main::after {
      background-color: var(--keep-book-page);
      border: 0.5px solid rgb(0 0 0 / 0.15);
      content: "";
      inset: var(--keep-book-cover-y) var(--keep-book-cover);
      position: absolute;
      z-index: -1;
    }

    .keep-app--book .keep-app__main::before {
      background-image:
        linear-gradient(to left, rgb(0 0 0 / 0.045), rgb(0 0 0 / 0.015) 1.5%, transparent 4%),
        linear-gradient(to left, rgb(0 0 0 / 0.02), transparent 10%);
      border-inline-end: 0;
      border-radius: 0.5rem 0 0 0.5rem;
      box-shadow:
        -0.5px 0 0 var(--keep-book-edge),
        -1px 0 0 rgb(0 0 0 / 0.07),
        -1.5px 0 0 var(--keep-book-edge),
        -2px 0 0 rgb(0 0 0 / 0.07),
        -2.5px 0 0 var(--keep-book-edge),
        -3px 0 0 rgb(0 0 0 / 0.07),
        -3.5px 0 0 var(--keep-book-edge),
        -4px 0 0 rgb(0 0 0 / 0.13);
      inset-inline-end: calc(50% + var(--keep-book-spine) / 2);
    }

    .keep-app--book .keep-app__main::after {
      background-image:
        linear-gradient(to right, rgb(0 0 0 / 0.035), rgb(0 0 0 / 0.012) 1.5%, transparent 3.5%),
        linear-gradient(to right, rgb(0 0 0 / 0.012), transparent 8%);
      border-inline-start: 0.5px solid rgb(0 0 0 / 0.1);
      border-radius: 0 0.5rem 0.5rem 0;
      box-shadow:
        0.5px 0 0 var(--keep-book-edge),
        1px 0 0 rgb(0 0 0 / 0.07),
        1.5px 0 0 var(--keep-book-edge),
        2px 0 0 rgb(0 0 0 / 0.07),
        2.5px 0 0 var(--keep-book-edge),
        3px 0 0 rgb(0 0 0 / 0.07),
        3.5px 0 0 var(--keep-book-edge),
        4px 0 0 rgb(0 0 0 / 0.13);
      inset-inline-start: calc(50% + var(--keep-book-spine) / 2);
    }

    /* The tabs: two squares printed on the right page, their edge on
       the page's, the first in the tint. Laid in the page's grid area
       and centered like the book, so a block-start margin finds their
       places on it; they shrink about their own top left when the
       settings open. */
    .keep-app--book .keep-app__body::before,
    .keep-app--book .keep-app__body::after {
      align-self: center;
      block-size: var(--keep-book-tab);
      content: "";
      grid-area: main;
      inline-size: var(--keep-book-tab);
      justify-self: center;
      margin-inline-start: calc(var(--keep-book-width) - var(--keep-book-cover) * 2 - var(--keep-book-tab));
      pointer-events: none;
      transform-origin: 0 0;
      transition: transform var(--keep-book-panel-ease);
      z-index: 1;
    }

    .keep-app--book .keep-app__body::before {
      background: var(--keep-book-accent);
      margin-block-start: calc(var(--keep-book-tab) - var(--keep-book-height) * 0.3);
    }

    .keep-app--book .keep-app__body::after {
      background: var(--keep-book-ink);
      margin-block-start: calc(var(--keep-book-tab) + var(--keep-book-height) * 0.12);
    }

    /* The desk. The wordmark: the lockup's letters without its mark,
       centered over the page column, its box two units down so the
       baseline is on the 40px line. */
    .keep-app--book .keep-book__brand {
      align-self: start;
      display: inline-block;
      grid-area: main;
      justify-self: center;
      margin-block-start: calc(var(--keep-baseline) * 2);
      z-index: 1;
    }

    /* The search: the field centered over the page column, under the
       wordmark, its box three units below the wordmark's line, so the
       two read as the desk's head whatever the book's height leaves
       above it. Gone while a panel is open. */
    .keep-app--book .keep-book__search {
      align-self: start;
      display: block;
      grid-area: main;
      justify-self: center;
      margin: 0;
      margin-block-start: calc(var(--keep-baseline) * 8);
      transition: opacity 160ms ease;
      z-index: 1;
    }

    :is([data-keep-book-panel] .keep-app--book, .keep-app--book:has(.keep-book__panel:target)) .keep-book__search {
      opacity: 0;
      pointer-events: none;
    }

    /* The caption: 12px in Vein on a 16px line, a unit under the
       book's bottom edge, ending on the book's right edge, the keys in
       the pills' keycaps a step smaller. A
       keycap's symbol and stroke go to ink while its key is down. Gone
       while the settings are open. */
    .keep-app--book .keep-book__hint {
      align-items: center;
      align-self: center;
      color: var(--keep-color-vein);
      display: flex;
      font-size: 0.75rem;
      gap: 0.3em;
      box-sizing: border-box;
      grid-area: main;
      inline-size: var(--keep-book-width);
      justify-content: flex-end;
      justify-self: center;
      line-height: calc(var(--keep-baseline) * 2);
      margin: 0;
      margin-block-start: calc(var(--keep-book-height) + var(--keep-baseline) * 4);
      transition: opacity 160ms ease;
    }

    :is([data-keep-book-panel] .keep-app--book, .keep-app--book:has(.keep-book__panel:target)) .keep-book__hint {
      opacity: 0;
    }

    /* The action bar: the book's actions in a row under the book,
       Configure last, a link to the settings panel, centered on its
       axis, its line on the baseline nearest halfway between the book's
       bottom edge and the row's bottom (the book is centered, so that
       is the book's top offset and a half below the row's top, plus
       the book). Gone while the settings are open; the panel's own
       way back and Escape close them. */
    .keep-app--book .keep-book__actions {
      align-self: start;
      display: flex;
      gap: var(--keep-baseline);
      grid-area: main;
      justify-content: center;
      justify-self: center;
      margin: 0;
      margin-block-start: round(
        nearest,
        calc(var(--keep-book-top) * 1.5 + var(--keep-book-height) - var(--keep-baseline) * 1.5),
        var(--keep-baseline)
      );
      transition: opacity 160ms ease;
      z-index: 1;
    }

    :is([data-keep-book-panel] .keep-app--book, .keep-app--book:has(.keep-book__panel:target)) .keep-book__actions {
      opacity: 0;
      pointer-events: none;
    }

    /* A panel open (html carries data-keep-book-panel, set by book.js,
       or a panel is the target without it): the book shrinks about its
       top center and rises to the panel top, and the tabs go with it,
       each by the book's rise plus the shrink's pull toward the book's
       center line. The panel stands under the shrunk book, the book's
       width, fading in once the book has moved and out first on the
       way back. */
    :is([data-keep-book-panel] .keep-app--book, .keep-app--book:has(.keep-book__panel:target)) .keep-app__main {
      transform: translateY(var(--keep-book-panel-rise)) scale(var(--keep-book-shrink));
    }

    :is([data-keep-book-panel] .keep-app--book, .keep-app--book:has(.keep-book__panel:target)) .keep-app__body::before {
      transform:
        translate(
          calc((var(--keep-book-shrink) - 1) * (var(--keep-book-width) / 2 - var(--keep-book-cover) - var(--keep-book-tab))),
          calc(var(--keep-book-panel-rise) + (var(--keep-book-shrink) - 1) * var(--keep-book-height) * 0.35)
        )
        scale(var(--keep-book-shrink));
    }

    :is([data-keep-book-panel] .keep-app--book, .keep-app--book:has(.keep-book__panel:target)) .keep-app__body::after {
      transform:
        translate(
          calc((var(--keep-book-shrink) - 1) * (var(--keep-book-width) / 2 - var(--keep-book-cover) - var(--keep-book-tab))),
          calc(var(--keep-book-panel-rise) + (var(--keep-book-shrink) - 1) * var(--keep-book-height) * 0.56)
        )
        scale(var(--keep-book-shrink));
    }

    .keep-app--book .keep-book__panel {
      align-self: start;
      /* The box runs from eight units under the shrunk book (Expand
         sits in those), on the first grid line past that, to the row's
         foot, and scrolls on its own, the page never growing; what runs
         past its last four units fades, and the foot's padding lets
         the end scroll clear of the fade. */
      --keep-book-panel-start: round(
        up,
        calc(var(--keep-book-panel-top) + var(--keep-book-height) * var(--keep-book-shrink) + var(--keep-baseline) * 8),
        var(--keep-baseline)
      );
      block-size: calc(100vh - var(--keep-app-foot) - var(--keep-book-panel-start));
      box-sizing: border-box;
      display: block;
      grid-area: main;
      /* A column on the book's axis as wide as the shrunk book above
         it, so the two read as one: the prose at that measure, the
         forms and facts filling it. */
      inline-size: var(--keep-book-panel-width);
      justify-self: center;
      margin-block-start: var(--keep-book-panel-start);
      -webkit-mask-image: linear-gradient(to bottom, black calc(100% - var(--keep-baseline) * 4), transparent);
      mask-image: linear-gradient(to bottom, black calc(100% - var(--keep-baseline) * 4), transparent);
      opacity: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-block-end: calc(var(--keep-baseline) * 6);
      scrollbar-width: none;
      transition: opacity 240ms ease, visibility 0s linear 240ms;
      visibility: hidden;
    }

    .keep-app--book .keep-book__panel::-webkit-scrollbar {
      display: none;
    }

    .keep-app--book :is(.keep-book__panel--open, .keep-book__panel:target) {
      opacity: 1;
      transition: opacity 240ms ease 320ms, visibility 0s linear 320ms;
      visibility: visible;
    }


    .keep-app--book .keep-book__panel > p,
    .keep-app--book .keep-book__steps,
    .keep-app--book .keep-book__facts {
      color: var(--keep-color-graphite);
      font-size: 0.75rem;
      line-height: calc(var(--keep-baseline) * 2);
    }

    .keep-app--book .keep-book__panel > p {
      margin: var(--keep-baseline) 0 0;
    }

    /* A walkthrough's steps: numbered in Vein in a column of their own,
       a unit between steps, three units after the title or the facts. */
    .keep-app--book .keep-book__steps {
      counter-reset: keep-step;
      list-style: none;
      margin: calc(var(--keep-baseline) * 3) 0 0;
      padding: 0;
    }

    .keep-app--book .keep-book__steps li {
      counter-increment: keep-step;
      display: grid;
      column-gap: var(--keep-space-2);
      grid-template-columns: calc(var(--keep-baseline) * 2) minmax(0, 1fr);
    }

    .keep-app--book .keep-book__steps li::before {
      color: var(--keep-color-vein);
      content: counter(keep-step);
      font-variant-numeric: tabular-nums;
    }

    .keep-app--book .keep-book__steps li + li {
      margin-block-start: var(--keep-baseline);
    }

    /* The facts a device is given, stacked: the term on a two-unit
       line in Medium ink, the value under it in the mono face in a
       soft pill the column's width, Copy at the pill's end (sent
       hidden; book.js shows it where the clipboard is). Three units
       after the prose, two between facts. */
    .keep-app--book .keep-book__facts {
      display: flex;
      flex-direction: column;
      gap: calc(var(--keep-baseline) * 2);
      margin: calc(var(--keep-baseline) * 3) 0 0;
    }

    .keep-app--book .keep-book__fact dt {
      color: var(--keep-color-ink);
      font-weight: 500;
    }

    .keep-app--book .keep-book__fact dd {
      align-items: center;
      background: color-mix(in srgb, var(--keep-color-ornament-gray) 50%, var(--keep-color-white));
      border-radius: 999px;
      box-sizing: border-box;
      display: flex;
      gap: var(--keep-space-2);
      justify-content: space-between;
      margin: 0;
      min-block-size: calc(var(--keep-baseline) * 3);
      padding: 0 var(--keep-baseline) 0 calc(var(--keep-baseline) * 2);
    }

    /* A long fact (the password) wraps inside its pill, on two-unit
       lines with half a unit above and below, so one line is three
       units and two are five. */
    .keep-app--book .keep-book__fact .keep-reveal__code {
      color: var(--keep-color-ink);
      line-height: calc(var(--keep-baseline) * 2);
      min-inline-size: 0;
      padding-block: calc(var(--keep-baseline) / 2);
    }

  }
}

@layer keep.components {
  /* The wordmark on the desk is the letters alone: the lockup's mark is
     declared in this layer, so it is turned off here. */
  .keep-app--book .keep-book__brand::before {
    display: none;
  }

  /* The desk's search field as a soft pill: a gray only just off the
     white, Ornament gray halfway to White, no stroke, round ends, a
     little wider than its prompt, with a search glass (Tabler Icons'
     search, MIT) before the words, drawn in the prompt's color, Umber
     lightened by three tenths toward White (#979797, the standard soft ink so lightened, written out since
     the glass cannot read a token). Two units of the pill at each end,
     the glass 14px, six pixels to the words. In this layer, over the
     field's own stroke and corner. */
  .keep-app--book .keep-book__search .keep-reveal__field {
    background:
      color-mix(in srgb, var(--keep-color-ornament-gray) 50%, var(--keep-color-white))
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23979797' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='7'/%3E%3Cpath d='m21 21-6-6'/%3E%3C/svg%3E")
      no-repeat calc(var(--keep-baseline) * 2) center / 14px 14px;
    border: 0;
    border-radius: 999px;
    display: block;
    inline-size: 10rem;
    padding-inline: calc(var(--keep-baseline) * 2 + 14px + 6px) calc(var(--keep-baseline) * 2);
    text-align: start;
  }

  .keep-app--book .keep-book__search .keep-reveal__field::placeholder {
    color: color-mix(in srgb, var(--keep-color-umber) 70%, var(--keep-color-white));
  }

  /* The panel's parts that the components below would otherwise set:
     the title, the note, the rows and their fields, the pills, and
     Copy. In this layer so they win. */
  /* What a panel holds, on the book's grid. The title is the page
     head's size, Medium, on a three-unit line; the prose under it the
     small size on a two-unit line in Graphite, at a reading width,
     a unit after the title. */
  .keep-app--book .keep-book__panel > .keep-section__title {
    font-size: 0.875rem;
    padding: 6px 0 2px;
  }

  .keep-app--book .keep-book__panel > .keep-reveal__note {
    color: var(--keep-color-graphite);
    padding: 0;
  }

  /* A stub panel's last line, that the action is not wired up yet: in
     Vein, right under the choices' box, three units under the pill. */
  .keep-app--book .keep-book__soon {
    color: var(--keep-color-vein);
    margin: 0;
  }

  /* A second part of one panel, such as the Import panel's Instagram
     handles: the panel's prose size, set in the title's ink, four units
     after what precedes it. */
  .keep-app--book .keep-book__subhead {
    color: var(--keep-color-text);
    font-size: 0.75rem;
    font-weight: inherit;
    line-height: calc(var(--keep-baseline) * 2);
    margin: calc(var(--keep-baseline) * 4) 0 0;
  }

  /* A file field: the browser's button drawn as a pill, the chosen
     file's name beside it in the panel's prose. */
  .keep-app--book .keep-book__file {
    color: var(--keep-color-graphite);
    font: inherit;
    font-size: 0.75rem;
    max-inline-size: 100%;
  }

  .keep-app--book .keep-book__file::file-selector-button {
    background: transparent;
    border: 1px solid var(--keep-color-border);
    border-radius: 999px;
    color: var(--keep-color-text);
    cursor: pointer;
    font: inherit;
    margin-inline-end: var(--keep-space-2);
    padding: 0 0.75em;
  }

  /* Matches to review: one line each, the box, then the name, the
     handle, and why in the soft ink, a unit between lines. */
  .keep-app--book .keep-book__matches {
    list-style: none;
    margin: calc(var(--keep-baseline) * 2) 0 0;
    padding: 0;
  }

  .keep-app--book .keep-book__match {
    align-items: baseline;
    column-gap: var(--keep-space-2);
    display: grid;
    font-size: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr);
    line-height: calc(var(--keep-baseline) * 2);
  }

  .keep-app--book .keep-book__match input {
    accent-color: var(--keep-color-text);
    margin: 0;
  }

  .keep-app--book .keep-book__match label {
    color: var(--keep-color-graphite);
    cursor: pointer;
  }

  .keep-app--book .keep-book__match-name {
    color: var(--keep-color-text);
  }

  .keep-app--book .keep-book__match-reason {
    color: var(--keep-color-umber);
  }

  /* The rail's placed groups in the book layout carry no gap of their
     own: their place is set, and the groups' gap is declared in this
     layer, so it is undone here. */
  .keep-app--book .keep-app__rail .keep-index + .keep-index {
    margin-top: 0;
  }

  /* The caption's keycaps: a step smaller than the pills', and ink
     while the key is down. In this layer, over the keycap's own size
     and color. */
  .keep-app--book .keep-book__hint .keep-pill__keys {
    margin-inline-start: 0;
  }

  .keep-app--book .keep-book__hint .keep-pill__key {
    block-size: 15px;
    font-size: 0.75rem;
    min-inline-size: 15px;
    transition: border-color 120ms ease, color 120ms ease;
  }

  .keep-app--book .keep-book__hint .keep-pill__key--down {
    border-color: var(--keep-color-ink);
    color: var(--keep-color-ink);
    transition: none;
  }

  /* The panel's rows: the label in five rems, the control the rest,
     a field or select the whole of it. */
  .keep-app--book .keep-book__panel .keep-rows {
    max-inline-size: none;
  }

  .keep-app--book .keep-book__panel .keep-rows--aligned .keep-row {
    grid-template-columns: 5rem minmax(0, 1fr);
  }

  .keep-app--book .keep-book__panel .keep-reveal__field,
  .keep-app--book .keep-book__panel .keep-select {
    inline-size: 100%;
    max-inline-size: none;
  }

  .keep-app--book .keep-book__fact dd .keep-book__copy {
    background: var(--keep-color-white);
    flex: none;
    line-height: calc(var(--keep-baseline) * 2);
    padding-inline: var(--keep-baseline);
  }

  .keep-app--book .keep-book__fact dd .keep-book__copy:hover {
    background: var(--keep-color-white);
    color: var(--keep-color-umber);
  }

  /* The panel's fields and pills in the desk's language: the soft
     pill, no stroke, round, Ornament gray on hover; the solid pill
     ink. The select keeps its chevron. */
  .keep-app--book .keep-book__panel .keep-reveal__field,
  .keep-app--book .keep-book__panel .keep-select,
  .keep-app--book .keep-book__panel .keep-pill {
    border: 0;
    border-radius: 999px;
    line-height: calc(var(--keep-baseline) * 3);
    padding-inline: calc(var(--keep-baseline) * 2);
  }

  .keep-app--book .keep-book__panel .keep-reveal__field,
  .keep-app--book .keep-book__panel .keep-pill {
    background: color-mix(in srgb, var(--keep-color-ornament-gray) 50%, var(--keep-color-white));
  }

  .keep-app--book .keep-book__panel .keep-select {
    background-color: color-mix(in srgb, var(--keep-color-ornament-gray) 50%, var(--keep-color-white));
    background-position: right calc(var(--keep-baseline) * 2) center;
    padding-inline-end: calc(var(--keep-baseline) * 4);
  }

  .keep-app--book .keep-book__panel .keep-reveal__field:hover,
  .keep-app--book .keep-book__panel .keep-select:hover,
  .keep-app--book .keep-book__panel .keep-pill:hover {
    background-color: var(--keep-color-ornament-gray);
  }

  .keep-app--book .keep-book__panel .keep-pill--solid,
  .keep-app--book .keep-book__panel .keep-pill--solid:hover {
    background: var(--keep-color-ink);
    color: var(--keep-color-white);
  }

  .keep-app--book .keep-book__panel .keep-pill[aria-pressed="true"] {
    background: var(--keep-color-ink);
    color: var(--keep-color-white);
  }

  /* The action bar's buttons: the search's pill again, three units
     tall, the words in Graphite at the small size with a 14px glyph
     (Tabler Icons' refresh, upload, download, lock, and settings, MIT)
     six pixels before them, two units of the pill at each end. A hover
     deepens the gray. */
  .keep-app--book .keep-book__action {
    align-items: center;
    appearance: none;
    background: color-mix(in srgb, var(--keep-color-ornament-gray) 50%, var(--keep-color-white));
    block-size: calc(var(--keep-baseline) * 3);
    border: 0;
    border-radius: 999px;
    color: var(--keep-color-graphite);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.75rem;
    gap: 6px;
    line-height: 1;
    margin: 0;
    padding: 0 calc(var(--keep-baseline) * 2);
    text-decoration: none;
    transition: background-color 120ms ease;
  }

  .keep-app--book .keep-book__action:hover {
    background: var(--keep-color-ornament-gray);
  }

  .keep-app--book .keep-book__action-icon {
    block-size: 14px;
    inline-size: 14px;
  }

  /* Expand: the way back, an action pill under the shrunk book, two
     units below its bottom edge on the book's axis, shown with the
     panel. A link to #page, so it closes the panel without the
     script by untargeting it; book.js closes in place. */
  .keep-app--book .keep-book__expand {
    align-self: start;
    grid-area: main;
    justify-self: center;
    margin: 0;
    margin-block-start: round(
      up,
      calc(var(--keep-book-panel-top) + var(--keep-book-height) * var(--keep-book-shrink) + var(--keep-baseline) * 2),
      var(--keep-baseline)
    );
    opacity: 0;
    transition: opacity 240ms ease, visibility 0s linear 240ms;
    visibility: hidden;
    z-index: 1;
  }

  :is([data-keep-book-panel] .keep-app--book, .keep-app--book:has(.keep-book__panel:target)) .keep-book__expand {
    opacity: 1;
    transition: opacity 240ms ease 320ms, visibility 0s linear 320ms;
    visibility: visible;
  }

  /* WebKit draws its own glass and clear button in a search field and
     keeps room for them; neither belongs in the pill. book.js then sets
     the pill's width from the prompt as the browser measures it, so the
     width above is only the no-script size. */
  .keep-app--book .keep-book__search .keep-reveal__field::-webkit-search-decoration,
  .keep-app--book .keep-book__search .keep-reveal__field::-webkit-search-cancel-button,
  .keep-app--book .keep-book__search .keep-reveal__field::-webkit-search-results-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
  }

  @media (width >= 42rem) {
    /* On the pages, in the zoomed space. The summary's head on the
       verso: two units under the page's top edge, so the title's
       baseline is on the fifth unit; the title a size down with the
       count after it in Regular and the tint; the lede and the search
       form off the page. The head stays on every spread's verso as its
       running head. */
    .keep-app--book .keep-app__main > .keep-page__head {
      inline-size: var(--keep-book-measure);
      inset-inline-start: calc(var(--keep-book-cover) + var(--keep-book-margin-outer) * var(--keep-book-zoom));
      position: absolute;
      top: calc(var(--keep-book-cover-y) + var(--keep-baseline) * 2 * var(--keep-book-zoom));
    }

    /* The running head: Medium, a size down, its baseline on the
       page's fifth unit (Bold and a pixel high until the contact
       spread's typographic pass, October 26, 2026). */
    .keep-app--book .keep-app__main .keep-page__title {
      font-size: 0.875rem;
      font-weight: 500;
      padding: 6.5px 0 1.5px;
    }

    .keep-app--book .keep-page__count {
      color: var(--keep-book-accent);
      font-weight: 400;
    }

    .keep-app--book .keep-app__main > .keep-page__head .keep-page__lede,
    .keep-app--book .keep-app__main > form {
      display: none;
    }

    /* The list in spreads: the block of sections runs from the verso's
       outer margin to the recto's, a page's height less the margins
       tall, and lays its content in columns of a page's measure with
       the two inner margins and the spine between, so every column is
       a page and every pair a spread. Its first column is left empty,
       a forced break after an empty block, so the first spread's verso
       stays the summary's; later spreads lie to the right, clipped, and
       a turn scrolls the block by two columns. It starts seven units
       down: the running head's line, three to six, and a unit under. */
    .keep-app--book .keep-pages {
      block-size: calc(var(--keep-book-page-height) / var(--keep-book-zoom) - var(--keep-book-margin) * 2);
      column-fill: auto;
      column-gap: calc(var(--keep-book-margin) * 2 + var(--keep-book-spine));
      columns: var(--keep-book-measure) auto;
      inline-size: calc(var(--keep-book-ref-page) * 2 + var(--keep-book-spine) - var(--keep-book-margin-outer) * 2);
      margin-block-start: calc(var(--keep-baseline) * 7 * var(--keep-book-zoom));
      margin-inline-start: calc(var(--keep-book-margin-outer) * var(--keep-book-zoom));
      overflow: hidden;
    }

    /* The empty first column: a block as tall as the column, so the
       content starts in the second whatever the browser makes of a
       forced break (Safari ignores one on an empty block). */
    .keep-app--book .keep-pages::before {
      block-size: 100%;
      break-after: column;
      content: "";
      display: block;
    }

    /* Laid by book.js: the pages are boxes in a row, each a page's
       measure wide and the block's height tall, with the two inner
       margins and the spine between, and the columns are off. The
       script fills them so a row never splits and a heading keeps its
       first row; Safari's columns do neither in a zoomed block. */
    .keep-app--book .keep-pages--laid {
      column-gap: normal;
      columns: auto;
      display: flex;
      gap: calc(var(--keep-book-margin) * 2 + var(--keep-book-spine));
    }

    .keep-app--book .keep-pages--laid::before {
      content: none;
    }

    .keep-app--book .keep-pages__page {
      block-size: 100%;
      flex: none;
      inline-size: var(--keep-book-measure);
      overflow: hidden;
      position: relative;
    }

    /* The sections on the pages: no rules between sections or rows, the
       space divides them. A section starts at a page's top; two units
       from its last row to the next heading, which is Medium in the
       soft color on its 32px box. A heading stays with its list, and a
       row never splits. A row is five units: the name on its 24px line
       with its baseline 16.5px down, and the facts on a 16px line
       pulled up by four so their baseline is two units under the name's,
       padded back by the same under; a unit between rows, so the rows
       pitch at six. In a name, the part the sort does not go by is
       Regular. */
    .keep-app--book .keep-pages .keep-section,
    .keep-app--book .keep-pages .keep-section + .keep-section {
      border-top: 0;
      margin-top: 0;
      padding-top: 0;
    }

    .keep-app--book .keep-pages .keep-section:not(:last-child) {
      margin-bottom: calc(var(--keep-baseline) * 2);
    }

    .keep-app--book .keep-pages .keep-section__title {
      break-after: avoid;
      color: var(--keep-color-text-soft);
      font-weight: 500;
    }

    .keep-app--book .keep-pages .keep-list__item {
      break-inside: avoid;
    }

    .keep-app--book .keep-pages .keep-list__item + .keep-list__item {
      border-top: 0;
      margin-top: var(--keep-baseline);
      padding-top: 0;
    }

    .keep-app--book .keep-pages .keep-list__facts {
      line-height: calc(var(--keep-baseline) * 2);
      margin-top: -4px;
      padding-bottom: 4px;
    }

    .keep-app--book .keep-list__name-rest {
      font-weight: 400;
    }

    /* A section continued from the spread before opens its verso under
       "C, cont'd", a heading in the heading's style that book.js lays;
       on a recto, continuing from its own verso, it opens with its rows
       and the heading in view across the spine. */
    /* The running head of the list pages, on the recto: the letters on
       the summary title's line, their baseline on the page's fifth
       unit, spread over the measure, 11px Medium in the body ink. A
       letter with no contacts is in the soft ink and not a link (Vein
       until the book's four inks, October 26, 2026). The run of
       letters on the spread shown is ink on square blocks of the tint
       the glyph's own height, three pixels past the glyph each side and
       pulled back by the same, so the row's spacing does not move; an
       empty letter inside the run is marked with it. */
    .keep-app--book .keep-letters {
      align-items: center;
      block-size: calc(var(--keep-baseline) * 3);
      display: flex;
      font-size: 0.6875rem;
      font-weight: 500;
      inline-size: var(--keep-book-measure);
      inset-inline-start: calc(var(--keep-book-cover) + (var(--keep-book-ref-page) + var(--keep-book-spine) + var(--keep-book-margin)) * var(--keep-book-zoom));
      justify-content: space-between;
      line-height: calc(var(--keep-baseline) * 3);
      position: absolute;
      top: calc(var(--keep-book-cover-y) + var(--keep-baseline) * 3 * var(--keep-book-zoom));
    }

    .keep-app--book .keep-letters__letter {
      color: var(--keep-book-ink);
      line-height: 1.2;
      margin-inline: -3px;
      padding: 0 3px;
      text-decoration: none;
    }

    .keep-app--book .keep-letters__letter--here {
      background: var(--keep-book-accent);
      color: var(--keep-color-ink);
    }

    .keep-app--book .keep-letters__letter:hover {
      color: var(--keep-book-accent);
    }

    .keep-app--book .keep-letters__letter--empty {
      color: var(--keep-book-ink-soft);
      pointer-events: none;
    }

    .keep-app--book .keep-letters__letter--empty.keep-letters__letter--here {
      color: var(--keep-color-ink);
    }

    /* The page turner: at the recto's foot, a unit above the page's
       edge, the spread's number of the count and the two turns. Drawn
       by book.js. */
    .keep-app--book .keep-pages__nav {
      align-items: baseline;
      color: var(--keep-color-text-soft);
      display: flex;
      font-size: 0.75rem;
      gap: var(--keep-space-3);
      inline-size: var(--keep-book-measure);
      inset-block-end: calc(var(--keep-book-cover-y) + var(--keep-baseline) * var(--keep-book-zoom));
      inset-inline-end: calc(var(--keep-book-cover) + var(--keep-book-margin-outer) * var(--keep-book-zoom));
      justify-content: flex-end;
      line-height: calc(var(--keep-baseline) * 2);
      position: absolute;
      transform-origin: 100% 100%;
    }

    .keep-app--book .keep-pages__turn {
      appearance: none;
      background: none;
      border: 0;
      color: var(--keep-color-ink);
      cursor: pointer;
      font: inherit;
      line-height: inherit;
      padding: 0 var(--keep-space-1);
    }

    .keep-app--book .keep-pages__turn:disabled {
      color: var(--keep-color-ornament-gray);
      cursor: default;
    }
  }

  /* An activity row in the stream: three 16px lines, the name in
     Medium, what happened in the soft color, then when in Vein, 11px,
     set flush right, with a unit between rows. The markup puts the time
     after what happened, in reading order. */
  .keep-list__item--stream {
    color: var(--keep-color-text-soft);
    display: block;
    font-size: 0.6875rem;
    line-height: calc(var(--keep-baseline) * 2);
    padding: 3.5px 0 4.5px;
    text-align: end;
  }

  .keep-list__item--stream + .keep-list__item--stream {
    border-top: 0;
    margin-top: var(--keep-baseline);
    padding-top: 3.5px;
  }

  .keep-list__item--stream .keep-list__name,
  .keep-list__item--stream .keep-list__when,
  .keep-list__item--stream .keep-list__facts {
    color: inherit;
    display: block;
    line-height: inherit;
    margin: 0;
    overflow: visible;
    padding: 0;
    text-overflow: clip;
    white-space: normal;
  }

  .keep-list__item--stream .keep-list__name {
    font-weight: 500;
  }

  .keep-list__item--stream .keep-list__when {
    color: var(--keep-color-vein);
    white-space: nowrap;
  }

  /* The stream: the book's aside as a livestream of what happened. The
     rows stand at the foot of the column, the newest lowest, older ones
     stacked upward and fading out from the sixth row to the eighth (a
     row is eight units with its gap); the Activity head and its source
     menu sit under the rows, two units above the fine print, the menu
     opening upward. All flush right, so the room falls between the book
     and the words. The markup is newest first; the list is a reversed
     column, so the first row is the lowest, and a new row from the live
     enhancement slides in from below. */
  @media (width >= 42rem) {
    .keep-app--book .keep-app__aside {
      display: flex;
      flex-direction: column;
      padding-bottom: calc(var(--keep-baseline) * 2);
      padding-inline-start: calc(var(--keep-space-4) + var(--keep-baseline) * 2);
    }

    .keep-app--book .keep-activity {
      display: flex;
      flex: 1 1 auto;
      flex-direction: column;
      min-block-size: 0;
    }

    .keep-app--book .keep-activity .keep-column__head {
      gap: var(--keep-space-3);
      justify-content: flex-end;
      margin-top: var(--keep-baseline);
      order: 1;
    }

    .keep-app--book .keep-activity .keep-menu__list {
      bottom: 100%;
      top: auto;
    }

    .keep-app--book .keep-activity .keep-list {
      display: flex;
      flex: 1 1 auto;
      flex-direction: column-reverse;
      justify-content: flex-start;
      margin-top: 0;
      mask-image: linear-gradient(
        to top,
        black calc(var(--keep-baseline) * 8 * 5),
        transparent calc(var(--keep-baseline) * 8 * 8)
      );
      min-block-size: 0;
      overflow: hidden;
      padding-top: calc(var(--keep-baseline) * 4);
    }

    .keep-app--book .keep-activity .keep-list__item + .keep-list__item {
      margin-bottom: var(--keep-baseline);
      margin-top: 0;
    }

    .keep-app--book .keep-activity .keep-list__item--entering {
      animation: keep-row-rise 240ms ease-out;
    }

    @keyframes keep-row-rise {
      from {
        opacity: 0;
        transform: translateY(4px);
      }
    }
  }
}

/* A contact's spread (`/contacts/:contact`, `pages/contact.leaf.html`):
   the book opened at one contact, as `ui/catalog/contact-summary.html`
   sets it (October 26, 2026). The verso's running head carries the
   card's own facts flush right on the title's baseline: a glyph and a
   value each, since when Keep holds it, where it came from, how many
   devices sync it. Under it the title page, centered from the page's
   fourteenth unit: an 80px portrait (lockup A), two units under it the
   name at 32px Medium on a five-unit line, then Call, Message, and
   Share as type one unit under (the title and company are fields on
   the recto since October 26, 2026, not a line under the name).
   The relationship (`partials/contact-relationship`) is laid from the
   page's foot, flush left, its last line on unit 68 whatever the card
   is missing: the nicknames in Medium, the summary, and three columns
   of what the member knows (first met, met in, known for), the terms
   Medium in the accent, the values Regular Italic. The recto keeps
   the letters as its running head, the contact's letter marked, each a
   link back to the list, and holds the card's fields under it: a group
   per kind, the label in the soft ink in a five-rem column and the
   value beside it on the row's 24px line, a unit between groups, the
   note on 16px lines. The turns at its foot go to the contacts before
   and after in the book's order. Below 42rem it is the plain shell, the
   summary over the fields. */
@layer keep.components {
  .keep-app--book .keep-page__title-link {
    color: inherit;
    text-decoration: none;
  }

  .keep-app--book .keep-page__title-link:hover,
  .keep-app--book .keep-page__title-link:hover .keep-page__count {
    color: var(--keep-book-accent);
  }

  /* A name on the list is the way to its spread. */
  .keep-app--book a.keep-list__name {
    color: inherit;
    text-decoration: none;
  }

  .keep-app--book a.keep-list__name:hover {
    color: var(--keep-book-accent);
  }

  /* The portrait: quiet, so the name carries the page (the balance
     review, October 26, 2026): the soft ink at 12% over the page, the
     initials 22px Medium in the soft ink, opened up. */
  .keep-contact__avatar {
    align-items: center;
    background: color-mix(in srgb, var(--keep-book-ink-soft) 12%, var(--keep-book-page));
    block-size: calc(var(--keep-baseline) * 10);
    border-radius: 50%;
    color: var(--keep-book-ink-soft);
    display: flex;
    flex: none;
    font-size: 1.375rem;
    font-weight: 500;
    inline-size: calc(var(--keep-baseline) * 10);
    justify-content: center;
    letter-spacing: 0.06em;
    overflow: hidden;
    text-indent: 0.06em;
  }

  .keep-contact__name {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: calc(var(--keep-baseline) * 5);
    margin: calc(var(--keep-baseline) * 2) 0 0;
    overflow-wrap: anywhere;
    /* Taurus seats a 32px line's baseline a pixel low; this puts it on
       the grid without moving the line's box. */
    position: relative;
    top: -1px;
  }

  /* Call, Message, Share as type: Regular words in the body ink after
     13px glyphs in the soft accent, three units apart; on hover the
     glyph takes the full accent and the word goes Medium. One the card
     cannot do is in the soft ink and not a link. In this layer, over
     the desk's action pills. */
  .keep-contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0 calc(var(--keep-baseline) * 3);
    margin-top: var(--keep-baseline);
  }

  .keep-app--book .keep-contact__actions .keep-book__action {
    background: none;
    block-size: auto;
    color: var(--keep-book-ink);
    font-size: 0.75rem;
    font-weight: 400;
    gap: 4px;
    line-height: calc(var(--keep-baseline) * 2);
    padding: 3.5px 0 4.5px;
  }

  .keep-app--book .keep-contact__actions .keep-book__action-icon {
    block-size: 13px;
    color: var(--keep-book-accent-soft);
    inline-size: 13px;
    stroke-width: 1.5;
  }

  /* The word keeps its Medium width at rest: an unseen Medium copy
     (data-text) under it, no taller than nothing, sets its width, so the
     hover's weight never moves the row. The copy is not read aloud. */
  .keep-contact__action-label {
    display: inline-flex;
    flex-direction: column;
  }

  .keep-contact__action-label::after {
    content: attr(data-text);
    content: attr(data-text) / "";
    font-weight: 500;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    visibility: hidden;
  }

  .keep-app--book .keep-contact__actions a.keep-book__action:hover {
    background: none;
    font-weight: 500;
  }

  .keep-app--book .keep-contact__actions a.keep-book__action:hover .keep-book__action-icon {
    color: var(--keep-book-accent);
  }

  .keep-app--book .keep-contact__actions .keep-book__action--off,
  .keep-app--book .keep-contact__actions .keep-book__action--off .keep-book__action-icon {
    color: var(--keep-book-ink-soft);
    cursor: default;
  }

  /* The card's own facts in the running head: 11px in the soft ink,
     each value after a 12px glyph (Tabler's device-floppy, file-import,
     and refresh), two units apart; the terms are for a screen reader.
     A long value gives way with an ellipsis before it reaches the
     title. */
  .keep-contact__meta {
    align-items: baseline;
    color: var(--keep-book-ink-soft);
    display: flex;
    font-size: 0.6875rem;
    flex-wrap: wrap;
    gap: 0 calc(var(--keep-baseline) * 2);
    letter-spacing: 0.01em;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
  }

  .keep-contact__meta div {
    align-items: baseline;
    display: inline-flex;
    gap: 4px;
    min-inline-size: 0;
  }

  .keep-contact__meta dd {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-contact__meta .keep-book__action-icon {
    align-self: center;
    block-size: 12px;
    color: var(--keep-book-ink-soft);
    flex: none;
    inline-size: 12px;
  }

  /* The relationship: laid from the foot of the summary's box, which
     runs to the page's foot margin, so its last line is on unit 68 on
     every card; on a card that reaches it, three units under the
     actions at least. Flush left on the measure. */
  .keep-contact__relationship {
    align-self: stretch;
    margin-bottom: calc(var(--keep-baseline) * 2);
    margin-top: auto;
    padding-top: calc(var(--keep-baseline) * 3);
    text-align: start;
  }

  .keep-contact__nicknames,
  .keep-contact__about {
    color: var(--keep-book-ink);
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 2);
    margin: 0;
    padding: 3.5px 0 4.5px;
    text-wrap: pretty;
  }

  .keep-contact__nicknames {
    font-weight: 500;
  }

  .keep-contact__known {
    display: grid;
    gap: 0 calc(var(--keep-baseline) * 2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: calc(var(--keep-baseline) * 2) 0 0;
  }

  /* Each term and value on its 16px line, padded so both baselines are
     on the grid; the soft inks are for marks, so the terms are words in
     the accent, Medium as every label on the page is. */
  .keep-contact__known div {
    font-size: 0.6875rem;
    letter-spacing: 0.01em;
    line-height: calc(var(--keep-baseline) * 2);
    padding: 3.5px 0 4.5px;
  }

  .keep-contact__known dt {
    color: var(--keep-book-accent);
    font-weight: 500;
  }

  .keep-contact__known dd {
    font-style: italic;
    margin: 0;
  }

  .keep-contact__known--blank dd {
    color: var(--keep-book-ink-soft);
  }

  /* The recto's last line: what the card lacks of phone, email,
     address, and birthday, in Vein, two units under the fields. */
  .keep-contact__missing {
    color: var(--keep-color-vein);
    font-size: 0.6875rem;
    line-height: calc(var(--keep-baseline) * 2);
    margin: calc(var(--keep-baseline) * 2) 0 0;
    padding: 3.5px 0 4.5px;
  }

  .keep-contact__fields > .keep-contact__missing:first-child {
    margin-top: 0;
  }

  .keep-contact__group {
    margin: 0;
  }

  .keep-contact__group + .keep-contact__group {
    margin-top: var(--keep-baseline);
  }

  .keep-contact__field {
    column-gap: var(--keep-baseline);
    display: grid;
    font-size: 0.75rem;
    grid-template-columns: 5rem minmax(0, 1fr);
    line-height: calc(var(--keep-baseline) * 3);
  }

  .keep-contact__field dt {
    color: var(--keep-color-text-soft);
    font-size: 0.6875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-contact__field dd {
    margin: 0;
    overflow-wrap: anywhere;
  }

  .keep-contact__field dd a {
    color: inherit;
    text-decoration: none;
  }

  .keep-contact__field dd a:hover {
    color: var(--keep-book-accent);
  }

  /* The note keeps the card's own lines, on 16px lines padded onto the
     grid, at most ten of them on the page. */
  .keep-contact__group--note dd {
    -webkit-box-orient: vertical;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    line-height: calc(var(--keep-baseline) * 2);
    overflow: hidden;
    padding: 4px 0;
    white-space: pre-line;
  }

  .keep-app--book a.keep-pages__turn {
    text-decoration: none;
  }

  .keep-app--book .keep-pages__turn--off {
    color: var(--keep-color-ornament-gray);
  }

  @media (width < 42rem) {
    .keep-contact__summary,
    .keep-contact__fields {
      margin-top: calc(var(--keep-baseline) * 3);
    }

    .keep-app--book .keep-app__main > .keep-letters {
      display: none;
    }

    .keep-app--book .keep-app__main > .keep-pages__nav {
      color: var(--keep-color-text-soft);
      display: flex;
      font-size: 0.75rem;
      gap: var(--keep-space-3);
      margin-top: calc(var(--keep-baseline) * 3);
    }
  }

  @media (width >= 42rem) {
    /* On the pages, in the zoomed space: the summary on the verso and the
       fields on the recto both start seven units down, where the list's
       first row does; the fields stop three units over the turns. */
    .keep-app--book .keep-app__main > .keep-contact__summary,
    .keep-app--book .keep-app__main > .keep-contact__fields {
      inline-size: var(--keep-book-measure);
      position: absolute;
      top: calc(var(--keep-book-cover-y) + var(--keep-baseline) * 7 * var(--keep-book-zoom));
    }

    /* The title page: centered on the measure from the page's
       fourteenth unit, seven under the body's top, so the room above it
       and the room below it, down to the relationship, run about 2 to 3
       on a full card, and as tall as the page down to
       its foot margin in whole units (the page is not), so the
       relationship at its foot stands on the same line on every card. */
    .keep-app--book .keep-app__main > .keep-contact__summary {
      align-items: center;
      block-size: round(down, calc(var(--keep-book-page-height) / var(--keep-book-zoom) - var(--keep-baseline) * 11), var(--keep-baseline));
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      inset-inline-start: calc(var(--keep-book-cover) + var(--keep-book-margin-outer) * var(--keep-book-zoom));
      padding-top: calc(var(--keep-baseline) * 7);
      text-align: center;
    }

    /* The running head's right: the card's facts on the title's
       baseline, flush right on the measure, leaving the title six rems
       (its width and two units). */
    .keep-app--book .keep-contact__actions {
      justify-content: center;
    }

    .keep-app--book .keep-app__main > .keep-contact__meta {
      block-size: calc(var(--keep-baseline) * 3);
      flex-wrap: nowrap;
      justify-content: flex-end;
      inline-size: var(--keep-book-measure);
      inset-inline-start: calc(var(--keep-book-cover) + var(--keep-book-margin-outer) * var(--keep-book-zoom));
      padding: 7.5px 0 0.5px 6rem;
      position: absolute;
      top: calc(var(--keep-book-cover-y) + var(--keep-baseline) * 2 * var(--keep-book-zoom));
      box-sizing: border-box;
    }

    .keep-app--book .keep-app__main > .keep-contact__fields {
      block-size: calc(var(--keep-book-page-height) / var(--keep-book-zoom) - var(--keep-baseline) * 13);
      inset-inline-start: calc(var(--keep-book-cover) + (var(--keep-book-ref-page) + var(--keep-book-spine) + var(--keep-book-margin)) * var(--keep-book-zoom));
      overflow: hidden;
    }
  }
}

/* The bookstore strip's feathered edges, as lengths a scroll can animate. */
@property --keep-gallery-fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --keep-gallery-fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

/* The wordmark over a page of the plain shell (the bookstore), as the
   book's desk has it: the lockup's letters without its mark, centered on
   the page column, a link to Home, in a five-unit box so the title stays
   on the grid. */
@layer keep.components {
  .keep-page__brand {
    block-size: calc(var(--keep-baseline) * 5);
    display: block;
    inline-size: fit-content;
    margin-inline: auto;
  }

  .keep-page__brand::before {
    display: none;
  }

  /* The step is set from the top down, not centered: its top 23 units
     (184px) from the top of the window, under the wordmark, whatever its
     length; eight units clear below it. */
  .keep-onboarding__step {
    margin-block: 0;
    padding-block: calc(var(--keep-baseline) * 15) calc(var(--keep-baseline) * 8);
  }

  /* A step with more to fit above its buttons starts six units higher. */
  .keep-onboarding__step.keep-onboarding__step--raised {
    padding-block-start: calc(var(--keep-baseline) * 9);
  }

  /* The step's title: 29px, Regular, tracked -2.5%, on four-unit lines.
     12px above sets its baselines on the guide; 28.5px below (two units
     more than the pair needs) leaves the text that follows, which takes no
     top padding after a title, on its own baselines. */
  .keep-onboarding__step .keep-intro__title {
    font-size: 1.8125rem;
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: calc(var(--keep-baseline) * 4);
    padding: 12px 0 28.5px;
  }

  /* A short line over the title or the recording (the eyebrow, "Step 1
     of 2"): 14px Regular in the soft ink, in sentence case, a label
     rather than a stamp. */
  .keep-onboarding__eyebrow {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: calc(var(--keep-baseline) * 2);
    margin-block-end: 5.5px;
    padding-block-start: 2.5px;
    text-transform: none;
  }

  /* A centered step (OnboardingPage's `centered`): the eyebrow starts
     seven units above the step's top, its baseline on the guide at 80px,
     the title under it; every line centered in the column, each block too,
     its lines balanced so none is left short. */
  .keep-onboarding__step--centered .keep-onboarding__eyebrow {
    margin-block-start: calc(var(--keep-baseline) * -7);
  }

  /* With no eyebrow, the title starts where it would under one: four
     units above the step's top. */
  .keep-onboarding__step--centered > .keep-intro__title:first-child {
    margin-block-start: calc(var(--keep-baseline) * -4);
  }

  .keep-onboarding__step--centered {
    text-align: center;
    text-wrap: balance;
  }

  .keep-onboarding__step--centered :is(.keep-intro__title, .keep-intro__text, .keep-onboarding__steps) {
    margin-inline: auto;
  }

  /* What a centered step asks is on three-unit lines, 2px up, so a second
     line keeps to the guide too. */
  .keep-onboarding__step.keep-onboarding__step--centered .keep-intro__text {
    line-height: calc(var(--keep-baseline) * 3);
    margin-block-start: -2px;
  }

  /* There, what it asks is a caption under the recording: 12px on
     two-unit lines, a unit below it (its margin takes the recording's
     three units back to one), 3.5px down to sit on the guide. A line
     break in its words is kept. */
  .keep-onboarding__step:has(.keep-onboarding__video:not(.keep-onboarding__video--image)) .keep-intro__text {
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 2);
    margin-block-start: calc(var(--keep-baseline) * -2);
    padding-block-start: 3.5px;
    white-space: pre-line;
  }

  /* The title a size down, for a step with more to show under it: 24px on
     the same four-unit lines, 2.5px lower than the full size to stay on
     the guide, and two units closer to what follows. */
  .keep-onboarding__step .keep-onboarding__title--small {
    font-size: 1.5rem;
    padding-block: 14.5px 10px;
  }

  /* A recording under a step's title: the column's width, 24 units
     (192px) tall, the recording cropped to fill it, a unit under the title
     (taking back the half pixel the title's padding leaves) and three units
     above what the step asks. */
  .keep-onboarding__video {
    background: color-mix(in srgb, var(--keep-color-ink) 5%, transparent);
    block-size: calc(var(--keep-baseline) * 24);
    border-radius: 14px;
    margin: calc(var(--keep-baseline) - 0.5px) 0 calc(var(--keep-baseline) * 3);
    max-width: 36rem;
    overflow: hidden;
  }

  /* Under the smaller title, the recording starts two units lower, level
     with a still under the full-size one. */
  .keep-onboarding__title--small + .keep-onboarding__video {
    margin-block-start: calc(var(--keep-baseline) * 3 - 0.5px);
  }

  .keep-onboarding__video :is(video, img) {
    block-size: 100%;
    display: block;
    inline-size: 100%;
    object-fit: cover;
  }

  /* Under a still or a step's fields, what the step asks is its pitch:
     16px in the ink on three-unit lines, half a pixel up to sit on the
     guide. Under a still, moved down by whole units to sit midway between
     the still and the buttons, then lifted two units (baseline-snap.js). */
  .keep-onboarding__step .keep-intro__text.keep-onboarding__pitch {
    color: var(--keep-color-ink);
    font-size: 1rem;
    margin-block-start: -2.5px;
    padding-block-start: 0;
    position: relative;
    --keep-snap-lift: 2;
  }

  /* Under a step's fields, the pitch stays close: three units down, less
     the half pixel and the 2px that seat its lines on the guide. */
  .keep-onboarding__step .keep-onboarding__form + .keep-onboarding__pitch {
    margin-block-start: calc(var(--keep-baseline) * 3 - 2.5px);
  }

  /* A still is the step's centerpiece: twelve units taller than a
     recording. */
  .keep-onboarding__video.keep-onboarding__video--image {
    block-size: calc(var(--keep-baseline) * 36);
  }

  .keep-onboarding__video-placeholder {
    align-items: center;
    block-size: 100%;
    color: var(--keep-color-text-soft);
    display: flex;
    font-size: 0.875rem;
    justify-content: center;
  }

  /* A step's instructions, numbered, under its title: 16px on three-unit
     lines, every one on the guide (3.5px up: the half pixel the title's
     padding leaves, and where 16px sits in a 24px line). */
  /* After what the step asks (snapped to the guide), the instructions sit
     four units below, 3px up where 16px sits in a 24px line. */
  .keep-intro__text + .keep-onboarding__steps {
    margin-block-start: calc(var(--keep-baseline) * 4 - 3px);
  }

  .keep-onboarding__steps {
    color: var(--keep-color-text-soft);
    font-size: 1rem;
    line-height: calc(var(--keep-baseline) * 3);
    list-style: none;
    margin: calc(var(--keep-baseline) * -1 - 3.5px) 0 0;
    max-width: 36rem;
    padding-block-start: 0.5px;
    padding-inline-start: 0;
  }

  /* Each instruction that follows the recording (onboarding-steps.js) can
     be chosen; the one playing is in the ink. Three short instructions need
     no numbers (the list keeps its order for assistive tech): two units
     apart, the on-screen labels in Medium, the one playing wholly in the
     ink and the rest wholly in the soft ink, so someone back from another
     app finds their place at a glance. */
  .keep-onboarding__steps li + li {
    margin-block-start: calc(var(--keep-baseline) * 2);
  }

  .keep-onboarding__steps li[role="button"] {
    cursor: pointer;
    transition: color 160ms ease-out;
  }

  .keep-onboarding__steps li[aria-current] {
    color: var(--keep-color-ink);
  }

  .keep-onboarding__steps strong {
    font-weight: 500;
  }

  /* Before the script marks one (or without it), every instruction is in
     the ink. */
  .keep-onboarding__steps:not(:has([aria-current])) {
    color: var(--keep-color-ink);
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-onboarding__steps li[role="button"] {
      transition: none;
    }
  }

  /* Where things stand, under the instructions (the device step waiting
     for its first sync): 16px in the ink, Medium, four units below the
     last instruction, led by a Signal mark that breathes while Keep
     waits. */
  .keep-onboarding__status {
    align-items: center;
    color: var(--keep-color-ink);
    display: flex;
    font-size: 1rem;
    font-weight: 500;
    gap: calc(var(--keep-baseline) * 1.5);
    justify-content: center;
    line-height: calc(var(--keep-baseline) * 3);
    margin: calc(var(--keep-baseline) * 4) 0 0;
    max-width: 36rem;
  }

  .keep-onboarding__status-mark {
    animation: keep-status-breathe 1.6s ease-in-out infinite;
    background: var(--keep-color-signal-green);
    block-size: 8px;
    border-radius: 50%;
    flex: none;
    inline-size: 8px;
  }

  /* Under the status, the download's clock: 14px in the soft ink on
     the guide, two and a half units, centered. */
  .keep-onboarding__status-note {
    color: var(--keep-color-text-soft);
    font-size: 0.875rem;
    line-height: calc(var(--keep-baseline) * 2.5);
    margin: 0;
    max-width: 36rem;
    text-align: center;
  }

  @keyframes keep-status-breathe {
    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: 0.35;
      transform: scale(0.75);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-onboarding__status-mark {
      animation: none;
    }
  }

  /* What the step asks: 14px in the soft ink on 20px lines (two and a
     half units, so its first line and every other one fall on the guide),
     set by the title's padding; baseline-snap.js ends it on the guide
     whatever its number of lines. */
  .keep-onboarding__step .keep-intro__text {
    color: var(--keep-color-text-soft);
    font-size: 0.875rem;
    line-height: calc(var(--keep-baseline) * 2.5);
    padding-block-end: 0;
  }

  /* A step's suggestions, a unit under what it asks, as rows with
     hairlines between. */
  .keep-onboarding__suggestions {
    list-style: none;
    margin: var(--keep-baseline) 0 0;
    max-width: 36rem;
    padding: 0;
  }

  /* SuggestionRow (partials/suggestion-row.leaf.html): a ten-unit row,
     a 40px avatar (the photo, or the initials on the panel's gray),
     the contact's name in Medium over what Keep suggests in the soft ink,
     each one line, and Approve at the end: a four-unit pill in a hairline,
     solid ink once approved. Rows after the first draw a hairline at their
     top, taking no room. */
  .keep-suggestion-row {
    align-items: center;
    box-sizing: border-box;
    text-align: start;
    column-gap: var(--keep-space-3);
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-block-size: calc(var(--keep-baseline) * 10);
  }

  .keep-suggestion-row + .keep-suggestion-row {
    box-shadow: inset 0 1px color-mix(in srgb, var(--keep-color-ink) 8%, transparent);
  }

  .keep-suggestion-row__avatar {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-ink) 6%, transparent);
    block-size: 40px;
    border-radius: 50%;
    color: var(--keep-color-text-soft);
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 500;
    inline-size: 40px;
    justify-content: center;
    overflow: hidden;
  }

  .keep-suggestion-row__avatar img {
    block-size: 100%;
    inline-size: 100%;
    object-fit: cover;
  }

  /* Inside the row the guide gives way to the eye: the avatar, the name
     over the description, and Approve each center in the row, which keeps
     its ten units so the page is back on the guide after it. */
  .keep-suggestion-row__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-inline-size: 0;
  }

  .keep-suggestion-row__name {
    color: var(--keep-color-ink);
    font-weight: 500;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-suggestion-row__description {
    color: var(--keep-color-text-soft);
    font-size: 0.875rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .keep-suggestion-row__approve {
    appearance: none;
    background: transparent;
    block-size: calc(var(--keep-baseline) * 4);
    border: 1px solid color-mix(in srgb, var(--keep-color-ink) 16%, transparent);
    border-radius: 999px;
    color: var(--keep-color-ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    min-inline-size: calc(var(--keep-baseline) * 12);
    padding: 0 var(--keep-space-3);
  }

  .keep-suggestion-row__approve:hover {
    border-color: color-mix(in srgb, var(--keep-color-ink) 32%, transparent);
  }

  .keep-suggestion-row__approve[aria-pressed="true"] {
    background: var(--keep-color-ink);
    border-color: var(--keep-color-ink);
    color: var(--keep-color-white);
  }

  /* "Is this you?" on the handle step (WEB-28): the field label's line
     over one SuggestionRow, the card Keep thinks is the member's, with
     That's me in Approve's place (You, in ink, once pressed). It stands
     with the fields, two units under the last; hidden until a card fits. */
  .keep-onboarding__me {
    margin: 0;
  }

  .keep-onboarding__me .keep-onboarding__label {
    margin: 0;
  }

  .keep-onboarding__suggestions--me {
    margin-block-start: 0;
    max-width: none;
  }

  .keep-onboarding__suggestions--me .keep-suggestion-row {
    min-block-size: calc(var(--keep-baseline) * 8);
  }

  /* The field a step asks for, three units under what it asks: full
     width, six units tall, 16px (iOS zooms into anything smaller), a 12px
     corner and a hairline that firms to ink on focus. Its box sits on the
     guide. */
  .keep-onboarding__form {
    display: flex;
    flex-direction: column;
    gap: var(--keep-baseline);
    margin-block-start: calc(var(--keep-baseline) * 3);
    max-width: 36rem;
  }

  /* With no text between, the field follows the title two units down. The
     title's bottom is half a pixel off the guide (its padding sets the
     text's baselines); the field takes the half pixel back. */
  .keep-onboarding__step .keep-intro__title + .keep-onboarding__form {
    margin-block-start: calc(var(--keep-baseline) * 2 - 0.5px);
  }

  /* Under the smaller title, a unit more: level with a recording there. */
  .keep-onboarding__step .keep-onboarding__title--small + .keep-onboarding__form {
    margin-block-start: calc(var(--keep-baseline) * 3 - 0.5px);
  }

  /* A text field's label over its line: 12px soft on two-unit lines,
     nudged onto the guide. Fields stand two units apart. */
  .keep-onboarding__form:has(.keep-onboarding__field) {
    gap: calc(var(--keep-baseline) * 2);
  }

  .keep-onboarding__label {
    color: var(--keep-color-text-soft);
    display: block;
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 2);
    position: relative;
    top: 3.5px;
  }

  /* A text field: 20px type over a hairline, six units tall, no box; the
     hairline goes ink on focus, and doubles for the keyboard. */
  .keep-onboarding__input {
    appearance: none;
    background: transparent;
    block-size: calc(var(--keep-baseline) * 6);
    border: 0;
    border-block-end: 1px solid color-mix(in srgb, var(--keep-color-ink) 24%, transparent);
    border-radius: 0;
    box-sizing: border-box;
    color: var(--keep-color-ink);
    display: block;
    font: inherit;
    font-size: 1.25rem;
    inline-size: 100%;
    padding: 0;
  }

  /* A file field: a 24-unit area (a recording's height) the column's
     width, the panel's gray with a dashed hairline and a 12px corner, what
     to pick centered in
     Medium ink with a soft hint under it; the whole area opens the picker.
     Once a file is picked (file-name.js) its name takes the first line and
     the hairline goes solid. Both lines are nudged onto the guide. */
  .keep-onboarding__file {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-ink) 4%, transparent);
    block-size: calc(var(--keep-baseline) * 24);
    border: 1px dashed color-mix(in srgb, var(--keep-color-ink) 24%, transparent);
    border-radius: var(--keep-radius-md);
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .keep-onboarding__file:hover {
    background: color-mix(in srgb, var(--keep-color-ink) 7%, transparent);
  }

  .keep-onboarding__file:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--keep-color-focus) 35%, transparent);
  }

  .keep-onboarding__file[data-keep-file-picked],
  .keep-onboarding__file[data-keep-upload-state="importing"],
  .keep-onboarding__file[data-keep-upload-state="done"],
  .keep-onboarding__file[data-keep-upload-state="partial"] {
    border-style: solid;
  }

  /* Importing as soon as a file is picked (vcard-upload.js): a bar along
     the field's foot fills with the import and goes once it is done; a
     file that isn't a .vcf turns the hairline to the danger ink. */
  .keep-onboarding__file[data-keep-upload] {
    overflow: hidden;
    position: relative;
  }

  .keep-onboarding__file-progress {
    background: var(--keep-color-ink);
    block-size: 2px;
    inset: auto 0 0;
    position: absolute;
    transform: scaleX(var(--keep-upload-progress, 0));
    transform-origin: left;
    transition: transform 120ms linear;
  }

  .keep-onboarding__file:not([data-keep-upload-state="importing"]) .keep-onboarding__file-progress {
    display: none;
  }

  /* Done, the field is a record of what came in, not a control. */
  .keep-onboarding__file:has(input:disabled) {
    cursor: default;
  }

  .keep-onboarding__file:has(input:disabled):hover {
    background: color-mix(in srgb, var(--keep-color-ink) 4%, transparent);
  }

  .keep-onboarding__file[data-keep-upload-state="error"] {
    border-color: var(--keep-color-danger);
  }

  .keep-onboarding__file[data-keep-upload-state="error"] .keep-onboarding__file-name {
    color: var(--keep-color-danger);
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-onboarding__file-progress {
      transition: none;
    }
  }

  /* A file with an arrow over what to pick: 24px in the ink, its box on the
     guide a unit above it; the two lines under it stay on the guide. */
  .keep-onboarding__file-icon {
    block-size: calc(var(--keep-baseline) * 3);
    color: var(--keep-color-ink);
    inline-size: calc(var(--keep-baseline) * 3);
    margin-block-end: var(--keep-baseline);
    position: relative;
    top: -2px;
  }

  .keep-onboarding__file-name {
    color: var(--keep-color-ink);
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 3);
    max-inline-size: 100%;
    overflow: hidden;
    padding-inline: var(--keep-space-4);
    position: relative;
    text-overflow: ellipsis;
    top: -4.5px;
    white-space: nowrap;
  }

  .keep-onboarding__file-hint {
    color: var(--keep-color-text-soft);
    font-size: 0.875rem;
    line-height: calc(var(--keep-baseline) * 2.5);
    position: relative;
    top: -1.5px;
  }

  .keep-onboarding__input::placeholder {
    color: var(--keep-color-text-soft);
  }

  .keep-onboarding__input:focus {
    border-color: var(--keep-color-ink);
    outline: none;
  }

  .keep-onboarding__input:focus-visible {
    box-shadow: 0 1px 0 var(--keep-color-ink);
  }

  /* A date field reads like the others: its date at the start of the
     line, not centered as iOS sets it. */
  .keep-onboarding__input[type="date"] {
    text-align: start;
  }

  .keep-onboarding__input[type="date"]::-webkit-date-and-time-value {
    text-align: start;
  }

  /* The quiet line under a handle field (handle-check.js): whether what is
     typed is free, 12px soft on two-unit lines like the label; it holds
     its place empty, so the page doesn't shift as answers come. */
  .keep-onboarding__field-note {
    color: var(--keep-color-text-soft);
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 2);
    margin: 0;
    min-block-size: calc(var(--keep-baseline) * 2);
  }

  /* A code field: one-digit boxes in a row filling the column, a unit
     apart, each the text field's height with its digit centered. */
  .keep-onboarding__code {
    border: 0;
    display: grid;
    gap: var(--keep-baseline);
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    margin: 0;
    min-inline-size: 0;
    padding: 0;
  }

  .keep-onboarding__digit {
    font-size: 1.25rem;
    padding: 0;
    text-align: center;
  }

  .keep-onboarding__emphasis a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
  }

  /* A line set apart below what the step asks: the same 14px on 20px
     lines in the soft ink, in Medium, two units below, half a pixel down
     to sit on the guide; ended on the guide by baseline-snap.js. */
  .keep-onboarding__emphasis {
    color: var(--keep-color-text-soft);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: calc(var(--keep-baseline) * 2.5);
    margin-block-start: calc(var(--keep-baseline) * 2);
    max-width: 36rem;
    padding-block-start: 0.5px;
  }

  /* InternalLinkSummary (`keep-internal-link-summary`, in a
     `keep-link-summaries` list): a Light cream card that is itself the
     link to a page on this site, two units of padding on each side with
     the medium corner, its title a header, 18px Medium in the ink on a
     three-unit line; then a bullet list of what the page now says, 14px
     on three-unit lines, in the ink, every line on the guide; and a footer line (the version and the
     effective date) in Medium, in the ink at 50%; and a right caret (Tabler chevron-right, 20px
     in the soft ink) at the end of the title's line,
     centered on it. Nothing underlined; the card deepens a notch on
     hover. Cards are one
     unit apart; the list starts three units under what comes before it. */
  .keep-link-summaries {
    display: flex;
    flex-direction: column;
    gap: var(--keep-baseline);
    list-style: none;
    margin: calc(var(--keep-baseline) * 3) 0 0;
    max-width: 36rem;
    padding: 0;
  }

  .keep-internal-link-summary {
    background: var(--keep-color-light-cream);
    border-radius: var(--keep-radius-md);
    color: inherit;
    display: block;
    padding: calc(var(--keep-baseline) * 2) calc(var(--keep-baseline) * 2) var(--keep-baseline);
    text-decoration: none;
    transition: background-color var(--keep-transition-fast);
  }

  /* On hover, a notch deeper cream: halfway to Ivory. */
  .keep-internal-link-summary:hover {
    background: color-mix(in srgb, var(--keep-color-ivory) 50%, var(--keep-color-light-cream));
  }

  .keep-internal-link-summary:focus-visible {
    outline: 2px solid var(--keep-color-focus);
    outline-offset: 2px;
  }

  .keep-internal-link-summary__head {
    align-items: center;
    column-gap: var(--keep-space-2);
    display: flex;
    /* The icon's stroke sits inside its box; 4px to the left lines it up
       with the bullets and the footer below. */
    margin-inline-start: -4px;
    /* 18px on a three-unit line sits 3.3px low (half the leading plus the
       1.045em ascender); lifted by that, its layout untouched, the title's
       baseline is on the guide. */
    inset-block-start: -3.3px;
    position: relative;
  }

  /* A document icon (Tabler file-text, 20px in the ink) leads the title. */
  .keep-internal-link-summary__icon {
    block-size: 20px;
    color: var(--keep-color-ink);
    flex: none;
    inline-size: 20px;
  }

  .keep-internal-link-summary__title {
    color: var(--keep-color-ink);
    display: block;
    flex: 1 1 auto;
    min-inline-size: 0;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 3);
  }

  .keep-internal-link-summary__caret {
    block-size: 20px;
    color: var(--keep-color-text-soft);
    flex: none;
    inline-size: 20px;
  }

  /* 14px on three-unit lines, so a wrapped line stays on the guide; the
     face sets it 1.7px low, lifted by that. */
  .keep-internal-link-summary__detail {
    color: color-mix(in srgb, var(--keep-color-ink) 50%, transparent);
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    inset-block-start: -1.7px;
    line-height: calc(var(--keep-baseline) * 3);
    margin-block-start: var(--keep-baseline);
    position: relative;
  }

  .keep-internal-link-summary__items {
    color: var(--keep-color-ink);
    font-size: 0.875rem;
    inset-block-start: -1.7px;
    line-height: calc(var(--keep-baseline) * 3);
    list-style: disc;
    margin: var(--keep-baseline) 0 0 3px;
    padding-inline-start: 1.25em;
    position: relative;
  }

  /* OnboardingButtonGroup (partials/onboarding-buttons.leaf.html): a
     step's choices, pinned near the bottom of the screen, two units up,
     stacked full width in the page's gutters, one unit apart. Each is a
     six-unit link, 16px Medium centered, a 12px corner: the main choice
     solid ink, the others the panel's gray. A step with a group keeps its
     text clear of it. */
  .keep-onboarding-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--keep-baseline);
    inset-block-end: calc(var(--keep-baseline) * 2 + env(safe-area-inset-bottom, 0px));
    /* Pinned to the bottom of a viewport that is not a whole number of
       units tall, the group would fall between guide lines; lifted by the
       remainder, its buttons' edges sit on them. A browser without round()
       leaves it at most 7px off. */
    transform: translateY(calc(round(down, 100dvh, var(--keep-baseline)) - 100dvh));
    inset-inline: 0;
    margin-inline: auto;
    max-inline-size: calc(var(--keep-content-wide) - 2 * var(--keep-page-gutter));
    padding-inline: var(--keep-page-gutter);
    position: fixed;
    /* Over the page: positioned things later in the page (the footer's
       chip and links) would otherwise paint over the group. */
    z-index: 1;
  }

  .keep-onboarding-buttons__choices {
    display: flex;
    flex-direction: column;
    gap: var(--keep-baseline);
  }

  /* Side by side (Back and Next): the buttons share one row, a unit
     apart, equally wide. */
  .keep-onboarding-buttons__choices--side-by-side {
    flex-direction: row;
  }

  .keep-onboarding-buttons__choices--side-by-side .keep-onboarding-buttons__button {
    flex: 1 1 0;
  }

  /* A choice not available yet (Next before the import is done): faded,
     and it takes no clicks. */
  .keep-onboarding-buttons__button[aria-disabled="true"] {
    cursor: default;
    opacity: 0.3;
  }

  /* The group's fine print, under the buttons (what submitting agrees
     to): 12px Regular in the soft ink, centered, on two-unit lines, a unit
     below the buttons. The group is set from the bottom, so baseline-snap.js
     rounds the fine print's height to whole units, keeping the buttons on
     the guide whatever its length. Its text sits at the box's bottom, so
     its last baseline (and every other one above) is on the guide however
     many lines it runs to. A line break in its words is kept. */
  /* While the on-screen keyboard is open (keyboard-dock.js), the group,
     fine print and all, sits in the page three units under the step's
     fields and scrolls with them, rather than pinned where the keyboard
     and the bars Safari floats over it would meet it. */
  body .keep-onboarding-buttons[data-keep-keyboard] {
    inset: auto;
    margin-block-start: calc(var(--keep-baseline) * 3);
    max-inline-size: none;
    padding-inline: 0;
    position: relative;
    transform: none;
  }

  /* With fine print, a unit more above it, taken from below the group:
     the buttons stay put and the fine print moves down into the space
     over Safari's bar. */
  .keep-onboarding-buttons:has(.keep-onboarding-buttons__fine-print) {
    gap: calc(var(--keep-baseline) * 2);
    inset-block-end: var(--keep-baseline);
  }

  /* Its words are one run (a span), so the column holds one line box set
     to the bottom of the snapped height. */
  .keep-onboarding-buttons__fine-print {
    color: var(--keep-color-text-soft);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: calc(var(--keep-baseline) * 2);
    text-align: center;
    text-wrap: balance;
    white-space: pre-line;
  }

  /* 12px on two-unit lines: the face puts the baseline 12.9px below each
     line's top, 3.1px above the box's bottom edge, which is on the guide;
     the run is set down by that, its layout untouched, so every baseline
     lands on a line. */
  .keep-onboarding-buttons__fine-print > span {
    inset-block-start: 3.1px;
    position: relative;
  }

  /* Its links (the policies it names) in its own soft ink, underlined. */
  .keep-onboarding-buttons__fine-print a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
  }

  .keep-onboarding-buttons__button {
    align-items: center;
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    background: color-mix(in srgb, var(--keep-color-ink) 6%, transparent);
    border-radius: var(--keep-radius-md);
    color: var(--keep-color-ink);
    display: flex;
    font-weight: 500;
    justify-content: center;
    min-block-size: calc(var(--keep-baseline) * 6);
    text-decoration: none;
  }

  .keep-onboarding-buttons__button:hover {
    background: color-mix(in srgb, var(--keep-color-ink) 10%, transparent);
  }

  .keep-onboarding-buttons__button--primary,
  .keep-onboarding-buttons__button--primary:hover {
    background: var(--keep-color-ink);
    color: var(--keep-color-white);
  }

  /* A step with a button group keeps its text clear of it, and no more:
     the group's height and its place above the window's foot (ten units;
     fourteen with fine print), so a step that fits never scrolls. */
  .keep-onboarding__step:has(.keep-onboarding-buttons) {
    padding-block-end: calc(var(--keep-baseline) * 10);
  }

  /* As tall as the window as shown, not as tall as it gets once Safari's
     bars collapse (100vh on iOS), so a step does not scroll. */
  body.keep-onboarding {
    min-height: 100dvh;
  }

  /* With the footer pinned to the bottom, rounded down to the grid so the
     footer lands on it (as body:has(> .keep-public-footer) does for other
     pages). */
  body.keep-onboarding:has(> .keep-public-footer) {
    min-height: round(down, 100dvh, var(--keep-baseline));
  }

  /* And it does not stretch and spring back when dragged: a step is a
     screen, not a page. */
  html:has(body.keep-onboarding) {
    overscroll-behavior: none;
  }

  .keep-onboarding__step:has(.keep-onboarding-buttons__fine-print) {
    padding-block-end: calc(var(--keep-baseline) * 14);
  }

  /* Over an onboarding step (onboarding.leaf.html): the wordmark stands
     apart at the top, centered, two units down. The browser's viewport
     already starts below a phone's status bar. */
  .keep-onboarding__brand {
    inset-block-start: calc(var(--keep-baseline) * 2 + env(safe-area-inset-top, 0px));
    inset-inline-start: 50%;
    position: absolute;
    transform: translateX(-50%);
  }

  /* How far along onboarding the step is: a hairline under the wordmark,
     the wordmark's width, its track a faint ink and its fill Signal green,
     never counted out in steps. onboarding-progress.js grows the fill
     from the last step's. */
  .keep-onboarding__progress {
    background: color-mix(in srgb, var(--keep-color-ink) 10%, transparent);
    block-size: 2px;
    border-radius: 1px;
    inline-size: calc(var(--keep-baseline) * 6);
    inset-block-start: calc(var(--keep-baseline) * 7);
    inset-inline-start: 50%;
    overflow: hidden;
    position: absolute;
    transform: translateX(-50%);
  }

  .keep-onboarding__progress::after {
    background: var(--keep-color-signal-green);
    content: "";
    inset: 0;
    position: absolute;
    transform: scaleX(var(--keep-progress, 0));
    transform-origin: left;
  }

  .keep-onboarding__progress--growing::after {
    transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms;
  }
}

/* Segments: a row of views of one page, as separate rounded tabs, each
   a link to its view (`aria-current="page"` on the one shown), so they
   work without a script and every view has an address. Four units tall,
   the words 12px in the body ink, two units of fill each side, a unit
   between. The fills are the ink over the ground, so they turn with the
   mode and the theme: the others flat at 5%, the current one raised at
   10% with a hairline edge and a faint top light. First used for the
   bookstore's shelves (October 26, 2026). */
@layer keep.components {
  .keep-segments {
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-baseline);
    margin: 0;
  }

  .keep-segments__segment {
    align-items: center;
    background: color-mix(in srgb, var(--keep-color-ink) 5%, var(--keep-color-white));
    block-size: calc(var(--keep-baseline) * 4);
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--keep-color-ink);
    display: inline-flex;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0 calc(var(--keep-baseline) * 2);
    text-decoration: none;
    transition: background-color 120ms ease, box-shadow 120ms ease;
    white-space: nowrap;
  }

  .keep-segments__segment:hover {
    background: color-mix(in srgb, var(--keep-color-ink) 8%, var(--keep-color-white));
  }

  .keep-segments__segment[aria-current="page"] {
    background: color-mix(in srgb, var(--keep-color-ink) 10%, var(--keep-color-white));
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--keep-color-ink) 12%, transparent),
      inset 0 1px 0 color-mix(in srgb, var(--keep-color-ink) 6%, transparent);
  }

  .keep-segments__segment:focus-visible {
    outline: 2px solid var(--keep-color-focus);
    outline-offset: 2px;
  }

  /* On the bookstore's shelf: six units over the themes. */
  .keep-segments + .keep-products,
  .keep-segments + .keep-themes__empty {
    margin-top: calc(var(--keep-baseline) * 6);
  }
}

/* The bookstore (`/bookstore`, `pages/bookstore.leaf.html`): the
   book's themes as products (`partials/bookstore-theme`), one to a row. A product is a gallery, then its name and price
   on one line, its note, a few sentences of description, and Buy. The
   gallery is a strip of tiles that scrolls sideways: the book closed and
   open in the edition of the page's own mode (light, dark, or as the
   device is set), the books standing on the page's own desk, as they
   are always seen. The closed book
   (`partials/book-closed`) is the board in the cover color with a
   shaded spine and the two tabs,
   with no type on it for now; the open one is the miniature spread
   (`partials/book-preview`). Both are drawn in the slide's tokens, which
   the tile carries in its style attribute, and sized in units of their
   own width (cqw). */
@layer keep.components {
  /* One product to a row, so each strip runs the column's whole width. */
  .keep-products {
    display: grid;
    gap: calc(var(--keep-baseline) * 7);
    grid-template-columns: minmax(0, 1fr);
    list-style: none;
    margin: calc(var(--keep-baseline) * 2) 0 0;
    padding: 0;
  }

  .keep-product {
    display: flex;
    flex-direction: column;
  }

  /* The gallery: every view at once, a strip of tiles that scrolls
     sideways where they run past the card, snapping to a tile's edge.
     The tiles are one height, 24 units; a closed book's is a portrait
     4 by 5, an open spread's a landscape 3 by 2, so the strip reads as a
     row of photographs of one object. The bar is hidden: the tile cut by
     the card's edge says there is more. */
  /* Edge to edge in the page's column: the strip takes the column's
     gutters back and pads by them, so its first book's edge stands on
     the text's at rest and the books run to the column's edges as they
     scroll. Each edge feathers to the desk over two gutters where there is more
     to scroll to, on a smooth S-curve (eight stops: the opacity leaves
     nothing and reaches full slowly), since a straight ramp from a bright
     tile to a dark desk shows a line where it reaches full. The fade
     widths (--keep-gallery-fade-start, -end, registered lengths) follow
     the strip's own scroll, nothing timed: the start's comes in over the
     first two gutters scrolled and the end's goes out over the last, so
     the end the strip rests at is crisp. Without scroll-driven
     animations the start is crisp and the end feathers. */
  .keep-gallery {
    --keep-gallery-fade: calc(var(--keep-app-gutter) * 2);
    --keep-gallery-fade-start: 0px;
    --keep-gallery-fade-end: var(--keep-gallery-fade);
    --keep-gallery-mask: linear-gradient(
      to right,
      transparent 0,
      rgb(0 0 0 / 0.03) calc(var(--keep-gallery-fade-start) * 0.15),
      rgb(0 0 0 / 0.11) calc(var(--keep-gallery-fade-start) * 0.3),
      rgb(0 0 0 / 0.28) calc(var(--keep-gallery-fade-start) * 0.45),
      rgb(0 0 0 / 0.52) calc(var(--keep-gallery-fade-start) * 0.6),
      rgb(0 0 0 / 0.76) calc(var(--keep-gallery-fade-start) * 0.75),
      rgb(0 0 0 / 0.93) calc(var(--keep-gallery-fade-start) * 0.9),
      black var(--keep-gallery-fade-start),
      black calc(100% - var(--keep-gallery-fade-end)),
      rgb(0 0 0 / 0.93) calc(100% - var(--keep-gallery-fade-end) * 0.9),
      rgb(0 0 0 / 0.76) calc(100% - var(--keep-gallery-fade-end) * 0.75),
      rgb(0 0 0 / 0.52) calc(100% - var(--keep-gallery-fade-end) * 0.6),
      rgb(0 0 0 / 0.28) calc(100% - var(--keep-gallery-fade-end) * 0.45),
      rgb(0 0 0 / 0.11) calc(100% - var(--keep-gallery-fade-end) * 0.3),
      rgb(0 0 0 / 0.03) calc(100% - var(--keep-gallery-fade-end) * 0.15),
      transparent 100%
    );
    display: flex;
    gap: calc(var(--keep-baseline) * 3);
    /* A scroller clips both ways, so the strip reaches four units past
       its tiles top and bottom, room for the books' shadows to fall out
       in full (the light edition's cast shadow runs about 30px below a
       board), and gives the room back in its margins, so nothing around
       it moves. */
    margin-block: calc(var(--keep-baseline) * -4);
    margin-inline: calc(var(--keep-app-gutter) * -1);
    -webkit-mask-image: var(--keep-gallery-mask);
    mask-image: var(--keep-gallery-mask);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-block: calc(var(--keep-baseline) * 4);
    padding-inline: var(--keep-app-gutter);
    scroll-padding-inline: var(--keep-app-gutter);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  @supports (animation-timeline: scroll(self inline)) {
    .keep-gallery {
      animation:
        keep-gallery-fade-start linear both,
        keep-gallery-fade-end linear both;
      animation-range:
        0 var(--keep-gallery-fade),
        calc(100% - var(--keep-gallery-fade)) 100%;
      animation-timeline: scroll(self inline), scroll(self inline);
    }
  }

  @keyframes keep-gallery-fade-start {
    from { --keep-gallery-fade-start: 0px; }
    to { --keep-gallery-fade-start: var(--keep-gallery-fade); }
  }

  @keyframes keep-gallery-fade-end {
    from { --keep-gallery-fade-end: var(--keep-gallery-fade); }
    to { --keep-gallery-fade-end: 0px; }
  }

  .keep-gallery::-webkit-scrollbar {
    display: none;
  }

  .keep-gallery:focus-visible {
    outline: 2px solid var(--keep-color-focus);
    outline-offset: 2px;
  }

  /* A tile: one view of the book, with no backdrop of its own, since the
     book is always seen on the desk (a studio-gray backdrop misled); the
     soft accent made again from the tile's own accent. */
  .keep-gallery__tile {
    --keep-book-accent-soft: color-mix(in srgb, var(--keep-book-accent) 40%, var(--keep-book-page));
    flex: none;
    margin: 0;
    scroll-snap-align: start;
  }

  /* One edition at a time, the page's own: the light tiles in light
     mode, the dark ones in dark, as the device is set for `system`. */
  .keep-gallery__tile--dark {
    display: none;
  }

  :root[data-keep-mode="dark"] .keep-gallery__tile--light {
    display: none;
  }

  :root[data-keep-mode="dark"] .keep-gallery__tile--dark {
    display: block;
  }

  @media (prefers-color-scheme: dark) {
    :root[data-keep-mode="system"] .keep-gallery__tile--light {
      display: none;
    }

    :root[data-keep-mode="system"] .keep-gallery__tile--dark {
      display: block;
    }
  }

  /* A tile is its book's width, 30 units tall with the book centered
     in it, no backdrop: the books stand on the page's own desk. */
  .keep-gallery__frame {
    align-items: center;
    block-size: var(--keep-gallery-height);
    display: flex;
  }

  /* The tiles are 30 units tall (24 until October 26, 2026, a quarter
     larger to the nearest unit). The open spread is the tile's height
     times 1.29 wide, at the book's 1.4217 to 1, so about 218px tall; the
     closed board stands as tall, at a page's 416 by 596, so the two books
     are one height. */
  .keep-gallery {
    --keep-gallery-height: calc(var(--keep-baseline) * 30);
    --keep-gallery-book: calc(var(--keep-gallery-height) * 1.29 / 1.4217);
  }

  .keep-gallery__tile--closed .keep-closed {
    inline-size: calc(var(--keep-gallery-book) * 416 / 596);
  }

  .keep-gallery__open {
    inline-size: calc(var(--keep-gallery-book) * 1.4217);
  }


  /* The closed book: the board a little taller than wide (the page's own
     proportion, 416 by 596), the board alone with no page block past it,
     the spine's shade at the left (a narrow one, about half the
     width it was until October 26, 2026, so the book does not read as
     thick), and the two tabs standing out past
     the fore-edge as the open book's do. The board is bare: the
     debossed wordmark, rule, and name came off on October 26, 2026,
     until a better type treatment is set. */
  /* The light. In the light edition, a hard key light high at the upper
     left, as a fashion shoot's flash: a sheen across the board's top
     corner, a dark contact shadow where the board meets the desk, and a
     crisp cast shadow thrown down and to the right that softens as it
     goes. In the dark edition, a soft light from above: a hairline, then
     four shadows each about twice as far down and as soft as the last,
     none darker than 8%, and no sheen. */
  .keep-closed {
    container-type: inline-size;
    --keep-closed-sheen: linear-gradient(135deg, rgb(255 255 255 / 0.22) 0, rgb(255 255 255 / 0.06) 35%, transparent 60%);
    --keep-closed-shadow:
      0 0 0 0.5px rgb(0 0 0 / 0.08),
      0.25cqw 0.5cqw 0.6cqw rgb(0 0 0 / 0.15),
      1cqw 2cqw 1.6cqw -0.4cqw rgb(0 0 0 / 0.12),
      3cqw 5.5cqw 5cqw -2.5cqw rgb(0 0 0 / 0.1),
      7cqw 12cqw 14cqw -7cqw rgb(0 0 0 / 0.085);
  }

  :root[data-keep-mode="dark"] .keep-closed {
    --keep-closed-sheen: linear-gradient(transparent, transparent);
    --keep-closed-shadow:
      0 0 0 0.5px rgb(0 0 0 / 0.06),
      0 0.3cqw 0.6cqw rgb(0 0 0 / 0.06),
      0 1cqw 2cqw -0.5cqw rgb(0 0 0 / 0.06),
      0 3cqw 6cqw -2cqw rgb(0 0 0 / 0.07),
      0 7cqw 14cqw -5cqw rgb(0 0 0 / 0.08),
      0 14cqw 28cqw -10cqw rgb(0 0 0 / 0.08);
  }

  @media (prefers-color-scheme: dark) {
    :root[data-keep-mode="system"] .keep-closed {
      --keep-closed-sheen: linear-gradient(transparent, transparent);
      --keep-closed-shadow:
        0 0 0 0.5px rgb(0 0 0 / 0.06),
        0 0.3cqw 0.6cqw rgb(0 0 0 / 0.06),
        0 1cqw 2cqw -0.5cqw rgb(0 0 0 / 0.06),
        0 3cqw 6cqw -2cqw rgb(0 0 0 / 0.07),
        0 7cqw 14cqw -5cqw rgb(0 0 0 / 0.08),
        0 14cqw 28cqw -10cqw rgb(0 0 0 / 0.08);
    }
  }

  .keep-closed__book {
    aspect-ratio: 416 / 596;
    position: relative;
  }

  .keep-closed__board {
    background:
      var(--keep-closed-sheen),
      linear-gradient(to right,
        rgb(0 0 0 / 0.12) 0,
        rgb(0 0 0 / 0.03) 2.6cqw,
        rgb(255 255 255 / 0.05) 3.4cqw,
        transparent 6.5cqw),
      var(--keep-book-cover-color);
    border-radius: 1.6cqw 3.2cqw 3.2cqw 1.6cqw;
    box-shadow: var(--keep-closed-shadow);
    inset: 0;
    position: absolute;
    z-index: 1;
  }

  /* The board's fore-edge turning away from the light: a narrow shade
     inside its right edge, and a hairline of light on the very edge. */
  .keep-closed__board::after {
    background: linear-gradient(to right, transparent, rgb(0 0 0 / 0.04) 85%, rgb(255 255 255 / 0.14));
    border-radius: 0 3.2cqw 3.2cqw 0;
    content: "";
    inline-size: 1.6cqw;
    inset-block: 0;
    inset-inline-end: 0;
    position: absolute;
  }

  .keep-closed__spine {
    background: linear-gradient(to right, rgb(0 0 0 / 0.2), transparent);
    inset-block: 0;
    inline-size: 0.9cqw;
    inset-inline-start: 2.7cqw;
    opacity: 0.5;
    position: absolute;
  }

  /* The tabs come out from under the board at the fore-edge, a sliver
     of each showing (2.6cqw, 4px on the bookstore's 152px board, from
     7.7cqw until October 26, 2026): tucked a few points under it, the outer corners
     a little round, lit along the top, and each casting a small shadow. */
  .keep-closed__tab {
    background:
      linear-gradient(to bottom, rgb(255 255 255 / 0.18), transparent 40%, rgb(0 0 0 / 0.1)),
      var(--keep-book-accent);
    block-size: 7.7cqw;
    border-radius: 0 0.6cqw 0.6cqw 0;
    box-shadow: 0.3cqw 0.5cqw 0.8cqw rgb(0 0 0 / 0.16);
    inline-size: 5.6cqw;
    inset-block-start: 20%;
    inset-inline-end: -2.6cqw;
    position: absolute;
  }

  .keep-closed__tab--ink {
    background:
      linear-gradient(to bottom, rgb(255 255 255 / 0.18), transparent 40%, rgb(0 0 0 / 0.1)),
      var(--keep-book-ink);
    inset-block-start: 62%;
  }

  /* Foil (web-ui.md → Foil): a personalization stamped into the board in
     metal leaf, after the liquid-metal look of libraries.dev/metal drawn
     in CSS alone. The letters are a metal's reflection clipped to their
     shapes: bands of highlight, body, shade, and a dark horizon at a
     slant, wider than the letters so the light can travel. Where the
     band stands is `--keep-foil-light-x`, which `foil.js` moves with the
     pointer, as a light moves over a book tilted under it, and the band
     follows with a little lag; with no script, or for a member who
     prefers less motion, it rests at 30%. The stamp is pressed in (the
     impression, below): a dark lip at the letters' upper edge where the
     board falls into it, a light one at the lower edge where the light
     catches its far wall. The element carries its text again in
     `data-text` for the impression. A finish is four stops and how strongly it is pressed;
     blind is the impression with no leaf, the board's own color pressed
     darker. */
  .keep-foil {
    --keep-foil-light: #ffffff;
    --keep-foil-body: #d9dde2;
    --keep-foil-shade: #8d949c;
    --keep-foil-deep: #474c53;
    --keep-foil-reflection: linear-gradient(
      100deg,
      var(--keep-foil-shade) 0%,
      var(--keep-foil-body) 14%,
      var(--keep-foil-light) 22%,
      var(--keep-foil-body) 30%,
      var(--keep-foil-shade) 41%,
      var(--keep-foil-deep) 47%,
      var(--keep-foil-shade) 53%,
      var(--keep-foil-body) 64%,
      var(--keep-foil-light) 72%,
      var(--keep-foil-body) 80%,
      var(--keep-foil-shade) 100%
    );
    --keep-foil-lip: rgb(0 0 0 / 0.34);
    --keep-foil-catch: rgb(255 255 255 / 0.3);
    --keep-foil-recess: rgb(0 0 0 / 0.1);
    background: var(--keep-foil-reflection);
    background-clip: text;
    -webkit-background-clip: text;
    background-position: var(--keep-foil-light-x, 30%) 50%;
    background-size: 260% 100%;
    transition: background-position 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
    color: transparent;
    isolation: isolate;
  }

  /* The impression, under the leaf: the same letters again
     (`data-text`), unpainted, casting only soft shadows, so the lip and
     the catch never shadow each other as chained filters would. A
     hairline lip and catch a fraction of a point out and lightly
     blurred, and a faint wide shade where the board is pressed down
     round the stamp. */
  .keep-foil::before {
    background: none;
    color: transparent;
    content: attr(data-text);
    content: attr(data-text) / "";
    inset: 0;
    pointer-events: none;
    position: absolute;
    text-shadow:
      0 -0.12cqw 0.14cqw var(--keep-foil-lip),
      0 0.1cqw 0.12cqw var(--keep-foil-catch),
      0 0.05cqw 0.7cqw var(--keep-foil-recess);
    z-index: -1;
  }

  @media (prefers-reduced-motion: reduce) {
    .keep-foil {
      transition: none;
    }
  }

  .keep-foil--silver {
    --keep-foil-light: #ffffff;
    --keep-foil-body: #d9dde2;
    --keep-foil-shade: #8d949c;
    --keep-foil-deep: #474c53;
  }

  .keep-foil--gold {
    --keep-foil-light: #fff6d0;
    --keep-foil-body: #e8c46a;
    --keep-foil-shade: #a8792a;
    --keep-foil-deep: #5c3d0e;
  }

  .keep-foil--copper {
    --keep-foil-light: #ffe2cf;
    --keep-foil-body: #e3966b;
    --keep-foil-shade: #a65a34;
    --keep-foil-deep: #552612;
  }

  /* Chromatic: chrome with the thin-film colors of an oil sheen in its
     highlights, as the reference's chromatic preset. */
  .keep-foil--chromatic {
    --keep-foil-reflection: linear-gradient(
      100deg,
      #8d949c 0%,
      #c9e4ff 12%,
      #ffffff 20%,
      #ffd6f0 27%,
      #9aa1a9 40%,
      #3f444b 47%,
      #9aa1a9 53%,
      #fff2c4 63%,
      #ffffff 71%,
      #c4f2e4 79%,
      #8d949c 100%
    );
  }

  /* Blind: the impression alone, the board pressed a shade darker with
     the same lips, and nothing moving. */
  .keep-foil--blind {
    background: none;
    color: color-mix(in srgb, var(--keep-book-cover-color) 88%, black);
    --keep-foil-lip: rgb(0 0 0 / 0.3);
    --keep-foil-catch: rgb(255 255 255 / 0.26);
  }

  /* On the closed book: the personalization set on the board in Regular,
     tracked a little, centered across the board's face (the spine's
     shade left out of the measure), at the foot by default or on the
     board's center line. Sized in the board's own width, so it is the
     same stamp at any size. */
  .keep-closed__foil {
    font-size: 5cqw;
    font-weight: 400;
    inset-block-end: 12%;
    inset-inline: 7cqw 4cqw;
    letter-spacing: 0.045em;
    line-height: 1.2;
    overflow-wrap: anywhere;
    position: absolute;
    text-align: center;
  }

  .keep-closed__foil--center {
    inset-block: 50% auto;
    translate: 0 -50%;
  }

  /* The product's words: the name in Medium a size up with the price
     flush right on its line, the note soft, the description in the body
     ink, then Buy with its fine print beside it. */
  .keep-product__line {
    align-items: baseline;
    display: flex;
    gap: calc(var(--keep-baseline) * 2);
    justify-content: space-between;
    /* A unit under the strip, past the tile's own room under the book
       (it is centered in 30 units). Three units until October 26, 2026. */
    margin-top: var(--keep-baseline);
  }

  .keep-product__name {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
  }

  .keep-product__price {
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    line-height: calc(var(--keep-baseline) * 3);
  }

  .keep-product__note {
    color: var(--keep-color-text-soft);
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 3);
    margin: 0;
  }

  .keep-product__description {
    font-size: 0.75rem;
    line-height: calc(var(--keep-baseline) * 2);
    margin: var(--keep-baseline) 0 0;
    max-inline-size: 30rem;
    padding: 3.5px 0 4.5px;
    text-wrap: pretty;
  }

  .keep-product__buy {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--keep-baseline) calc(var(--keep-baseline) * 2);
    margin-top: calc(var(--keep-baseline) * 2);
  }

  .keep-product__fine {
    color: var(--keep-color-text-soft);
    font-size: 0.6875rem;
  }

  .keep-product .keep-pill[disabled] {
    cursor: default;
    opacity: 1;
  }

  .keep-mini {
    container-type: inline-size;
  }

  .keep-mini__book {
    aspect-ratio: 1.4217;
    background: var(--keep-book-cover-color);
    border-radius: 1.6cqw;
    box-shadow:
      0 0 0 1px rgb(0 0 0 / 0.06),
      0 1px 2px rgb(0 0 0 / 0.08),
      0 6px 10px -6px rgb(0 0 0 / 0.28);
    box-sizing: border-box;
    color: var(--keep-book-ink);
    display: grid;
    grid-template-columns: 1fr 1fr;
    line-height: 1.33;
    padding: 0.35cqw 1.4cqw;
    position: relative;
  }

  .keep-mini__page {
    background: var(--keep-book-page);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
    overflow: hidden;
    padding: 1.9cqw 3.7cqw 3.3cqw;
  }

  .keep-mini__page--verso {
    align-items: center;
    border-radius: 1.2cqw 0 0 1.2cqw;
    box-shadow: inset -1.4cqw 0 1.8cqw -1.6cqw rgb(0 0 0 / 0.2), -0.35cqw 0 0 var(--keep-book-edge);
  }

  .keep-mini__page--recto {
    border-radius: 0 1.2cqw 1.2cqw 0;
    box-shadow: inset 1.4cqw 0 1.8cqw -1.6cqw rgb(0 0 0 / 0.14), 0.35cqw 0 0 var(--keep-book-edge);
  }

  .keep-mini__running {
    align-items: baseline;
    align-self: stretch;
    display: flex;
    gap: 1.9cqw;
    justify-content: space-between;
    line-height: 2.8cqw;
  }

  .keep-mini__title {
    flex: none;
    font-size: 1.64cqw;
    font-weight: 500;
  }

  .keep-mini__count {
    color: var(--keep-book-accent);
    font-weight: 400;
  }

  .keep-mini__meta {
    align-items: center;
    color: var(--keep-book-ink-soft);
    display: flex;
    font-size: 1.29cqw;
    gap: 0.45cqw;
    overflow: hidden;
    white-space: nowrap;
  }

  .keep-mini__meta i,
  .keep-mini__actions i {
    border: 0.15cqw solid currentcolor;
    border-radius: 0.3cqw;
    box-sizing: border-box;
    flex: none;
    block-size: 1.4cqw;
    inline-size: 1.4cqw;
  }

  .keep-mini__meta i {
    margin-inline-start: 0.9cqw;
  }

  .keep-mini__meta i:first-child {
    margin-inline-start: 0;
  }

  .keep-mini__portrait {
    align-items: center;
    aspect-ratio: 1;
    background: color-mix(in srgb, var(--keep-book-ink-soft) 12%, var(--keep-book-page));
    border-radius: 50%;
    color: var(--keep-book-ink-soft);
    display: flex;
    font-size: 2.57cqw;
    font-weight: 500;
    inline-size: 9.35cqw;
    justify-content: center;
    letter-spacing: 0.06em;
    margin-top: 6.5cqw;
  }

  .keep-mini__name {
    font-size: 3.74cqw;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 4.67cqw;
    margin-top: 1.9cqw;
    white-space: nowrap;
  }

  .keep-mini__actions {
    display: flex;
    font-size: 1.4cqw;
    gap: 2.8cqw;
    margin-top: 0.95cqw;
  }

  .keep-mini__actions span {
    align-items: center;
    display: flex;
    gap: 0.47cqw;
  }

  .keep-mini__actions i {
    color: var(--keep-book-accent-soft);
  }

  .keep-mini__relationship {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    font-size: 1.4cqw;
    gap: 0.95cqw;
    margin-top: auto;
  }

  .keep-mini__nicknames {
    font-weight: 500;
  }

  .keep-mini__known {
    display: grid;
    font-size: 1.29cqw;
    gap: 1.9cqw;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.95cqw;
  }

  .keep-mini__known b {
    color: var(--keep-book-accent);
    display: block;
    font-weight: 500;
  }

  .keep-mini__known em {
    font-style: italic;
  }

  .keep-mini__letters {
    font-size: 1.29cqw;
    font-weight: 500;
    line-height: 2.8cqw;
    text-align: justify;
    text-align-last: justify;
    white-space: nowrap;
  }

  .keep-mini__letters b {
    background: var(--keep-book-accent);
    color: var(--keep-book-ink);
    font-weight: 500;
    padding: 0 0.35cqw;
  }

  .keep-mini__letters s {
    color: var(--keep-book-ink-soft);
    text-decoration: none;
  }

  .keep-mini__fields {
    display: flex;
    flex-direction: column;
    font-size: 1.4cqw;
    margin-top: 1.4cqw;
  }

  .keep-mini__fields span {
    display: grid;
    gap: 0.95cqw;
    grid-template-columns: 9.35cqw minmax(0, 1fr);
    line-height: 2.8cqw;
    overflow: hidden;
    white-space: nowrap;
  }

  .keep-mini__fields small {
    color: var(--keep-book-ink-soft);
    font-size: 1.29cqw;
  }

  .keep-mini__gap {
    margin-top: 0.95cqw;
  }

  .keep-mini__turns {
    align-self: flex-end;
    color: var(--keep-book-ink-soft);
    font-size: 1.4cqw;
    margin-top: auto;
  }

  .keep-mini__tab {
    aspect-ratio: 1;
    background: var(--keep-book-accent);
    inline-size: 3.74cqw;
    inset-block-start: 22%;
    inset-inline-end: 1.4cqw;
    position: absolute;
  }

}

@media (prefers-reduced-motion: reduce) {
  :root {
    --keep-transition-fast: 0ms;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .keep-app--book .keep-activity .keep-list__item--entering,
  .keep-app--book .keep-app__main,
  .keep-app--book .keep-app__body::before,
  .keep-app--book .keep-app__body::after,
  .keep-app--book .keep-book__panel,
  .keep-app--book .keep-book__expand,
  .keep-app--book .keep-book__search,
  .keep-app--book .keep-book__hint,
  .keep-app--book .keep-book__actions,
  .keep-app--book .keep-book__action {
    animation: none;
    transition: none;
  }

  .keep-app__rail,
  .keep-app__aside,
  .keep-app__foot {
    transition: none;
  }


  .keep-apps__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    padding-inline: var(--keep-page-gutter);
  }

  .keep-apps__track[aria-hidden="true"] {
    display: none;
  }

  .keep-apps__band {
    -webkit-mask-image: none;
    mask-image: none;
  }

}

@media (forced-colors: active) {
  .keep-button,
  .keep-field__control,
  .keep-notice {
    border: 1px solid CanvasText;
  }

  .keep-notice__mark {
    border: 1px solid CanvasText;
  }
}
