/* moin UI: native HTML, CSS and JS, no build step. This file only links the
   others, so a page needs one line. Theme, layout, components: each layer
   knows only the ones before it. */
/* Theme: every value moin UI knows, in one place. Only
   this file holds colors, sizes and motion. Each color is one line with its
   light and its dark value, so a theme is this list and nothing else.
   Nothing here is a class. */

@layer moin-theme, moin-layout, moin-components;

@layer moin-theme {
  :root {
    color-scheme: light dark;

    /* Type */
    /* The system's fonts: nothing to load, nothing that flickers. */
    --font-sans: ui-sans-serif, system-ui, sans-serif;
    --font-heading: var(--font-sans);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
    --weight-title: 600;
    --tracking-title: -0.025em;

    /* Size: everything is in rem, so this one number scales everything. */
    --scale: 1;
    font-size: calc(100% * var(--scale));

    /* Space: five steps do almost everything, 20 and 32 are the rare ones. */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Shape: one number. Every corner is a multiple of it, so at 0 everything
       is square: tiny things, what you press, what holds it. Something inside
       a box takes the box's corner minus the gap, never its own number.
       Round things stay round. */
    --radius: 0.5rem;
    --radius-sm: calc(var(--radius) * 0.5);
    --radius-md: calc(var(--radius) * 1.5);
    --radius-lg: calc(var(--radius) * 2);
    --radius-full: 9999px;
    /* The gap around anything lit inside a group. */
    --inset: 0.1875rem;
    /* How far a scrollbar stays from the edge of a round box: what the
       biggest corner cuts off. */
    --scroll-edge: calc(var(--radius-lg) * 0.3);
    /* How far what is lit in a menu stays from its edge. */
    --menu-gap: max(calc(2 * var(--inset)), var(--scroll-edge));

    /* Density: one number for how tight everything sits. Everything you press
       is this high, rows and cards follow. */
    --density: 1;
    --press-size: calc(2.75 * var(--density));
    --press: calc(var(--press-size) * 1rem);
    --row: calc(4rem * var(--density));
    --pad: calc(1.5rem * var(--density));

    /* Motion */
    --fast: 120ms;
    --ease: cubic-bezier(0.2, 0, 0, 1);

    /* Focus */
    --focus: 0 0 0 3px color-mix(in oklab, var(--ring) 30%, transparent);

    /* Depth */
    --shadow-low: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px -1px rgb(0 0 0 / 10%);
    --shadow-float: 0 25px 50px -12px rgb(0 0 0 / 25%);

    /* Ground and text */
    --background: light-dark(#f2f2f7, #000000);
    --foreground: light-dark(#000000, #ffffff);
    --card: light-dark(#ffffff, #1c1c1e);
    --card-foreground: light-dark(#000000, #ffffff);
    --popover: light-dark(#ffffff, #2c2c2e);
    --popover-foreground: light-dark(#000000, #ffffff);
    --muted: light-dark(#e5e5ea, #2c2c2e);
    --muted-foreground: light-dark(#636366, #98989f);
    --border: light-dark(rgb(0 0 0 / 8%), rgb(255 255 255 / 16%));

    /* Ink: the brand is black on light and white on dark. */
    --primary: light-dark(oklch(0.16 0 0), oklch(0.96 0 0));
    --primary-foreground: light-dark(oklch(0.99 0 0), oklch(0.13 0 0));
    --ring: light-dark(oklch(0.16 0 0 / 40%), oklch(0.97 0 0 / 40%));

    /* Status: the only color there is. */
    --live: light-dark(oklch(0.66 0.17 150), oklch(0.74 0.17 150));
    --running: light-dark(oklch(0.64 0.15 70), oklch(0.82 0.15 80));
    --failed: light-dark(oklch(0.6 0.22 25), oklch(0.68 0.2 25));
    --idle: light-dark(oklch(0.6 0 0), oklch(0.55 0 0));
    /* A status as words: pulled toward the text color, so it stays readable. */
    --live-text: color-mix(in oklab, var(--live), var(--foreground) 34%);
    --failed-text: color-mix(in oklab, var(--failed), var(--foreground) 30%);

    /* Logs and commands */
    --terminal: light-dark(oklch(0.16 0 0), #2c2c2e);
    --terminal-foreground: light-dark(oklch(0.9 0 0), oklch(0.88 0 0));
    /* What a highlighter marks in code. */
    --code-keyword: #fc5fa3;
    --code-string: #fc6a5d;
    --code-comment: #7f8c98;
    --code-function: #67b7a4;
    --code-number: #d0bf69;

    /* Charts: one color and its shades. Ink by default. */
    --chart-base: var(--foreground);
    --chart-1: var(--chart-base);
    --chart-2: color-mix(in oklab, var(--chart-base) 72%, var(--card));
    --chart-3: color-mix(in oklab, var(--chart-base) 50%, var(--card));
    --chart-4: color-mix(in oklab, var(--chart-base) 30%, var(--card));
    --chart-5: color-mix(in oklab, var(--chart-base) 16%, var(--card));

    /* Menus: a select's list and the palette. */
    --menu: var(--popover);
    --menu-foreground: var(--popover-foreground);
    --menu-lit: color-mix(in oklab, currentColor 8%, transparent);
    --menu-blur: none;

    /* Overlays */
    --muted-raised: light-dark(#e5e5ea, #3a3a3c);
    --knob: #ffffff;
    --dim: rgb(0 0 0 / 30%);
  }

  /* Hidden stays hidden, whatever display a component sets. */
  [hidden] {
    display: none !important;
  }

  /* Nothing set follows the system. A class or data-theme picks one. */
  :root.light,
  :root[data-theme="light"] {
    color-scheme: light;
  }
  :root.dark,
  :root[data-theme="dark"] {
    color-scheme: dark;
  }

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

  /* Every scrollbar: thin, in the color of the text, on nothing. */
  * {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklab, currentColor 25%, transparent) transparent;
  }

  html {
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
  }
  html:has(dialog:modal) {
    overflow: hidden;
  }

  body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  :where(h1, h2, h3, p, ul, ol, figure, pre) {
    margin: 0;
    padding: 0;
    font: inherit;
  }
  :where(ul, ol) {
    list-style: none;
  }
  :where(a) {
    color: inherit;
    text-decoration: none;
  }
  :where(button, input, textarea, select) {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
  }
  :where(button) {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  ::selection {
    background: var(--primary);
    color: var(--primary-foreground);
  }
}

@view-transition {
  navigation: auto;
}

@keyframes moin-spin {
  to {
    rotate: 360deg;
  }
}

/* Layout: how things sit next to each other, and the five sizes
   of text. The container makes the space with gap, never the element. */

@layer moin-layout {
  .moin-stack,
  .moin-row,
  .moin-grid {
    --gap: var(--space-4);
    gap: var(--gap);
    min-width: 0;
  }
  :is(.moin-stack, .moin-row, .moin-grid)[data-gap="1"] { --gap: var(--space-1); }
  :is(.moin-stack, .moin-row, .moin-grid)[data-gap="2"] { --gap: var(--space-2); }
  :is(.moin-stack, .moin-row, .moin-grid)[data-gap="3"] { --gap: var(--space-3); }
  :is(.moin-stack, .moin-row, .moin-grid)[data-gap="6"] { --gap: var(--space-6); }
  :is(.moin-stack, .moin-row, .moin-grid)[data-gap="8"] { --gap: var(--space-8); }

  /* Under each other. */
  .moin-stack {
    display: flex;
    flex-direction: column;
  }

  /* Next to each other. */
  .moin-row {
    display: flex;
    align-items: center;
  }
  .moin-row[data-wrap] { flex-wrap: wrap; }
  .moin-row[data-between] { justify-content: space-between; }
  .moin-row[data-end] { justify-content: flex-end; }
  .moin-row[data-top] { align-items: flex-start; }

  /* Next to each other from a tablet up, under each other on a phone. */
  @media (max-width: 39.99rem) {
    .moin-row[data-phone="stack"] {
      flex-direction: column;
      align-items: stretch;
    }
  }

  /* Two columns from a tablet up, as high as the highest. */
  .moin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  @media (min-width: 40rem) {
    .moin-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  /* Up to this many columns, each at least 14rem wide: it wraps by itself. */
  .moin-grid:is([data-cols="2"], [data-cols="3"], [data-cols="4"]) {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(14rem, calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)))), 1fr));
  }
  .moin-grid[data-cols="2"] { --n: 2; }
  .moin-grid[data-cols="3"] { --n: 3; }
  .moin-grid[data-cols="4"] { --n: 4; }
  /* One wide and one narrow. */
  @media (min-width: 40rem) {
    .moin-grid[data-cols="2-1"] { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
    .moin-grid[data-cols="1-2"] { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  }
  /* Tiles of different sizes. data-wide takes two columns, data-tall two
     rows. Two columns, four on a desktop. */
  .moin-bento {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: var(--space-4);
  }
  .moin-bento > [data-wide] { grid-column: span 2; }
  @media (min-width: 64rem) {
    .moin-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .moin-bento > [data-tall] { grid-row: span 2; }
  }

  /* Groups of different length, two columns from a tablet up: each column
     fills up, so no holes stay. */
  @media (min-width: 48rem) {
    .moin-columns { columns: 2; column-gap: var(--space-6); }
  }

  /* As many columns as fit, each at least --min wide, sharing the width. */
  .moin-grid[data-fit] {
    grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 12rem), 100%), 1fr));
  }

  /* One width for the whole product. */
  .moin-page {
    width: 100%;
    max-width: 64rem;
    margin-inline: auto;
    padding-left: max(var(--gutter, 1rem), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gutter, 1rem), env(safe-area-inset-right, 0px));
    padding-top: var(--page-top, 0);
  }
  @media (min-width: 40rem) {
    .moin-page {
      --gutter: 1.5rem;
    }
  }

  /* What a page holds: the page width, what is in it under each other. */
  .moin-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding-block: var(--space-6) 5rem;
  }

  /* A page outside the app: a head, one narrow column in the middle, a foot. */
  .moin-centered {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
  }
  .moin-centered > :is(header, footer) {
    display: flex;
    flex: none;
    height: 4rem;
    align-items: center;
  }
  .moin-centered > footer {
    justify-content: center;
    gap: var(--space-6);
    color: var(--muted-foreground);
    font-size: 0.875rem;
  }
  .moin-centered > footer > a:hover { color: var(--foreground); }
  .moin-centered > div {
    display: flex;
    flex: 1;
    justify-content: center;
    padding: 2.5rem var(--space-4) 4rem;
  }
  @media (min-width: 40rem) {
    .moin-centered > div { padding-top: 6rem; }
  }
  .moin-centered > div > * {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    width: 100%;
    max-width: 24rem;
  }

  /* A block of a page: a quiet title, an action at its end. */
  .moin-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
  }
  .moin-section-head {
    display: flex;
    min-height: 2rem;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }
  .moin-section-head > :is(h2, h3) {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: var(--muted-foreground);
  }

  .moin-row[data-center] { justify-content: center; }
  .moin-row[data-baseline] { align-items: baseline; }
  .moin-stack[data-center] { align-items: center; }
  /* As wide as text reads well, or --width. On a moin-page it stays centered. */
  .moin-narrow { max-width: var(--width, 42rem); }
  /* A label and two answers, one under the other on a phone. Rows in a list
     keep the same columns, so they line up. */
  @media (min-width: 40rem) {
    .moin-grid[data-cols="2-3-3"] { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 3fr); }
  }
  /* The sentence under the title of a page in the middle belongs to it. */
  .moin-centered > div > * > .moin-title + p { margin-block-start: calc(var(--space-4) * -1); }

  /* The first screen of a landing page: under a floating bar, words in the
     middle, and what shows them below. */
  .moin-hero {
    --bar: 4.25rem;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    margin-block-start: calc(var(--bar) * -1);
    overflow: hidden;
  }
  .moin-hero > :first-child {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding-block: calc(var(--bar) + 2rem) 2rem;
    text-align: center;
  }
  .moin-hero > :last-child {
    flex: none;
    width: 100%;
    height: 42svh;
  }
  /* A video as the picture: as wide as the page and whole, so it may reach
     below the first screen. A thin border shows its edge on a dark ground. */
  .moin-hero > :last-child:has(> video) {
    height: auto;
  }
  .moin-hero > :last-child > video {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #000;
  }
  @media (min-width: 40rem) {
    .moin-hero { --bar: 4.75rem; }
    .moin-hero > :first-child { padding-block: calc(var(--bar) + 2.5rem) 2.5rem; }
    .moin-hero > :last-child { height: 44svh; }
  }

  /* A statement of a landing page with room above it. */
  .moin-band {
    --band: 7rem;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    padding-block-start: var(--band);
  }
  .moin-band:last-child { padding-block-end: var(--band); }
  @media (min-width: 40rem) {
    .moin-band { --band: 9rem; }
  }
  .moin-fill { flex: 1; min-width: var(--fill-min, 0); }
  .moin-end { margin-inline-start: auto; }
  .moin-scroll { overflow-x: auto; min-width: 0; }
  /* Both ways, up to --scroll-max high: what stays in view needs this box. */
  .moin-scroll[data-both] {
    max-height: var(--scroll-max, 36rem);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .moin-hidden-phone { display: none; }
  @media (min-width: 40rem) {
    .moin-hidden-phone { display: revert; }
    .moin-only-phone { display: none; }
  }

  /* Out to the edge of its card, past the card's padding. */
  .moin-bleed { margin-inline: calc(-1 * var(--pad)); }
  /* Back in by the card's padding, for what sits in a moin-bleed. */
  .moin-inset { padding-inline: var(--pad); }
  /* A part of a row with its own width (--width) from a tablet up, the whole
     line on a phone. */
  .moin-width { flex: none; width: 100%; min-width: 0; }
  @media (min-width: 40rem) {
    .moin-width { width: var(--width); }
  }
  /* The whole width of a grid. */
  .moin-grid > [data-wide] { grid-column: 1 / -1; }
  /* What is empty takes no room. */
  .moin-hide-empty:empty { display: none; }

  /* A link to a place on the page stops under the floating bar, or --jump. */
  :target { scroll-margin-block-start: var(--jump, 6rem); }

  /* A box that only holds an id: what is in it counts as being in its place. */
  .moin-contents { display: contents; }
  /* A moin-width that keeps its width on a phone too. */
  .moin-width[data-fixed] { width: var(--width); }

  /* A form with two ways. Inside data-either, the radio marked data-other
     shows the parts marked data-way="other" in place of those marked
     data-way="first", with no script. */
  [data-either]:not(:has(input[data-other]:checked)) [data-way="other"],
  [data-either]:has(input[data-other]:checked) [data-way="first"] { display: none; }

  /* What a pick opens. In a list, the item marked data-picked right after a
     pick item shows only while that one is picked, with no script. */
  label.moin-item:not(:has(:checked)) + [data-picked] { display: none; }
}

/* A group of moin-columns is one box on its own line, past the display of
   whatever it is, a card too. So a column break never carries its margin to
   the top of the next column, in any engine. */
@layer moin-components {
  .moin-columns.moin-columns > * {
    display: inline-flex;
    flex-direction: column;
    width: 100%;
    vertical-align: top;
    break-inside: avoid;
    margin-block-end: var(--space-6);
  }
}

/* The icons, drawn on one 24 grid. Each is a mask, so it takes the color of
   the text around it. Generated once from the templ icons. */

@layer moin-components {
  .moin-icon {
    display: inline-block;
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    background: currentColor;
    -webkit-mask: var(--i) center / contain no-repeat;
    mask: var(--i) center / contain no-repeat;
  }
  .moin-icon[data-size="s"] {
    width: 1rem;
    height: 1rem;
  }
  .moin-icon-activity { --i: url("ui/icons/activity.svg"); }
  .moin-icon-app { --i: url("ui/icons/app.svg"); }
  .moin-icon-apps { --i: url("ui/icons/apps.svg"); }
  .moin-icon-bell { --i: url("ui/icons/bell.svg"); }
  .moin-icon-book { --i: url("ui/icons/book.svg"); }
  .moin-icon-bucket { --i: url("ui/icons/bucket.svg"); }
  .moin-icon-catalog { --i: url("ui/icons/catalog.svg"); }
  .moin-icon-check { --i: url("ui/icons/check.svg"); }
  .moin-icon-chevron-down { --i: url("ui/icons/chevron-down.svg"); }
  .moin-icon-chevron-left { --i: url("ui/icons/chevron-left.svg"); }
  .moin-icon-chevron-right { --i: url("ui/icons/chevron-right.svg"); }
  .moin-icon-copy { --i: url("ui/icons/copy.svg"); }
  .moin-icon-card { --i: url("ui/icons/card.svg"); }
  .moin-icon-database { --i: url("ui/icons/database.svg"); }
  .moin-icon-deploy { --i: url("ui/icons/deploy.svg"); }
  .moin-icon-disk { --i: url("ui/icons/disk.svg"); }
  .moin-icon-external { --i: url("ui/icons/external.svg"); }
  .moin-icon-failed { --i: url("ui/icons/failed.svg"); }
  .moin-icon-gauge { --i: url("ui/icons/gauge.svg"); }
  .moin-icon-folder { --i: url("ui/icons/folder.svg"); }
  .moin-icon-globe { --i: url("ui/icons/globe.svg"); }
  .moin-icon-key { --i: url("ui/icons/key.svg"); }
  .moin-icon-logs { --i: url("ui/icons/logs.svg"); }
  .moin-icon-package { --i: url("ui/icons/package.svg"); }
  .moin-icon-play { --i: url("ui/icons/play.svg"); }
  .moin-icon-plus { --i: url("ui/icons/plus.svg"); }
  .moin-icon-restart { --i: url("ui/icons/restart.svg"); }
  .moin-icon-search { --i: url("ui/icons/search.svg"); }
  .moin-icon-server { --i: url("ui/icons/server.svg"); }
  .moin-icon-server-off { --i: url("ui/icons/server-off.svg"); }
  .moin-icon-settings { --i: url("ui/icons/settings.svg"); }
  .moin-icon-shield { --i: url("ui/icons/shield.svg"); }
  .moin-icon-shield-off { --i: url("ui/icons/shield-off.svg"); }
  .moin-icon-stop { --i: url("ui/icons/stop.svg"); }
  .moin-icon-theme { --i: url("ui/icons/theme.svg"); }
  .moin-icon-trash { --i: url("ui/icons/trash.svg"); }
  .moin-icon-undo { --i: url("ui/icons/undo.svg"); }
  .moin-icon-user { --i: url("ui/icons/user.svg"); }
  .moin-icon-users { --i: url("ui/icons/users.svg"); }
  .moin-icon-x { --i: url("ui/icons/x.svg"); }
  .moin-icon-git-hub { --i: url("ui/icons/git-hub.svg"); }
  .moin-icon-google { --i: url("ui/icons/google.svg"); }
}

@layer moin-components {
  /* Whatever scrolls at the edge of a round box. A scrollbar sits inside the
     border, so a see-through border keeps it and its corner in the curve. */
  .moin-textarea,
  .moin-code > pre,
  .moin-select > [popover],
  .moin-menu,
  .moin-palette-list {
    border: var(--scroll-edge) solid transparent;
  }

  /* The focus ring of everything you can press. */
  .moin-button:focus-visible,
  .moin-input:focus-visible,
  .moin-textarea:focus-visible,
  .moin-switch > input:focus-visible,
  .moin-check > input:focus-visible,
  .moin-radio > input:focus-visible,
  .moin-tab:focus-visible,
  .moin-back:focus-visible,
  .moin-copy:focus-visible,
  .moin-choice > label:has(:focus-visible) {
    box-shadow: var(--focus);
  }
}

@layer moin-components {
  /* Text: five sizes and a few ways to say more. */
  .moin-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-family: var(--font-heading);
    font-weight: var(--weight-title);
    letter-spacing: var(--tracking-title);
    text-wrap: balance;
  }
  .moin-number {
    font-size: 1.5rem;
    line-height: 2rem;
    font-family: var(--font-heading);
    font-weight: var(--weight-title);
    letter-spacing: var(--tracking-title);
    font-variant-numeric: tabular-nums;
  }
  .moin-heading {
    font-family: var(--font-heading);
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 500;
  }
  .moin-text {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  .moin-small {
    font-size: 0.75rem;
    line-height: 1rem;
  }
  .moin-muted { color: var(--muted-foreground); }
  .moin-strong { font-weight: 500; }
  .moin-mono { font-family: var(--font-mono); }
  .moin-digits { font-variant-numeric: tabular-nums; }
  .moin-center { text-align: center; text-wrap: balance; }
  /* The sizes of a landing page: its one promise, a statement per section,
     a sentence that leads to the rest, and a sign-off word as big as the page. */
  .moin-display {
    font-family: var(--font-heading);
    font-size: 12vw;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.06em;
  }
  .moin-statement {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: var(--weight-title);
    line-height: 2.5rem;
    letter-spacing: var(--tracking-title);
    text-wrap: balance;
    overflow-wrap: break-word;
  }
  .moin-lead {
    max-width: var(--measure, 76ch);
    font-size: 1.125rem;
    line-height: 1.75rem;
    color: var(--muted-foreground);
    text-wrap: pretty;
  }
  .moin-huge { font-size: clamp(4rem, 13vw, 8rem); line-height: 1; }
  @media (min-width: 40rem) {
    .moin-display { font-size: clamp(3rem, 5.4vw, 5.75rem); letter-spacing: -0.05em; }
    .moin-statement { font-size: 3rem; line-height: 1; }
    .moin-lead[data-large] { font-size: 1.25rem; }
  }
  /* The plain text color inside a quiet line, and the colors of a state. */
  .moin-foreground { color: var(--foreground); }
  .moin-live { color: var(--live-text); }
  .moin-running { color: var(--running); }
  .moin-failed { color: var(--failed-text); }
  /* Long words break instead of pushing the box wider. */
  .moin-break { overflow-wrap: anywhere; }
  .moin-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .moin-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* A link in a line of text. */
  .moin-link {
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
    text-underline-offset: 2px;
  }
  .moin-link:hover { color: var(--foreground); }
  /* A link that is a name: the underline comes with the pointer. */
  .moin-link[data-quiet]:not(:hover) { text-decoration: none; }
}

@layer moin-components {
  /* Button: a pill, the same height everywhere. One primary per screen. */
  .moin-button {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: var(--press);
    padding-inline: var(--space-5);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--muted);
    color: var(--foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    white-space: nowrap;
    outline: none;
    cursor: pointer;
    transition: background-color var(--fast) var(--ease);
  }
  .moin-button:hover { background: color-mix(in oklab, var(--muted) 70%, transparent); }
  .moin-button[data-kind="primary"] {
    background: var(--primary);
    color: var(--primary-foreground);
  }
  .moin-button[data-kind="primary"]:hover { background: color-mix(in oklab, var(--primary) 85%, transparent); }
  .moin-button[data-kind="danger"] { color: var(--failed-text); }
  .moin-button[data-kind="danger"]:hover { background: color-mix(in oklab, var(--failed) 10%, transparent); }
  .moin-button:disabled {
    pointer-events: none;
    opacity: 0.4;
  }

  /* A button that stays pressed: a real checkbox inside it. */
  .moin-button:has(> input[type="checkbox"]) { position: relative; }
  .moin-button > input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .moin-button:has(> input:checked),
  .moin-button:has(> input:checked):hover {
    background: var(--foreground);
    color: var(--background);
  }
  .moin-button:has(> input:focus-visible) { box-shadow: var(--focus); }

  /* A button that did its job shows a check, at the same size. */
  .moin-button:is([data-done], [data-copied]),
  .moin-button[aria-busy="true"] {
    position: relative;
    color: transparent;
  }
  .moin-button:is([data-done], [data-copied])::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.125rem;
    height: 1.125rem;
    background: var(--foreground);
    -webkit-mask: url("ui/icons/check.svg") center / contain no-repeat;
    mask: url("ui/icons/check.svg") center / contain no-repeat;
  }
  .moin-button[data-kind="primary"]:is([data-done], [data-copied])::after { background: var(--primary-foreground); }
  .moin-button[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--muted-foreground);
    border-top-color: var(--foreground);
    border-radius: var(--radius-full);
    animation: moin-spin 0.7s linear infinite;
  }

  /* A button with only an icon in it. */
  .moin-button[data-icon] {
    width: var(--press);
    padding-inline: 0;
    color: var(--muted-foreground);
  }
  .moin-button[data-icon]:hover {
    background: var(--muted);
    color: var(--foreground);
  }
  .moin-button[data-icon][data-kind="danger"]:hover { color: var(--failed-text); }
  .moin-button[data-quiet] { background: transparent; }
  /* Quiet words: a way elsewhere under the real buttons. */
  .moin-button[data-muted] { color: var(--muted-foreground); }
  .moin-button[data-muted]:hover { color: var(--foreground); }
  .moin-button[data-quiet]:hover { background: var(--muted); }
  .moin-button[data-icon][aria-current] {
    background: var(--primary);
    color: var(--primary-foreground);
  }

  /* The button of a row that shares the line with a short control. */
  @media (max-width: 39.99rem) {
    .moin-button[data-phone="fill"] { flex: 1; }
  }
}

@layer moin-components {
  /* Buttons that belong together, side by side. The outer corners are the
     ones of a button, the inner ones the small step. */
  .moin-button-group {
    display: inline-flex;
    gap: 2px;
  }
  .moin-button-group > .moin-button { border-radius: var(--radius-sm); }
  .moin-button-group > .moin-button:first-child {
    border-start-start-radius: var(--radius-md);
    border-end-start-radius: var(--radius-md);
  }
  .moin-button-group > .moin-button:last-child {
    border-start-end-radius: var(--radius-md);
    border-end-end-radius: var(--radius-md);
  }
}

@layer moin-components {
  /* Fields. 16 px on phones, so iOS does not zoom in. */
  .moin-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: var(--press);
    padding-inline: var(--space-5);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--muted);
    font-size: 1rem;
    outline: none;
  }
  .moin-textarea {
    display: block;
    width: 100%;
    min-height: 10rem;
    padding: calc(var(--space-4) - var(--scroll-edge)) calc(var(--space-5) - var(--scroll-edge));
    border-radius: var(--radius-md);
    background: var(--muted);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    resize: vertical;
  }
  @media (min-width: 40rem) {
    .moin-input,
    .moin-textarea { font-size: 0.875rem; }
  }
  .moin-input::placeholder,
  .moin-textarea::placeholder { color: var(--muted-foreground); }
  .moin-input:disabled { opacity: 0.4; }
  /* A field without a box until you press it, for a cell of a table. */
  .moin-input[data-bare] {
    max-width: 22rem;
    min-width: 6rem;
    padding-inline: var(--space-3);
    overflow: hidden;
    background: transparent;
    font-family: var(--font-mono);
    text-overflow: ellipsis;
    field-sizing: content;
  }
  .moin-input[data-bare]:hover { background: color-mix(in oklab, var(--foreground) 4%, transparent); }
  .moin-input[data-bare]:focus-visible { background: var(--muted); }
  .moin-input[data-bare]::placeholder { font-style: italic; }
  .moin-input[data-num] { text-align: right; }
  .moin-input[data-state="saved"] { color: var(--live-text); }
  .moin-input[data-state="failed"] { color: var(--failed-text); }
  .moin-input[aria-invalid="true"] {
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--failed) 30%, transparent);
  }

  /* A field with an icon in it. An input cannot hold anything, so a box holds
     both: the icon sits over the field and the text moves over for it. */
  .moin-input-icon {
    position: relative;
    min-width: 0;
  }
  .moin-input-icon > .moin-icon {
    position: absolute;
    top: 50%;
    left: var(--space-5);
    translate: 0 -50%;
    color: var(--muted-foreground);
    pointer-events: none;
  }
  .moin-input-icon > .moin-input { padding-inline-start: 3rem; }

  /* A field with fixed text in front of it or after it. The box looks like
     the field, and the input in it goes see-through. */
  .moin-input-text {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    min-width: 0;
    height: var(--press);
    padding-inline: var(--space-5);
    border-radius: var(--radius-md);
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 1rem;
  }
  .moin-input-text:has(:focus-visible) { box-shadow: var(--focus); }
  .moin-input-text > .moin-input {
    flex: 1;
    width: auto;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--foreground);
    box-shadow: none;
  }
  @media (min-width: 40rem) {
    .moin-input-text { font-size: 0.875rem; }
  }

  .moin-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
  }
  .moin-field > :is(label, span) {
    padding-inline: var(--space-5);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
  }
  .moin-hint {
    min-height: 1.25rem;
    padding-inline: var(--space-5);
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--muted-foreground);
  }
  .moin-hint[data-invalid] { color: var(--failed-text); }
}

@layer moin-components {
  /* One of these: pills in a pill, the open one lifted. Links in .moin-tabs,
     radios in .moin-choice. */
  .moin-tabs,
  .moin-choice {
    position: relative;
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--space-1);
    width: fit-content;
    max-width: 100%;
    height: var(--press);
    padding: var(--space-1);
    border-radius: var(--radius-md);
    background: var(--muted);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .moin-choice[data-size="s"] { height: 2.25rem; }
  .moin-tab,
  .moin-choice > label {
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--space-2);
    height: 100%;
    padding-inline: var(--space-4);
    border-radius: max(0px, calc(var(--radius-md) - var(--space-1)));
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    white-space: nowrap;
    outline: none;
    cursor: pointer;
  }
  .moin-tab:hover,
  .moin-choice > label:hover { color: var(--foreground); }
  .moin-tab[aria-current],
  .moin-choice > label:has(:checked) {
    background: var(--background);
    color: var(--foreground);
    box-shadow: var(--shadow-low);
  }
  .moin-choice input { position: absolute; opacity: 0; pointer-events: none; }
  /* One that cannot be picked yet. */
  .moin-choice > label:has(:disabled) { opacity: 0.4; cursor: not-allowed; }
  .moin-choice > label:has(:disabled):hover { color: var(--muted-foreground); }
  /* The one in use: a green dot after the label. */
  .moin-tab[data-live]::after {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-full);
    background: var(--live);
  }

  /* The parts of a choice: inside data-surfaces, the data-surface of the
     checked radio shows and the others go. */
  [data-surface] { display: none; }
  [data-surfaces]:has([value="web"]:checked) [data-surface="web"],
  [data-surfaces]:has([value="cli"]:checked) [data-surface="cli"],
  [data-surfaces]:has([value="tui"]:checked) [data-surface="tui"],
  [data-surfaces]:has([value="api"]:checked) [data-surface="api"],
  [data-surfaces]:has([value="mcp"]:checked) [data-surface="mcp"] { display: block; }

  /* Quiet: only words, for tabs under tabs. */
  .moin-tabs[data-quiet] {
    gap: var(--space-5);
    height: auto;
    padding: 0;
    border-radius: 0;
    background: none;
  }
  .moin-tabs[data-quiet] .moin-tab {
    height: auto;
    padding: var(--space-1) 0;
  }
  .moin-tabs[data-quiet] .moin-tab[aria-current]:not(:focus-visible) {
    background: none;
    box-shadow: none;
  }
}

@layer moin-components {
  /* Select: a button and a native popover of radios under it. */
  .moin-select { position: relative; width: 100%; min-width: 0; }
  .moin-select > button {
    display: flex;
    width: 100%;
    height: var(--press);
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding-inline: var(--space-5);
    border-radius: var(--radius-md);
    background: var(--muted);
    font-size: 0.875rem;
    text-align: left;
    outline: none;
  }
  .moin-select > button:focus-visible { box-shadow: var(--focus); }
  .moin-select > button::after {
    content: "";
    flex: none;
    width: 1rem;
    height: 1rem;
    background: var(--muted-foreground);
    -webkit-mask: url("ui/icons/chevron-down.svg") center / contain no-repeat;
    mask: url("ui/icons/chevron-down.svg") center / contain no-repeat;
  }
  .moin-select > [popover],
  .moin-menu {
    inset: auto;
    top: anchor(bottom);
    left: anchor(left);
    width: anchor-size(width);
    min-width: 12rem;
    max-height: 18rem;
    margin: var(--space-2) 0 0;
    padding: calc(var(--menu-gap) - var(--scroll-edge));
    border-radius: var(--radius-lg);
    background: var(--menu);
    color: var(--menu-foreground);
    backdrop-filter: var(--menu-blur);
    -webkit-backdrop-filter: var(--menu-blur);
    box-shadow: var(--shadow-float);
    overflow-y: auto;
  }
  /* As wide as its button, wider only for an option that needs it. */
  /* As wide as its longest option, within the screen. */
  .moin-select > [popover] {
    width: max-content;
    min-width: max(12rem, anchor-size(width));
    max-width: calc(100vw - 2rem);
  }
  .moin-menu {
    right: anchor(right);
    left: auto;
    width: auto;
  }
  .moin-select > [popover]:popover-open,
  .moin-menu:popover-open {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .moin-select input { position: absolute; opacity: 0; pointer-events: none; }
  [data-select-label] > .moin-icon {
    margin-inline-end: var(--space-2);
    vertical-align: text-bottom;
  }

  /* One option of a list you pick from: a select and the palette. */
  .moin-option {
    display: flex;
    width: 100%;
    min-height: var(--press);
    align-items: center;
    gap: var(--space-3);
    /* The text starts where the text of the field it belongs to starts. */
    padding: var(--space-2) calc(var(--space-5) - var(--menu-gap));
    /* Its curve runs along the one of the menu it is in. */
    border-radius: max(0px, calc(var(--radius-lg) - var(--menu-gap)));
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-align: left;
    outline: none;
    cursor: pointer;
  }
  button.moin-option:is(:hover, :focus-visible),
  .moin-option:has(:focus),
  .moin-option[aria-selected="true"] {
    background: var(--menu-lit);
    color: var(--menu-lit-foreground, inherit);
  }
  .moin-option:has(:checked) { font-weight: 500; }
  .moin-option:has(:checked)::after {
    content: "";
    flex: none;
    margin-inline-start: auto;
    width: 1rem;
    height: 1rem;
    background: currentColor;
    -webkit-mask: url("ui/icons/check.svg") center / contain no-repeat;
    mask: url("ui/icons/check.svg") center / contain no-repeat;
  }
}

@layer moin-components {
  /* Check: a real checkbox, for where no item holds it. In an item a check mark is
     enough, because the whole item is what you press. */
  .moin-check {
    position: relative;
    display: inline-flex;
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
  }
  .moin-check > input {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: var(--radius-sm);
    background: color-mix(in oklab, var(--foreground) 15%, transparent);
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: background-color var(--fast) var(--ease);
  }
  .moin-check > input:checked { background: var(--foreground); }
  .moin-check > input:disabled { opacity: 0.4; cursor: not-allowed; }
  .moin-check > span {
    position: absolute;
    inset: 0.125rem;
    background: var(--background);
    -webkit-mask: url("ui/icons/check.svg") center / contain no-repeat;
    mask: url("ui/icons/check.svg") center / contain no-repeat;
    visibility: hidden;
    pointer-events: none;
  }
  .moin-check > input:checked + span { visibility: visible; }
}

@layer moin-components {
  /* Radio: a real radio, for where no item holds it. In an item a check mark
     is enough, because the whole item is what you press. */
  .moin-radio {
    position: relative;
    display: inline-flex;
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
  }
  .moin-radio > input {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: var(--radius-full);
    background: color-mix(in oklab, var(--foreground) 15%, transparent);
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: background-color var(--fast) var(--ease);
  }
  .moin-radio > input:checked { background: var(--foreground); }
  .moin-radio > input:disabled { opacity: 0.4; cursor: not-allowed; }
  .moin-radio > span {
    position: absolute;
    inset: 0.375rem;
    border-radius: var(--radius-full);
    background: var(--background);
    visibility: hidden;
    pointer-events: none;
  }
  .moin-radio > input:checked + span { visibility: visible; }
}

@layer moin-components {
  /* Switch: a real checkbox. */
  .moin-switch {
    position: relative;
    display: inline-flex;
    flex: none;
    width: 3rem;
    height: 1.75rem;
  }
  .moin-switch > input {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: var(--radius-md);
    background: color-mix(in oklab, var(--foreground) 15%, transparent);
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: background-color var(--fast) var(--ease);
  }
  .moin-switch > input:checked { background: var(--foreground); }
  .moin-switch > input:disabled { opacity: 0.4; cursor: not-allowed; }
  .moin-switch > span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: max(0px, calc(var(--radius-md) - 2px));
    background: var(--knob);
    box-shadow: var(--shadow-low);
    pointer-events: none;
    transition: translate var(--fast) var(--ease);
  }
  .moin-switch > input:checked + span {
    translate: 1.25rem 0;
    background: var(--background);
  }

  /* A tap on the words next to a switch works it too. */
  label:has(.moin-switch) { cursor: pointer; }
}

@layer moin-components {
  /* A word between two lines: or. */
  .moin-or {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding-block: var(--space-1);
    color: var(--muted-foreground);
    font-size: 0.875rem;
  }
  .moin-or::before,
  .moin-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
  }
}

@layer moin-components {
  /* A list is only rows, with a thin line between them. A card is the
     surface under them. */
  .moin-list {
    --item-edge: var(--space-5);
    display: flex;
    flex-direction: column;
  }

  .moin-item {
    position: relative;
    isolation: isolate;
    display: flex;
    width: 100%;
    min-height: var(--row);
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--item-edge);
    border: 0;
    background: none;
    text-align: left;
    outline: none;
  }
  /* The line over every item but the first; it starts where the text does. */
  .moin-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--item-edge);
    right: var(--item-edge);
    height: 1px;
    background: var(--border);
  }
  .moin-item:first-child::before { display: none; }
  .moin-item:has(> [data-lead])::before { left: calc(var(--item-edge) + 3rem); }
  /* The light of an item: the same gap on every side, so two lit items never
     touch. Its corners are the card's minus the two gaps, all four the same. */
  .moin-item::after {
    content: "";
    position: absolute;
    inset: var(--inset);
    z-index: -1;
    border-radius: var(--lit);
  }
  .moin-item,
  .moin-expand > summary {
    --lit: max(0px, calc(var(--radius-lg) - 2 * var(--inset)));
  }
  .moin-item[data-control] { flex-wrap: wrap; }
  .moin-item[data-control] > .moin-select { flex: none; width: var(--select-width, 9rem); }
  :is(a, button, label).moin-item { cursor: pointer; }
  :is(a, button, label).moin-item:is(:hover, :focus-visible)::after,
  a.moin-item[aria-current]::after,
  label.moin-item:is(:has(:checked), :has(:focus-visible))::after {
    background: color-mix(in oklab, var(--foreground) 4%, transparent);
  }
  :is(a, button, label).moin-item:active::after {
    background: color-mix(in oklab, var(--foreground) 7%, transparent);
  }
  /* A lit item and the lines next to it give way. */
  :is(a, button, label).moin-item:is(:hover, :focus-visible)::before,
  :is(a, button, label).moin-item:is(:hover, :focus-visible) + :is(.moin-item, .moin-expand)::before,
  a.moin-item[aria-current]::before,
  a.moin-item[aria-current] + :is(.moin-item, .moin-expand)::before,
  label.moin-item:is(:has(:checked), :has(:focus-visible))::before,
  label.moin-item:is(:has(:checked), :has(:focus-visible)) + :is(.moin-item, .moin-expand)::before {
    opacity: 0;
  }
  button.moin-item[data-danger] { color: var(--failed-text); }
  label.moin-item input:is([type="radio"], [type="checkbox"]) { position: absolute; opacity: 0; pointer-events: none; }

  .moin-item-text { flex: 1; min-width: 0; }
  .moin-item-name {
    display: block;
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .moin-item-note {
    display: block;
    overflow: hidden;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--muted-foreground);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* A hint says what the item is about, in a sentence that wraps. */
  .moin-item-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--muted-foreground);
  }
  .moin-item-value {
    flex: none;
    max-width: 50%;
    overflow: hidden;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .moin-chevron,
  .moin-item-check,
  .moin-out {
    flex: none;
    width: 1rem;
    height: 1rem;
    background: var(--muted-foreground);
    -webkit-mask: url("ui/icons/chevron-right.svg") center / contain no-repeat;
    mask: url("ui/icons/chevron-right.svg") center / contain no-repeat;
  }
  .moin-out {
    -webkit-mask-image: url("ui/icons/external.svg");
    mask-image: url("ui/icons/external.svg");
  }
  .moin-item-check {
    visibility: hidden;
    background: var(--foreground);
    -webkit-mask-image: url("ui/icons/check.svg");
    mask-image: url("ui/icons/check.svg");
  }
  label.moin-item:has(:checked) .moin-item-check { visibility: visible; }

  .moin-item > [data-lead] { display: flex; flex: none; }
}

@layer moin-components {
  /* An item that opens what is under it in place. */
  .moin-expand { position: relative; }
  .moin-expand::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--item-edge, var(--space-5));
    right: var(--item-edge, var(--space-5));
    height: 1px;
    background: var(--border);
  }
  .moin-expand > summary {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: var(--row);
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--item-edge, var(--space-5));
    font-weight: 500;
    list-style: none;
    outline: none;
    cursor: pointer;
  }
  .moin-expand > summary::-webkit-details-marker { display: none; }
  .moin-expand > summary::after {
    content: "";
    position: absolute;
    inset: var(--inset);
    z-index: -1;
    border-radius: var(--lit);
  }
  .moin-expand > summary:is(:hover, :focus-visible)::after {
    background: color-mix(in oklab, var(--foreground) 4%, transparent);
  }
  .moin-expand > summary .moin-chevron { transition: rotate var(--fast) var(--ease); }
  .moin-expand[open] > summary .moin-chevron { rotate: 90deg; }
  .moin-expand > div > .moin-item:first-child::before { display: block; }

  /* Quiet: a few words that open more words under them. No line, no light,
     the size of the text around it. The chevron says it opens. */
  .moin-expand[data-quiet] { color: var(--muted-foreground); }
  .moin-expand[data-quiet]::before,
  .moin-expand[data-quiet] > summary::after { display: none; }
  .moin-expand[data-quiet] > summary {
    display: inline-flex;
    max-width: 100%;
    min-height: 0;
    gap: var(--space-1);
    padding: var(--space-1) 0;
    font-weight: inherit;
  }
  .moin-expand[data-quiet] > summary .moin-item-name { font-weight: inherit; }
  .moin-expand[data-quiet] > summary:is(:hover, :focus-visible) { color: var(--foreground); }
  .moin-list > .moin-expand:first-child::before { display: none; }
  /* A lit item and the lines next to it give way, as for any other item. */
  .moin-expand:has(> summary:is(:hover, :focus-visible))::before,
  .moin-expand:has(> summary:is(:hover, :focus-visible)) > div > .moin-item:first-child::before,
  .moin-expand:not([open]):has(> summary:is(:hover, :focus-visible)) + :is(.moin-expand, .moin-item)::before,
  .moin-expand[open]:has(> div > :is(a, button, label).moin-item:last-child:is(:hover, :focus-visible)) + :is(.moin-expand, .moin-item)::before {
    opacity: 0;
  }
}

@layer moin-components {
  /* A card: one topic. A title with at most one action next to it, and a
     foot with buttons when it asks for something. */
  .moin-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
    padding: var(--pad);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--card-foreground);
  }
  .moin-card[data-center] { justify-content: center; }
  .moin-card[data-gap="1"] { gap: var(--space-1); }
  .moin-card[data-gap="6"] { gap: var(--space-6); }
  .moin-card[data-gap="8"] { gap: var(--space-8); }
  .moin-card[data-flush] { padding-inline: 0; }
  .moin-card[data-flush] > :is(.moin-card-head, .moin-card-foot) { padding-inline: var(--pad); }
  .moin-card-head {
    display: flex;
    flex-wrap: wrap;
    min-height: var(--press);
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
  }
  .moin-card-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
  }
}

@layer moin-components {
  /* A whole card can be a link. */
  a.moin-card { transition: background-color var(--fast) var(--ease); }
  a.moin-card:hover { background: color-mix(in oklab, var(--card), var(--foreground) 4%); }
  a.moin-card:focus-visible { outline: none; box-shadow: var(--focus); }

  /* The one card that stands out. */
  .moin-card[data-ink] {
    --card: var(--foreground);
    --card-foreground: var(--background);
    --muted-foreground: color-mix(in oklab, var(--background) 65%, var(--foreground));
  }
  a.moin-card[data-ink]:hover { background: color-mix(in oklab, var(--foreground), var(--background) 12%); }
}

@layer moin-components {
  /* A list in a card runs to --inset from the card's edge. The light of an
     item then sits the same distance from the card on every side, and the
     words line up with the card's own. */
  .moin-card > .moin-list {
    --item-edge: calc(var(--pad) - var(--inset));
    margin-inline: calc(var(--inset) - var(--pad));
  }
  .moin-card > .moin-list:first-child { margin-block-start: calc(var(--inset) - var(--pad)); }
  .moin-card > .moin-list:last-child { margin-block-end: calc(var(--inset) - var(--pad)); }
  /* A flush card has no padding at the sides to run past. */
  .moin-card[data-flush] > .moin-list { margin-inline: var(--inset); }

  /* In a grid a card with only a list is as tall as its rows, not as its
     neighbor. */
  .moin-grid > .moin-card:has(> .moin-list:only-child) { align-self: start; }
}

@layer moin-components {
  /* State: a dot, a word, a pill. */
  .moin-dot {
    display: inline-block;
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-full);
    background: var(--idle);
  }
  .moin-dot[data-state="live"] {
    background: var(--live);
    animation: moin-breathe 2.4s ease-out infinite;
  }
  .moin-dot[data-state="running"] {
    background: var(--running);
    animation: moin-blink 1.2s ease-in-out infinite;
  }
  .moin-dot[data-state="failed"] { background: var(--failed); }
  .moin-dot[data-state="waiting"] {
    background: none;
    border: 1.5px solid var(--running);
  }
  .moin-dot[data-state="idle"] {
    background: none;
    border: 1.5px solid var(--muted-foreground);
  }
  .moin-dot[data-state="done"] {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 0;
    background: var(--muted-foreground);
    -webkit-mask: url("ui/icons/check.svg") center / contain no-repeat;
    mask: url("ui/icons/check.svg") center / contain no-repeat;
  }

  .moin-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
  }
  /* The dot's own place, wide enough for the ring of a live one. */
  .moin-status > .moin-dot { margin-inline: var(--space-1); }
  .moin-status[data-state="failed"] { color: var(--failed-text); }
  .moin-status:is([data-state="idle"], [data-state="done"]) { color: var(--muted-foreground); }

  .moin-chip {
    --tint: var(--idle);
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--space-2);
    height: 1.75rem;
    padding-inline: 0.625rem var(--space-3);
    border-radius: var(--radius-md);
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    white-space: nowrap;
  }
  .moin-chip:is([data-state="live"], [data-state="running"], [data-state="waiting"], [data-state="failed"]) {
    background: color-mix(in oklab, var(--tint) 16%, transparent);
    color: color-mix(in oklab, var(--tint), var(--foreground) 40%);
  }
  .moin-chip[data-state="live"] { --tint: var(--live); }
  .moin-chip:is([data-state="running"], [data-state="waiting"]) { --tint: var(--running); }
  .moin-chip[data-state="failed"] { --tint: var(--failed); }

  /* A dot alone, in the room of a chip: the mark at the end of an item. */
  .moin-status[data-alone] { width: 2rem; justify-content: center; }
}

@layer moin-components {
  /* A command to copy. */
  .moin-command {
    --copy-gap: max(var(--scroll-edge), var(--space-1));
    display: flex;
    height: var(--press);
    min-width: 0;
    align-items: center;
    gap: var(--space-2);
    padding-inline: var(--space-5) var(--copy-gap);
    border-radius: var(--radius-md);
    background: var(--muted);
  }
  .moin-command > code {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .moin-copy {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    /* In the corner of its box its curve runs along the box's. */
    border-radius: max(0px, calc(var(--copy-outer, var(--radius-md)) - var(--copy-gap, 0px)));
    color: var(--muted-foreground);
    outline: none;
  }
  .moin-copy:hover {
    background: color-mix(in oklab, var(--foreground) 5%, transparent);
    color: var(--foreground);
  }
  .moin-copy[data-copied] { color: var(--live); }
  .moin-copy > .moin-icon { width: 1rem; height: 1rem; }
  .moin-copy[data-copied] > .moin-icon {
    -webkit-mask-image: url("ui/icons/check.svg");
    mask-image: url("ui/icons/check.svg");
  }
}

@layer moin-components {
  /* Overlays float one step lighter than what they cover, with no border. */
  .moin-dialog {
    --muted: var(--muted-raised);
    width: min(28rem, calc(100% - 2rem));
    margin: auto;
    padding: var(--space-6);
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--popover);
    color: var(--popover-foreground);
    box-shadow: var(--shadow-float);
  }
  .moin-dialog::backdrop,
  .moin-palette::backdrop { background: var(--dim); }
  .moin-dialog-buttons {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--space-2);
  }
  @media (min-width: 40rem) {
    .moin-dialog-buttons {
      flex-direction: row;
      justify-content: flex-end;
    }
  }

  .moin-palette {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .moin-palette-box {
    display: flex;
    flex-direction: column;
    width: min(38rem, calc(100vw - 2rem));
    max-height: min(70vh, 34rem);
    margin: 12vh auto 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--menu);
    color: var(--menu-foreground);
    backdrop-filter: var(--menu-blur);
    -webkit-backdrop-filter: var(--menu-blur);
    box-shadow: var(--shadow-float);
  }
  .moin-palette-box > .moin-input-icon { flex: none; }
  .moin-palette-box .moin-input::-webkit-search-cancel-button { display: none; }
  .moin-palette-box .moin-input {
    height: 4rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
  }
  .moin-palette-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: calc(var(--menu-gap) - var(--scroll-edge));
    padding-top: calc(2 * var(--inset));
    border-top: 1px solid var(--border);
    overflow-y: auto;
  }
  .moin-palette-list:empty { display: none; }

  /* The name of a group of options, starting where their text starts. */
  .moin-palette-group {
    padding: var(--space-3) calc(var(--space-5) - var(--menu-gap)) var(--space-1);
    color: var(--muted-foreground);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
  }
}

@layer moin-components {
  /* The head of every page: the way back, then the title, big. */
  .moin-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }
  .moin-header-back {
    display: flex;
    height: 1.5rem;
    align-items: center;
  }
  .moin-back {
    display: flex;
    height: 2rem;
    margin-inline-start: -0.375rem;
    align-items: center;
    gap: 2px;
    padding-inline: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    outline: none;
  }
  .moin-back:hover { color: var(--foreground); }
  .moin-back::before {
    content: "";
    width: 1rem;
    height: 1rem;
    background: currentColor;
    -webkit-mask: url("ui/icons/chevron-left.svg") center / contain no-repeat;
    mask: url("ui/icons/chevron-left.svg") center / contain no-repeat;
  }
  .moin-header-main {
    display: flex;
    flex-wrap: wrap;
    min-height: var(--press);
    align-items: center;
    gap: var(--space-3) var(--space-2);
  }
  .moin-header-main > .moin-title {
    margin-inline-end: var(--space-2);
    padding-block: var(--space-1);
  }
  .moin-header-actions {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    align-items: center;
    width: 100%;
    gap: var(--space-2);
  }
  /* A chip or a status is a word, not a button: it keeps its own width. */
  .moin-header-actions > :is(.moin-chip, .moin-status) { justify-self: start; }
  .moin-header-line {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    font-weight: 500;
  }
  @media (min-width: 40rem) {
    .moin-header-actions {
      display: flex;
      width: auto;
      margin-inline-start: auto;
    }
    .moin-header-line { order: 9; }
  }

  /* A quiet line says no more than a line of text. */
  .moin-header-line > .moin-muted { font-weight: 400; }
}

@layer moin-components {
  /* The bar: the same on every page, a line only once the page scrolls. */
  .moin-bar {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 40;
    background: color-mix(in oklab, var(--background) 85%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: moin-bar-line linear both;
    animation-timeline: scroll();
    animation-range: 0 1.5rem;
  }
  .moin-bar-inner {
    display: flex;
    height: 4rem;
    align-items: center;
    gap: var(--space-1);
  }

  /* Floating: over the page, for a public site. */
  .moin-bar[data-float] {
    padding: var(--space-3) var(--space-3) 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
  }
  .moin-bar[data-float] > .moin-bar-inner {
    max-width: 64rem;
    height: 3.5rem;
    margin-inline: auto;
    /* What you press in it nests: its corner is the bar's minus the gap. */
    --bar-gap: 0.375rem;
    padding-inline: var(--space-5) var(--bar-gap);
    border-radius: var(--radius-lg);
    background: color-mix(in oklab, var(--card) 85%, transparent);
    box-shadow: var(--shadow-low), 0 0 0 1px color-mix(in oklab, var(--foreground) 5%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  @media (min-width: 40rem) {
    .moin-bar[data-float] {
      padding-inline: var(--space-6);
    }
    .moin-bar[data-float] > .moin-bar-inner {
      --bar-gap: 0.625rem;
      height: 4rem;
      padding-inline: var(--space-6) var(--bar-gap);
    }
  }

  /* The places of a site, next to its name. On a phone the footer has them. */
  .moin-bar-links {
    display: none;
    align-items: center;
    margin-inline-start: var(--space-3);
  }
  .moin-bar-links > a {
    padding-inline: var(--space-4);
    color: var(--muted-foreground);
  }
  .moin-bar-links > a[aria-current] { color: var(--foreground); }
  @media (min-width: 48rem) {
    .moin-bar-links { display: flex; }
  }
}

@layer moin-components {
  /* Footer: a brand, columns of links, one last line. */
  .moin-footer {
    padding-block: var(--space-8);
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  .moin-footer-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8) var(--space-6);
  }
  .moin-footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    grid-column: 1 / -1;
  }
  .moin-footer-brand > a { color: var(--foreground); }
  .moin-footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .moin-footer-column > h2 {
    margin-block-end: var(--space-2);
    color: var(--foreground);
    font-weight: 500;
  }
  /* Big enough to hit with a finger. */
  .moin-footer-column > a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
  }
  .moin-footer-column > a:hover { color: var(--foreground); }
  .moin-footer-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-6);
    margin-block-start: var(--space-8);
  }
  @media (min-width: 40rem) {
    .moin-footer { padding-block: 4rem var(--space-8); }
    .moin-footer-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  @media (min-width: 64rem) {
    .moin-footer-columns { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); }
    .moin-footer-brand { grid-column: auto; }
  }
}

@layer moin-components {
  /* A badge: a word that labels something. */
  .moin-badge {
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
  }

  /* A mark: a round answer as high as a line. yes, part, no, or blank. */
  .moin-mark {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
  }
  .moin-mark[data-kind="yes"] {
    background: var(--foreground);
    color: var(--background);
  }
  .moin-mark[data-kind="part"] { border: 1px solid color-mix(in oklab, var(--foreground) 40%, transparent); }
  .moin-mark[data-kind="no"] {
    border: 1px solid color-mix(in oklab, var(--muted-foreground) 30%, transparent);
    color: var(--muted-foreground);
  }
  .moin-mark > .moin-icon { width: 0.75rem; height: 0.75rem; }
}

@layer moin-components {
  /* A face: initials, or a picture. */
  .moin-avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    user-select: none;
  }
  .moin-avatar[data-size] {
    width: 4rem;
    height: 4rem;
    font-size: 1.25rem;
  }
  /* A picture in place of the initials. */
  .moin-avatar > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Several people in little space. Each overlaps the one before it. */
  .moin-avatar-group { display: inline-flex; }
  .moin-avatar-group > .moin-avatar { box-shadow: 0 0 0 2px var(--background); }
  .moin-card .moin-avatar-group > .moin-avatar { box-shadow: 0 0 0 2px var(--card); }
  .moin-avatar-group > .moin-avatar + .moin-avatar { margin-inline-start: calc(-1 * var(--space-2)); }
}

@layer moin-components {
  /* App icon: a logo on a white tile in both themes, or a letter on ink. */
  .moin-app-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.375rem;
    overflow: hidden;
    border-radius: 28%;
    background: white;
    box-shadow: 0 0 0 1px color-mix(in oklab, black 8%, transparent);
    font-size: 0.875rem;
    font-weight: 600;
  }
  .moin-app-icon[data-large] { width: 2.75rem; height: 2.75rem; font-size: 1.125rem; }
  .moin-app-icon[data-letter] { background: var(--foreground); color: var(--background); box-shadow: none; }
  .moin-app-icon > img { width: 100%; height: 100%; object-fit: contain; }
}

@layer moin-components {
  /* The logo of something, in front of its name. */
  .moin-logo {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 28%;
    background: var(--foreground);
    color: var(--background);
    font-size: 0.875rem;
    font-weight: 600;
  }
}

@layer moin-components {
  /* An icon in a tinted circle. */
  .moin-bubble {
    --tint: var(--failed);
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    background: color-mix(in oklab, var(--tint) 12%, transparent);
    color: var(--tint);
  }

  /* The dark one, for the one thing to do. */
  .moin-bubble[data-ink] { background: var(--foreground); color: var(--background); }
  /* Square with soft corners, one quiet step above what it sits on. */
  .moin-bubble[data-tile] {
    border-radius: 28%;
    background: color-mix(in oklab, var(--foreground) 8%, transparent);
    color: inherit;
  }
  .moin-bubble[data-tile] > .moin-icon { width: 1rem; height: 1rem; }
}

@layer moin-components {
  /* A line in the page that says what failed, under what sent it. */
  .moin-message {
    padding: var(--space-2) var(--space-5);
    font-size: 0.875rem;
    color: var(--muted-foreground);
  }
  .moin-message[data-state="failed"] { color: var(--failed-text); }
}

@layer moin-components {
  /* Logs and commands: mono on the surface they sit on. */
  .moin-log {
    --tf: var(--card-foreground);
    max-height: 32rem;
    overflow: auto;
    color: color-mix(in oklab, var(--tf) 92%, transparent);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.85;
    font-variant-ligatures: none;
    counter-reset: line;
  }
  /* Every div is one line, in a fold too. data-n sets its number. */
  .moin-log div {
    counter-increment: line;
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    padding-right: var(--space-3);
    white-space: pre-wrap;
    overflow-wrap: break-word;
  }
  .moin-log div::before {
    content: counter(line);
    padding-right: var(--space-3);
    color: color-mix(in oklab, var(--tf) 22%, transparent);
    text-align: right;
    user-select: none;
  }
  .moin-log div[data-n]::before { content: attr(data-n); }
  .moin-log div:hover { background: color-mix(in oklab, var(--tf) 4%, transparent); }
  .moin-log [data-kind="out"] { color: color-mix(in oklab, var(--tf) 50%, transparent); }
  .moin-log [data-kind="step"] > span::before {
    content: "→ ";
    color: color-mix(in oklab, var(--tf) 45%, transparent);
  }
  .moin-log [data-kind="ok"] { color: var(--live); }
  .moin-log [data-kind="ok"] > span::before { content: "✓ "; }
  .moin-log [data-kind="err"] { color: var(--failed); }
  .moin-log [data-kind="err"] > span::before { content: "✗ "; }
  /* What matters less in a line. */
  .moin-log [data-dim] { color: color-mix(in oklab, var(--tf) 42%, transparent); }

  /* The lines between two steps fold into one: a details with its lines
     right in it, and an aria-hidden arrow in its summary. */
  .moin-log details:not(:has(div)) { display: none; }
  .moin-log details[open] { background: color-mix(in oklab, var(--tf) 3%, transparent); }
  .moin-log summary {
    display: flex;
    width: 100%;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-5) 0 2.25rem;
    border-radius: 8px;
    color: color-mix(in oklab, var(--tf) 52%, transparent);
    font: inherit;
    font-weight: 500;
    text-align: left;
    list-style: none;
    outline: none;
    cursor: pointer;
  }
  .moin-log summary::-webkit-details-marker { display: none; }
  .moin-log summary:hover {
    background: color-mix(in oklab, var(--tf) 5%, transparent);
    color: var(--tf);
  }
  .moin-log summary:focus-visible { box-shadow: inset 0 0 0 2px var(--ring); }
  .moin-log summary > [aria-hidden] {
    display: inline-block;
    transition: rotate 0.12s ease-out;
  }
  .moin-log [open] > summary > [aria-hidden] { rotate: 90deg; }

  @media (min-width: 40rem) {
    .moin-log div {
      grid-template-columns: 2.75rem minmax(0, 1fr);
      padding-right: var(--space-5);
    }
    .moin-log div::before { padding-right: var(--space-4); }
    .moin-log summary { padding-left: 2.75rem; }
    /* Two more columns in front of the text, like a time and a service. */
    .moin-log[data-meta] div { grid-template-columns: 2.75rem 4.75rem 5.5rem minmax(0, 1fr); }
  }

  /* Plain output in one pre, with its own line breaks. */
  pre.moin-log {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  /* Lines that keep the newest in view while you are at the bottom and stay
     put when you scroll up. --tail is how high it grows; data-top keeps few
     lines at the top; data-hold keeps the place of lines still to come. */
  .moin-tail {
    display: flex;
    flex-direction: column-reverse;
    max-height: var(--tail, 30rem);
    overflow: auto;
    overscroll-behavior: contain;
    outline: none;
  }
  .moin-tail:focus-visible { box-shadow: inset 0 0 0 2px var(--ring); }
  /* The tail scrolls, not the log in it. */
  .moin-tail > .moin-log {
    max-height: none;
    overflow: visible;
  }
  .moin-tail[data-top] { justify-content: safe flex-end; }
  .moin-tail[data-hold] { height: 20rem; }
  @media (min-width: 40rem) {
    .moin-tail[data-hold] { height: var(--tail, 30rem); }
  }
  @media (min-width: 64rem) {
    .moin-tail[data-tall] { min-height: 18rem; }
  }
}

@layer moin-components {
  /* A table of data. Only its own box scrolls sideways. */
  .moin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.25rem;
    white-space: nowrap;
  }
  .moin-table th {
    padding: var(--space-2) var(--space-4);
    color: var(--muted-foreground);
    font-weight: 500;
    text-align: left;
  }
  .moin-table td {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
  }
  .moin-table td:not(:has(> :is(form, .moin-button, .moin-check))) {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .moin-table :is(th, td):first-child { padding-inline-start: var(--space-6); }
  .moin-table :is(th, td):last-child { padding-inline-end: var(--space-6); }
  .moin-table [data-num] {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .moin-table td[data-null] {
    color: var(--muted-foreground);
    font-style: italic;
  }
  .moin-table tbody tr:hover { background: color-mix(in oklab, var(--foreground) 3%, transparent); }

  /* A column to sort by is a link: the server sorts. */
  .moin-table th a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    outline: none;
  }
  .moin-table th a:hover { color: var(--foreground); }
  .moin-table th a:focus-visible {
    border-radius: var(--radius-sm);
    box-shadow: var(--focus);
  }
  .moin-table th[aria-sort] { color: var(--foreground); }
  .moin-table th[aria-sort] a::after {
    content: "";
    width: 0.875rem;
    height: 0.875rem;
    background: currentColor;
    -webkit-mask: url("ui/icons/chevron-down.svg") center / contain no-repeat;
    mask: url("ui/icons/chevron-down.svg") center / contain no-repeat;
  }
  .moin-table th[aria-sort="ascending"] a::after { rotate: 180deg; }
  .moin-table :is(th, td):has(> .moin-check) { width: 1%; }

  /* A head that stays while the rows scroll under it. */
  .moin-table[data-sticky] th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: var(--press);
    background: var(--card);
  }
  /* A cell that edits itself: the field brings its own space. */
  .moin-table td[data-edit] {
    padding-block: 0;
    padding-inline: var(--space-1);
  }
  .moin-table td[data-edit]:first-child { padding-inline-start: var(--space-3); }
  /* A cell with only a round button in it. */
  .moin-table td:has(> .moin-button[data-icon]) {
    width: 1%;
    padding-block: 0;
    padding-inline: 0 var(--space-2);
    text-align: right;
  }
}

@layer moin-components {
  /* Plain HTML charts: a share, amounts, days, a trend in a row. */
  .moin-meter {
    height: 0.5rem;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--muted);
  }
  .moin-meter > span {
    display: block;
    width: var(--value);
    height: 100%;
    border-radius: inherit;
    background: var(--chart-1);
  }
  .moin-meter[data-state="running"] > span { background: var(--running); }
  .moin-meter[data-state="failed"] > span { background: var(--failed); }

  .moin-bars {
    display: flex;
    height: 7rem;
    align-items: flex-end;
    gap: 3px;
    border-bottom: 1px solid var(--border);
  }
  /* The whole column answers the pointer, not only the bar in it. */
  .moin-bars > i {
    display: flex;
    flex: 1;
    min-width: 2px;
    height: 100%;
    align-items: flex-end;
  }
  .moin-bars > i::before {
    content: "";
    width: 100%;
    height: var(--v);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--chart-1);
  }
  .moin-bars > i:hover::before { background: var(--chart-3); }

  /* A tip next to the pointer, for every chart. */
  .moin-tip {
    position: fixed;
    z-index: 70;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    /* The text color as its ground: it stands out on every surface. */
    background: var(--foreground);
    color: var(--background);
    box-shadow: var(--shadow-float);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
  }
  .moin-ring circle[data-tip],
  .moin-history > i[data-tip],
  .moin-meter[data-tip],
  .moin-bars > i[data-tip],
  moin-spark[data-tip] { cursor: default; }
  .moin-ring:has(circle[data-tip]:hover) circle[data-tip]:not(:hover) { opacity: 0.45; }
  .moin-history > i:hover { opacity: 0.7; }

  .moin-history {
    display: flex;
    height: 1.75rem;
    gap: 2px;
  }
  .moin-history > i {
    flex: 1;
    min-width: 1px;
    border-radius: var(--radius-sm);
    background: var(--live);
  }
  .moin-history > i[data-state="failed"] { background: var(--failed); }
  .moin-history > i[data-state="running"] { background: var(--running); }
  .moin-history > i[data-state="idle"] { background: var(--muted); }

  moin-spark {
    display: inline-block;
    flex: none;
    width: 5rem;
    height: 1.5rem;
    color: var(--chart-1);
  }
  moin-spark > svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  /* A ring: one value, or the parts of a whole. The circle's length is 100,
     so --v is a percent and --at is where it starts. */
  .moin-ring {
    position: relative;
    display: grid;
    width: var(--size, 7rem);
    flex: none;
    aspect-ratio: 1;
    place-items: center;
  }
  .moin-ring > svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    rotate: -90deg;
  }
  .moin-ring circle {
    fill: none;
    stroke: var(--muted);
    stroke-width: 4;
  }
  .moin-ring circle[data-n] {
    stroke: var(--c);
    stroke-dasharray: calc(var(--v) * 1px) calc((100 - var(--v)) * 1px);
    stroke-dashoffset: calc(var(--at, 0) * -1px);
  }
  .moin-ring[data-round] circle[data-n] { stroke-linecap: round; }  [data-n="1"] { --c: var(--chart-1); }
  [data-n="2"] { --c: var(--chart-2); }
  [data-n="3"] { --c: var(--chart-3); }
  [data-n="4"] { --c: var(--chart-4); }
  [data-n="5"] { --c: var(--chart-5); }

  .moin-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  .moin-legend > div {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }
  .moin-legend i {
    flex: none;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: var(--radius-sm);
    background: var(--c);
  }

  /* A chart: the newest values big, the plot under them with a soft area
     under its lines, the scale on its right and the times under it. moin.js
     draws it; until then it keeps its place. */
  moin-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
    min-height: 13.25rem;
  }
  moin-chart [data-ink] { color: var(--chart-1); }
  moin-chart [data-ink="1"] { color: var(--muted-foreground); }
  .moin-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-1) var(--space-4);
    min-height: 2rem;
  }
  .moin-chart-values {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0 var(--space-5);
    min-width: 0;
  }
  .moin-chart-value {
    display: flex;
    flex-direction: column;
  }
  .moin-chart-key {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    line-height: 1rem;
  }
  .moin-chart-key::before {
    content: "";
    width: 0.75rem;
    height: 2px;
    border-radius: var(--radius-sm);
    background: currentColor;
  }
  .moin-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2) var(--space-3);
  }
  .moin-chart-plot {
    position: relative;
    height: 9rem;
    touch-action: pan-y;
    user-select: none;
  }
  .moin-chart-line {
    position: absolute;
    inset-inline: 0;
    border-top: 1px dashed var(--border);
  }
  .moin-chart-line[data-at="top"] { top: 0; }
  .moin-chart-line[data-at="middle"] { top: 50%; }
  .moin-chart-line[data-at="bottom"] { bottom: 0; border-top-style: solid; }
  .moin-chart-plot > svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
  }
  .moin-chart-mark,
  .moin-chart-dot {
    position: absolute;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: var(--radius-full);
    translate: -50% -50%;
  }
  .moin-chart-mark {
    top: var(--y);
    left: var(--x);
    border: 2px solid var(--foreground);
    background: var(--card);
  }
  .moin-chart-dot {
    background: currentColor;
    box-shadow: 0 0 0 2px var(--card);
    pointer-events: none;
  }
  .moin-chart-cursor {
    position: absolute;
    inset-block: 0;
    width: 1px;
    background: color-mix(in oklab, var(--foreground) 30%, transparent);
    translate: -50%;
    pointer-events: none;
  }
  .moin-chart-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-block: calc(-1 * var(--space-2));
    color: var(--muted-foreground);
    font-size: 0.75rem;
    line-height: 1rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
  .moin-chart-times {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--muted-foreground);
    font-size: 0.75rem;
    line-height: 1rem;
    font-variant-numeric: tabular-nums;
  }
}

@layer moin-components {
  /* Code to read and copy. */
  .moin-code {
    /* On this box, quiet text and hovers follow its own text color. */
    --foreground: var(--terminal-foreground);
    --muted-foreground: color-mix(in oklab, var(--terminal-foreground) 65%, transparent);
    position: relative;
    min-width: 0;
    --copy-outer: var(--radius-lg);
    --copy-gap: max(var(--scroll-edge), var(--space-1));
    /* Always a box, also on a card of the same color. */
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--terminal);
    color: var(--terminal-foreground);
  }
  .moin-code > pre {
    max-height: 28rem;
    padding: calc(var(--space-4) - var(--scroll-edge)) calc(var(--space-5) - var(--scroll-edge));
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    font-variant-ligatures: none;
    white-space: pre;
    tab-size: 2;
  }
  .moin-code[data-wrap] > pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .moin-code > .moin-copy {
    position: absolute;
    /* Off the corner also when the theme has no radius. */
    top: var(--copy-gap);
    right: var(--copy-gap);
    background: var(--terminal);
  }
  .moin-code > .moin-copy:hover { background: color-mix(in oklab, var(--foreground) 12%, var(--terminal)); }
  /* Code a highlighter marked. Chroma, Pygments and Rouge write these names. */
  .moin-code :is(.k, .kc, .kd, .kn, .kp, .kr, .kt) { color: var(--code-keyword); }
  .moin-code :is(.s, .s1, .s2, .sa, .sb, .sc, .sd, .se, .sh, .si, .sx) { color: var(--code-string); }
  .moin-code :is(.c, .c1, .ch, .cm, .cp, .cs) { color: var(--code-comment); }
  .moin-code :is(.nf, .fm, .nb) { color: var(--code-function); }
  .moin-code :is(.m, .mb, .mf, .mh, .mi, .mo) { color: var(--code-number); }
}

@layer moin-components {
  /* A range: a real input, a bar and the switch's knob. */
  .moin-range {
    display: block;
    width: 100%;
    height: 1.75rem;
    margin: 0;
    background: none;
    appearance: none;
    outline: none;
    cursor: pointer;
  }
  .moin-range::-webkit-slider-runnable-track {
    height: 0.5rem;
    border-radius: var(--radius-md);
    background: var(--muted);
  }
  .moin-range::-moz-range-track {
    height: 0.5rem;
    border-radius: var(--radius-md);
    background: var(--muted);
  }
  .moin-range::-webkit-slider-thumb {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: -0.5rem;
    border-radius: max(0px, calc(var(--radius-md) - 2px));
    background: var(--foreground);
    box-shadow: var(--shadow-low);
    appearance: none;
  }
  .moin-range::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: max(0px, calc(var(--radius-md) - 2px));
    background: var(--foreground);
    box-shadow: var(--shadow-low);
  }
  .moin-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
  .moin-range:focus-visible::-moz-range-thumb { box-shadow: var(--focus); }
}

@layer moin-components {
  /* A file: the browser's own picker, its button in our shape. */
  .moin-file {
    display: block;
    width: 100%;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
  }
  .moin-file::file-selector-button {
    height: var(--press);
    margin-inline-end: var(--space-3);
    padding-inline: var(--space-5);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--muted);
    color: var(--foreground);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
  }
  .moin-file:focus-visible::file-selector-button { box-shadow: var(--focus); }
}

@layer moin-components {
  /* A one-time code: one input, wide apart. */
  .moin-input.moin-otp {
    max-width: 16rem;
    font-family: var(--font-mono);
    letter-spacing: 0.5em;
    text-align: center;
  }
}

@layer moin-components {
  /* A key on the keyboard. */
  .moin-kbd {
    display: inline-flex;
    min-width: 1.5rem;
    height: 1.5rem;
    align-items: center;
    justify-content: center;
    padding-inline: var(--space-1);
    border-radius: var(--radius-sm);
    background: var(--muted);
    color: var(--muted-foreground);
    font-family: var(--font-mono);
    font-size: 0.75rem;
  }
}

@layer moin-components {
  /* A thin line between two things that belong apart. */
  .moin-separator {
    height: 1px;
    margin: 0;
    border: 0;
    background: var(--border);
  }
  .moin-separator[aria-orientation="vertical"] {
    width: 1px;
    height: auto;
    align-self: stretch;
  }
}

@layer moin-components {
  /* Waiting: a spinner when you do not know how long, a skeleton for the
     shape of what is coming. */
  .moin-spinner {
    display: inline-block;
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--muted);
    border-top-color: var(--foreground);
    border-radius: var(--radius-full);
    animation: moin-spin 0.7s linear infinite;
  }
  .moin-skeleton {
    display: block;
    width: var(--w, 100%);
    height: 1rem;
    border-radius: var(--radius-md);
    background: var(--muted);
    animation: moin-pulse 1.6s ease-in-out infinite;
  }
}

@layer moin-components {
  /* Nothing here yet: what is missing and the one thing to do about it. */
  .moin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-8) var(--pad);
    text-align: center;
  }
}

@layer moin-components {
  /* Something the page has to say, in the page. Nothing floats. */
  .moin-alert {
    --tint: var(--idle);
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    background: color-mix(in oklab, var(--tint) 14%, var(--card));
    color: var(--card-foreground);
  }
  .moin-alert > .moin-icon { color: var(--tint); }
  .moin-alert[data-state="live"] { --tint: var(--live); }
  .moin-alert[data-state="running"] { --tint: var(--running); }
  .moin-alert[data-state="failed"] { --tint: var(--failed); }
  /* A strip across the page that stays while it scrolls. */
  .moin-alert[data-sticky] {
    position: sticky;
    top: 0;
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding-block: var(--space-1);
    border-radius: 0;
  }
}

@layer moin-components {
  /* Steps of one job: done, this one, still to come. */
  .moin-steps {
    display: flex;
    gap: var(--space-3);
    counter-reset: step;
  }
  .moin-steps > li {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    counter-increment: step;
  }
  .moin-steps > li::before {
    content: counter(step);
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border-radius: var(--radius-full);
    background: var(--muted);
    font-weight: 500;
  }
  .moin-steps > li:is([aria-current], [data-done]) { color: var(--foreground); }
  .moin-steps > li:is([aria-current], [data-done])::before {
    background: var(--primary);
    color: var(--primary-foreground);
  }
  .moin-steps > li[data-done]::before { content: "✓"; }
}

@layer moin-components {
  /* What happened, newest first. */
  .moin-timeline > li {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 0 var(--space-5) var(--space-6);
  }
  .moin-timeline > li:last-child { padding-bottom: 0; }
  .moin-timeline > li::before {
    content: "";
    position: absolute;
    top: 0.4375rem;
    left: 0;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: var(--radius-full);
    background: var(--foreground);
  }
  .moin-timeline > li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.375rem;
    bottom: 0.1875rem;
    left: 0.28125rem;
    width: 1px;
    background: var(--border);
  }
}

@layer moin-components {
  /* A month to pick from. It fills its place: the container sets the width,
     the columns share it and the height of a day never changes. */
  .moin-calendar {
    display: block;
    width: 100%;
  }
  /* months="2": side by side, the arrows on the outside. A phone shows one. */
  .moin-calendar-month + .moin-calendar-month { display: none; }
  @media (min-width: 40rem) {
    .moin-calendar-months {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(0, 1fr);
      gap: var(--space-8);
    }
    .moin-calendar-month + .moin-calendar-month { display: block; }
    .moin-calendar-month:not(:last-child) [data-step="1"],
    .moin-calendar-month:not(:first-child) [data-step="-1"] { visibility: hidden; }
  }
  .moin-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--space-2);
  }
  .moin-calendar-title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
  }
  .moin-calendar-title:hover { background: var(--muted); }
  .moin-calendar-title:focus-visible { box-shadow: var(--focus); }

  /* Always six weeks, so paging never changes the height. */
  .moin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: auto repeat(6, var(--press));
    row-gap: 2px;
    text-align: center;
  }
  .moin-calendar-grid > span {
    padding-block: var(--space-1);
    color: var(--muted-foreground);
    font-size: 0.75rem;
  }
  /* The button is the whole cell and carries the band of a range. The span
     in it is the circle, the same size at any width. */
  .moin-calendar-grid > button {
    display: grid;
    place-items: center;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    outline: none;
  }
  .moin-calendar-grid > button > span {
    display: grid;
    place-items: center;
    width: min(100%, var(--press));
    aspect-ratio: 1;
    border-radius: var(--radius-md);
  }
  .moin-calendar-grid > button:hover > span { background: var(--muted); }
  .moin-calendar-grid > button:focus-visible > span { box-shadow: var(--focus); }
  .moin-calendar-grid > button[aria-current] { font-weight: 700; }
  .moin-calendar-grid > button[data-between] { background: var(--muted); }
  .moin-calendar-grid > button[data-start] { background: linear-gradient(to right, transparent 50%, var(--muted) 50%); }
  .moin-calendar-grid > button[data-end] { background: linear-gradient(to left, transparent 50%, var(--muted) 50%); }
  /* The band rounds off where a week begins and ends. */
  .moin-calendar-grid > :nth-child(7n + 1):is([data-between], [data-end]) {
    border-start-start-radius: var(--radius-md);
    border-end-start-radius: var(--radius-md);
  }
  .moin-calendar-grid > :nth-child(7n):is([data-between], [data-start]) {
    border-start-end-radius: var(--radius-md);
    border-end-end-radius: var(--radius-md);
  }
  .moin-calendar-grid > button[aria-pressed="true"] > span {
    background: var(--primary);
    color: var(--primary-foreground);
  }
  .moin-calendar-grid > button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .moin-calendar-grid > button:disabled:hover > span { background: none; }

  /* The months of a year, in the place of the days. */
  .moin-calendar-pick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, 1fr);
    gap: var(--space-1);
    min-height: calc(6 * var(--press) + 12px + 1.625rem);
  }
  .moin-calendar-pick > button {
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
  }
  .moin-calendar-pick > button:hover { background: var(--muted); }
  .moin-calendar-pick > button:focus-visible { box-shadow: var(--focus); }
  .moin-calendar-pick > button[aria-current] { font-weight: 700; }
  .moin-calendar-pick > button[aria-pressed="true"] {
    background: var(--primary);
    color: var(--primary-foreground);
  }
  .moin-calendar-pick > button:disabled {
    background: none;
    opacity: 0.4;
    cursor: not-allowed;
  }
}

@layer moin-components {
  /* Prose: docs and articles. One class on what holds the markdown. */
  /* It stops at a preview and at code: those look like themselves. */
  @scope (.moin-prose) to (.moin-preview > *, .moin-code > *) {
    :scope { line-height: 1.7; }
    :scope > * + * { margin-block-start: var(--space-4); }
    :is(h1, h2, h3) {
      font-family: var(--font-heading);
      font-weight: var(--weight-title);
      letter-spacing: var(--tracking-title);
    }
    h1 { font-size: 1.875rem; line-height: 2.25rem; }
    h2 { margin-block-start: var(--space-8); font-size: 1.5rem; line-height: 2rem; }
    h3 { margin-block-start: var(--space-6); font-size: 1.125rem; line-height: 1.75rem; }
    a { text-decoration: underline; text-underline-offset: 0.2em; }
    ul { padding-inline-start: 1.25rem; list-style: disc; }
    ol { padding-inline-start: 1.25rem; list-style: decimal; }
    :not(pre) > code {
      padding: 0.125em 0.375em;
      border-radius: var(--radius-sm);
      background: var(--muted);
      font-family: var(--font-mono);
      font-size: 0.875em;
    }
    pre {
      padding: var(--space-4) var(--space-5);
      overflow-x: auto;
      border-radius: var(--radius-lg);
      background: var(--terminal);
      color: var(--terminal-foreground);
      font-family: var(--font-mono);
      font-size: 0.8125rem;
    }
    blockquote {
      padding-inline-start: var(--space-4);
      border-inline-start: 2px solid var(--border);
      color: var(--muted-foreground);
    }
    hr {
      height: 1px;
      border: 0;
      background: var(--border);
    }
    img {
      max-width: 100%;
      border-radius: var(--radius-lg);
    }
    /* A table: a line between its rows. Only its own box scrolls sideways. */
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
      line-height: 1.5;
    }
    th {
      padding: var(--space-2) var(--space-3);
      color: var(--muted-foreground);
      font-weight: 500;
      text-align: left;
      white-space: nowrap;
    }
    td {
      padding: var(--space-2) var(--space-3);
      border-top: 1px solid var(--border);
      vertical-align: top;
    }
    tr > :first-child { padding-inline-start: 0; }
    tr > :last-child { padding-inline-end: 0; }
  }
}

@layer moin-components {
  /* Preview: something shown live, its code behind a button. */
  .moin-preview {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }
  .moin-preview-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    min-height: 12rem;
    padding: var(--space-8) var(--space-6);
  }
  .moin-preview-stage > * { max-width: 100%; }
  .moin-preview-stage > :is(.moin-list, .moin-card, .moin-grid, .moin-columns, .moin-stack, .moin-field, .moin-code, .moin-command, .moin-alert, .moin-prose, .moin-steps, .moin-timeline, .moin-scroll, .moin-empty, .moin-history, .moin-footer, form, section, header, nav:not(.moin-tabs, .moin-breadcrumb, .moin-row), moin-calendar, moin-chart) { width: 100%; }

  /* What fills a whole page stays in the flow here. */
  .moin-preview-stage .moin-bar { position: static; }
  .moin-preview-stage .moin-centered { min-height: 0; }
  .moin-preview-stage .moin-hero { --bar: 0rem; min-height: 0; }
  .moin-preview-stage .moin-hero > :last-child { height: 8rem; }
  .moin-preview-stage .moin-band { --band: 2rem; }

  /* Pull the corner to watch it answer. */
  .moin-preview-stage[data-resize] {
    align-items: stretch;
    max-width: 100%;
    min-width: 10rem;
    overflow: auto;
    resize: horizontal;
  }

  /* A whole page in a frame. */
  .moin-preview-stage:has(> iframe) { padding: 0; }
  .moin-preview-stage > iframe {
    display: block;
    width: 100%;
    height: min(48rem, 80svh);
    border: 0;
  }

  .moin-preview-source { border-top: 1px solid var(--border); }
  .moin-preview-source > summary::-webkit-details-marker { display: none; }
  .moin-preview-source > summary .moin-chevron { transition: rotate var(--fast) var(--ease); }
  .moin-preview-source[open] > summary .moin-chevron { rotate: 90deg; }
  .moin-preview-source > summary {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    list-style: none;
    padding: var(--space-3) var(--space-5);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    cursor: pointer;
  }
  .moin-preview-source > summary:hover,
  .moin-preview-source[open] > summary { color: var(--foreground); }
  .moin-preview-source > summary:focus-visible {
    outline: none;
    box-shadow: inset var(--focus);
  }
  .moin-preview-source > .moin-code {
    border: 0;
    border-radius: 0;
  }
}

@layer moin-components {
  /* Where you are, and the way up. */
  .moin-breadcrumb > ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
  }
  .moin-breadcrumb li {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }
  .moin-breadcrumb li + li::before {
    content: "";
    width: 1rem;
    height: 1rem;
    background: currentColor;
    -webkit-mask: url("ui/icons/chevron-right.svg") center / contain no-repeat;
    mask: url("ui/icons/chevron-right.svg") center / contain no-repeat;
  }
  .moin-breadcrumb a { outline: none; }
  .moin-breadcrumb a:hover { color: var(--foreground); }
  .moin-breadcrumb a:focus-visible {
    border-radius: var(--radius-sm);
    box-shadow: var(--focus);
  }
  .moin-breadcrumb [aria-current] { color: var(--foreground); }
}

@layer moin-components {
  @media (prefers-reduced-motion: reduce) {
    .moin-dot,
    .moin-skeleton,
    .moin-bar { animation: none; }
  }
}

@keyframes moin-breathe {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--live) 55%, transparent); }
  70% { box-shadow: 0 0 0 4px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes moin-pulse {
  50% { opacity: 0.5; }
}
@keyframes moin-blink {
  50% { opacity: 0.35; }
}
@keyframes moin-bar-line {
  from { box-shadow: 0 1px 0 transparent; }
  to { box-shadow: 0 1px 0 var(--border); }
}

/* The hub's own CSS, on top of moin UI: its fonts, the spinner of a running
   htmx request, the feedback of hub.js, and the art of the home page.
   Everything else is moin UI. */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist/geist-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist/geist-mono-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-heading: "Geist", ui-sans-serif, system-ui, sans-serif;
}

:is(button.htmx-request, form.htmx-request button[type="submit"]) {
  position: relative;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

:is(button.htmx-request, form.htmx-request button[type="submit"]) > * {
  visibility: hidden;
}

:is(button.htmx-request, form.htmx-request button[type="submit"])::after {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 1rem;
  height: 1rem;
  content: "";
  border: 2px solid var(--muted-foreground);
  border-top-color: var(--foreground);
  border-radius: 9999px;
  animation: hub-spin 0.7s linear infinite;
}


@keyframes hub-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Feedback (DESIGN.md): a button that did its job shows a check in place of
   its label for a moment, at the same size; a line in the page under its
   row or form says what failed. hub.js sets both. */
[data-done] {
  position: relative;
  color: transparent !important;
}
[data-done] > * {
  visibility: hidden;
}
[data-done]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.125rem;
  height: 1.125rem;
  background: var(--foreground);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.moin-button[data-kind="primary"][data-done]::after {
  background: var(--primary-foreground);
}
[data-said] {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
header + [data-said] {
  padding-inline: 0;
}
[data-said="failed"] {
  color: var(--failed);
}


/* The wall of containers at the bottom of the home page's last card, out to
   its edges and round with its corners. light-dark() takes colors only, so
   every shade is a whole color with its alpha. */
.hub-harbor-in-card {
  height: clamp(9rem, 24vw, 18rem);
  margin-bottom: calc(-1 * var(--pad));
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
/* Gulls over the wall, on its right, just above it. */
.hub-gulls {
  align-self: flex-end;
  width: clamp(5rem, 12vw, 8rem);
  margin: 0 8% calc(-1 * var(--space-4)) 0;
  fill: none;
  stroke: var(--muted-foreground);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}
.hub-harbor {
  display: block;
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  user-select: none;
}
.hub-harbor-shade { stop-color: light-dark(rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.6)); }
.hub-harbor-card { fill: var(--card); }
.hub-harbor-muted { fill: var(--muted); }
.hub-harbor-ink { fill: var(--foreground); }
.hub-harbor-tint-5 { fill: color-mix(in oklab, var(--foreground) 5%, transparent); }
.hub-harbor-tint-9 { fill: color-mix(in oklab, var(--foreground) 9%, transparent); }
.hub-harbor-side { fill: light-dark(rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.5)); }
.hub-harbor-foot { fill: light-dark(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.65)); }
.hub-harbor-on-ink { fill: var(--background); }
.hub-harbor-on-steel { fill: var(--foreground); }
.hub-harbor-owner { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; opacity: 0.55; }
.hub-harbor-type { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; opacity: 0.45; }
.hub-harbor-app { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; opacity: 0.60; }
.hub-harbor-app[data-ink] { opacity: 0.85; }
.hub-harbor-rib { fill: color-mix(in oklab, var(--foreground) 7.5%, transparent); }
.hub-harbor-rib-ink { fill: color-mix(in oklab, var(--background) 14%, transparent); }
.hub-harbor-rail { fill: color-mix(in oklab, var(--foreground) 10%, transparent); }
.hub-harbor-rail-ink { fill: color-mix(in oklab, var(--background) 12%, transparent); }
