/* @alpenstart/design-system 0.7.0: tokens/heyo-ink-public.css, tokens/heyo-ink-staff.css, base.css, components/button.css, components/hero.css, components/page.css, components/content.css, components/status.css, components/score.css, components/board.css. Built by packages/site, do not edit. */
/*
 * Heyo Ink tokens for public pages. Generated by @alpenstart/design-system from brands/heyo-ink.brand.ts.
 * Everything in heyo-ink.css except the staff tokens. Staff screens add heyo-ink-staff.css.
 * Do not edit: change the brand file and run pnpm brands. Report: docs/brands/heyo-ink.md
 */
@layer tokens, base, components, app;

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

    /* Neutrals */
    --bg: #faf6ee;
    --surface: #fffdf8;
    --surface-sunk: #f2ece1;
    --surface-hover: #f6f1e8;
    --fg: #232a45;
    --fg-muted: #5a5864;
    --border-subtle: #e8e1d5;
    --border-strong: #7b746b;

    /* Primary: the trust colour. Actions, links, focus */
    --primary: #2e5590;
    --primary-hover: #264a7e;
    --primary-pressed: #1e3c68;
    --primary-subtle: #e7eaf3;
    --primary-foreground: #ffffff;

    /* Pop hues: fills only, always with --ink text on top */
    --lime: #f6d584;
    --coral: #ffb894;
    --sky: #c3c8f2;
    --lilac: #f4bfd3;
    --ink: #232a45;

    /* Feedback */
    --danger: #b4232a;
    --danger-foreground: #ffffff;
    --success: #11663c;
    --warning: #7a4a00;
    --disabled-fg: #74717a;
    --disabled-bg: #f2ece1;

    /* Selection: the highlighter */
    --selected-bg: var(--lime);
    --selected-fg: var(--ink);
    --selected-border: var(--ink);

    /* Focus */
    --ring: #2e5590;
    --focus-width: 2px;
    --focus-offset: 2px;

    /* Brand only: logo and siblings */
    --logo-disc: #232a45;
    --logo-slot: #d9662a;
    --logo-lines: #faf6ee;
    --sibling-primary: #3446e0;
    --sibling-slot: #ffd84d;
    --sibling-subtle: #e8eaff;
    --sibling-fg: #1a1726;

    /* Type */
    --font-display: 'Bricolage Grotesque', 'Pretendard', system-ui, sans-serif;
    --font-sans: 'Bricolage Grotesque', 'Pretendard', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --text-caption: 0.75rem;
    --text-sm: 0.875rem;
    --text-body: 1rem;
    --text-lead: 1.125rem;
    --text-h3: 1.25rem;
    --text-h2: 1.5rem;
    --text-h1: 2rem;
    --text-display: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
    --text-display-korean: clamp(1.875rem, 1.25rem + 3vw, 3rem);
    --leading-tight: 1.1;
    --leading-heading: 1.2;
    --leading-body: 1.5;
    --leading-table: 1.43;
    --tracking-display: -0.02em;
    --tracking-heading: -0.01em;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-bold: 700;
    --weight-display: 800;

    /* Spacing, 4px base */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* Lines and icons */
    --hairline: 1px;
    --icon-size: 1.25em;
    --icon-size-small: 1em;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Elevation */
    --shadow-sticker: 0 2px 0 var(--ink);

    /* Motif: the slot arc */
    --slot-arc: #2e5590;
    --slot-arc-width: 4px;
    --slot-arc-size: 60%;

    /* Sizes */
    --width-form: 35rem;
    --measure: 60ch;
    --measure-heading: 22ch;
    --width-page: 90rem;
    --width-rail: 20rem;
    --target-min: 2.75rem;
    --header-height: 3.5rem;

    /* Density: fine pointer defaults. Coarse pointers get 44 below */
    --control-height: 2.25rem;
    --control-height-small: 2rem;

    /* Motion: CSS only */
    --motion-instant: 0ms;
    --motion-1: 100ms;
    --motion-2: 150ms;
    --motion-3: 200ms;
    --motion-4: 250ms;
    --motion-5: 400ms;
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);

    /* Layers: stacking order, lowest first */
    --z-index-raised: 1;
    --z-index-sticky: 10;

    /* Breakpoints, for reference and script: custom properties cannot drive a media query, so CSS repeats these values */
    --breakpoint-narrow: 30rem;
    --breakpoint-tablet: 40rem;
    --breakpoint-medium: 48rem;
    --breakpoint-desktop: 64rem;
  }

  /* Touch: every control back to 44 */
  @media (pointer: coarse) {
    :root {
      --control-height: var(--target-min);
      --control-height-small: var(--target-min);
    }
  }

  @media (prefers-color-scheme: dark) {
    :root:not(.light) {
      color-scheme: dark;
      --bg: #17151b;
      --surface: #1f1c24;
      --surface-sunk: #110f15;
      --surface-hover: #27242d;
      --fg: #eee8de;
      --fg-muted: #b3aca3;
      --border-subtle: #2f2b35;
      --border-strong: #7a7380;
      --primary: #9db8ec;
      --primary-hover: #b6caf1;
      --primary-pressed: #cddbf6;
      --primary-subtle: #26304a;
      --primary-foreground: #17151b;
      --ink: #17151b;
      --danger: #ff9b98;
      --danger-foreground: #17151b;
      --success: #68d49b;
      --warning: #e5b05b;
      --disabled-fg: #837c86;
      --disabled-bg: #110f15;
      --selected-border: var(--lime);
      --ring: #9db8ec;
      --lime: #e3c67e;
      --coral: #e8ae90;
      --sky: #b3b7e0;
      --lilac: #ddb3c3;
      --logo-disc: #eee8de;
      --logo-slot: #c25a26;
      --logo-lines: #17151b;
      --sibling-primary: #5262f5;
      --sibling-subtle: #262a52;
      --sibling-fg: #f3efe8;
      --shadow-sticker: none;
    }
  }

  /* Same values as the media block, for a forced dark theme */
  :root.dark {
    color-scheme: dark;
    --bg: #17151b;
    --surface: #1f1c24;
    --surface-sunk: #110f15;
    --surface-hover: #27242d;
    --fg: #eee8de;
    --fg-muted: #b3aca3;
    --border-subtle: #2f2b35;
    --border-strong: #7a7380;
    --primary: #9db8ec;
    --primary-hover: #b6caf1;
    --primary-pressed: #cddbf6;
    --primary-subtle: #26304a;
    --primary-foreground: #17151b;
    --ink: #17151b;
    --danger: #ff9b98;
    --danger-foreground: #17151b;
    --success: #68d49b;
    --warning: #e5b05b;
    --disabled-fg: #837c86;
    --disabled-bg: #110f15;
    --selected-border: var(--lime);
    --ring: #9db8ec;
    --lime: #e3c67e;
    --coral: #e8ae90;
    --sky: #b3b7e0;
    --lilac: #ddb3c3;
    --logo-disc: #eee8de;
    --logo-slot: #c25a26;
    --logo-lines: #17151b;
    --sibling-primary: #5262f5;
    --sibling-subtle: #262a52;
    --sibling-fg: #f3efe8;
    --shadow-sticker: none;
  }

  /* Script rules. Set lang on <html> from the active locale */
  :lang(ko) {
    --leading-tight: 1.2;
    --leading-heading: 1.3;
    --leading-body: 1.6;
    --leading-table: 1.5;
    --tracking-display: -0.03em;
    --tracking-heading: -0.02em;
    --weight-display: 800;
    --font-display: 'Bricolage Grotesque Korean', 'Pretendard', system-ui, sans-serif;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
}

/*
 * Heyo Ink staff tokens. Generated by @alpenstart/design-system from brands/heyo-ink.brand.ts.
 * Load with heyo-ink-public.css. Together they declare exactly what heyo-ink.css declares.
 * Do not edit: change the brand file and run pnpm brands. Report: docs/brands/heyo-ink.md
 */
@layer tokens, base, components, app;

@layer tokens {
  :root {
    /* Pop roles: components use these */
    --pop-attention: var(--coral);
    --pop-progress: var(--sky);
    --pop-client: var(--lilac);
    --pop-positive: #c9e2a8;

    /* Selection: the highlighter */
    --row-selected-bg: var(--primary-subtle);
    --row-selected-bar: var(--primary);

    /* Type roles for working screens: a tool tops out at 24 */
    --text-page-title: var(--text-h2);
    --text-section-title: var(--text-lead);
    --text-table: var(--text-sm);
    --text-table-header: var(--text-caption);

    /* Elevation */
    --shadow-popover: 0 1px 3px rgb(35 42 69 / 0.12), 0 1px 2px -1px rgb(35 42 69 / 0.12);
    --shadow-dialog: 0 10px 15px -3px rgb(35 42 69 / 0.12), 0 4px 6px -4px rgb(35 42 69 / 0.12);
    --overlay: rgb(35 42 69 / 0.48);

    /* Sizes */
    --width-dialog: 35rem;
    --width-dialog-wide: 45rem;

    /* Density: fine pointer defaults. Coarse pointers get 44 below */
    --row-height-compact: 2.5rem;
    --row-height-comfortable: 3rem;
    --cell-padding-block: var(--space-2);
    --cell-padding-inline: var(--space-3);

    /* Layers: stacking order, lowest first */
    --z-index-overlay: 20;
    --z-index-toast: 30;
    --z-index-banner: 40;
  }

  /* Touch: every control back to 44 */
  @media (pointer: coarse) {
    :root {
      --row-height-compact: var(--target-min);
    }
  }

  @media (prefers-color-scheme: dark) {
    :root:not(.light) {
      --pop-positive: #b5cc99;
      --shadow-popover: none;
      --shadow-dialog: none;
      --overlay: rgb(0 0 0 / 0.64);
    }
  }

  /* Same values as the media block, for a forced dark theme */
  :root.dark {
    --pop-positive: #b5cc99;
    --shadow-popover: none;
    --shadow-dialog: none;
    --overlay: rgb(0 0 0 / 0.64);
  }
}

/*
 * Base: element defaults, focus and helpers. Every class the package owns starts with ds-.
 * Layer order is declared first in every entry point, so load order never decides the cascade.
 */
@layer tokens, base, components, app;

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

  body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: var(--weight-regular) var(--text-body) / var(--leading-body) var(--font-sans);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
  }

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

  h1,
  h2,
  h3 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-heading);
    letter-spacing: var(--tracking-heading);
  }

  a {
    color: var(--primary);
    text-underline-offset: 3px;
  }

  /* Controls: the house ring. Kept apart from the tile :has() rule in tile.css on purpose */
  :focus-visible,
  [data-focus-visible] {
    outline: var(--focus-width) solid var(--ring);
    outline-offset: var(--focus-offset);
  }

  /* Headings take focus on arrival for screen readers only: no ring. After the rule above */
  :is(h1, h2)[tabindex='-1']:focus {
    outline: none;
  }

  .ds-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .ds-icon {
    width: var(--icon-size);
    height: var(--icon-size);
    flex: none;
    fill: none;
    stroke: currentcolor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ds-icon[data-size='small'] {
    width: var(--icon-size-small);
    height: var(--icon-size-small);
  }

  .ds-numeric {
    font-variant-numeric: tabular-nums;
  }
}

/*
 * Button. Works on React Aria Button (data-hovered, data-pressed, data-disabled,
 * data-pending) and on a native <button class="ds-button"> (:hover, :active, :disabled) alike, so
 * pages that ship no React Aria keep the same look.
 */
@layer tokens, base, components, app;

@layer tokens {
  :where(:root) {
    --button-border-width: 2px;
    --button-font-size: var(--text-sm);
    --button-font-size-large: var(--text-body);
    --button-height: var(--control-height);
    --button-height-large: var(--target-min);
    --button-height-small: var(--control-height-small);
    --button-padding-inline: var(--space-4);
    --button-padding-inline-large: var(--space-5);
    --button-padding-inline-small: var(--space-3);
    --button-press-offset: 1px;
    --button-secondary-border: var(--border-strong);
  }
}

@layer components {
  .ds-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--button-height);
    padding: 0 var(--button-padding-inline);
    border: var(--button-border-width) solid transparent;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-size: var(--button-font-size);
    font-weight: var(--weight-bold);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .ds-button[data-variant='primary'] {
    background: var(--primary);
    color: var(--primary-foreground);
  }

  .ds-button[data-variant='primary']:is([data-hovered], :not([data-rac]):hover) {
    background: var(--primary-hover);
  }

  .ds-button[data-variant='primary']:is([data-pressed], :not([data-rac]):active) {
    background: var(--primary-pressed);
  }

  .ds-button[data-variant='secondary'] {
    border-color: var(--button-secondary-border);
    background: var(--surface);
  }

  .ds-button:is([data-variant='secondary'], [data-variant^='quiet']):is(
      [data-hovered],
      :not([data-rac]):hover
    ) {
    background: var(--surface-hover);
  }

  .ds-button[data-variant='danger'] {
    background: var(--danger);
    color: var(--danger-foreground);
  }

  .ds-button[data-variant^='quiet'] {
    padding: 0 var(--space-3);
    color: var(--primary);
  }

  .ds-button[data-variant='quiet-danger'] {
    color: var(--danger);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .ds-button[data-size='small'] {
    min-height: var(--button-height-small);
    padding: 0 var(--button-padding-inline-small);
    font-weight: var(--weight-medium);
  }

  /* Public pages: the 44px target on every pointer, a body-size label */
  .ds-button[data-size='large'] {
    min-height: var(--button-height-large);
    padding: 0 var(--button-padding-inline-large);
    font-size: var(--button-font-size-large);
  }

  /* A quiet button keeps its tight padding at the large size */
  .ds-button[data-size='large'][data-variant^='quiet'] {
    padding: 0 var(--space-3);
  }

  .ds-button[data-block] {
    width: 100%;
  }

  .ds-button:is([data-disabled], [data-pending], :disabled) {
    border-color: var(--border-subtle);
    background: var(--disabled-bg);
    color: var(--disabled-fg);
    cursor: not-allowed;
  }

  @media (prefers-reduced-motion: no-preference) {
    .ds-button {
      transition: background-color var(--motion-1) var(--ease-out);
    }

    .ds-button:is([data-pressed], :not([data-rac]):active):not([data-disabled], :disabled) {
      transform: translateY(var(--button-press-offset));
    }
  }

  @media (forced-colors: active) {
    .ds-button {
      border-color: ButtonBorder;
    }
  }
}

/*
 * Hero: the one loud block per screen, with an optional decoration off the top right corner.
 * Inside it the focus ring and the primary action take the hero's colours, so both stay visible on
 * the hero ground. The brand build checks every pair in both themes.
 */
@layer tokens, base, components, app;

@layer tokens {
  :where(:root) {
    --hero-bg: var(--primary);
    --hero-decoration-colour: color-mix(in srgb, var(--hero-fg) var(--hero-decoration-share), transparent);
    --hero-decoration-inset: -3.5rem;
    --hero-decoration-share: 22%;
    --hero-decoration-size: 12.5rem;
    --hero-fg: var(--primary-foreground);
    --hero-padding-top: var(--space-6);
    --hero-radius: var(--radius-xl);
  }
}

@layer components {
  .ds-hero {
    position: relative;
    display: grid;
    gap: var(--space-3);
    overflow: hidden;
    padding: var(--hero-padding-top) var(--space-5) var(--space-5);
    border-radius: var(--hero-radius);
    background: var(--hero-bg);
    color: var(--hero-fg);
  }

  /*
   * Set on the children, not the hero itself, so an app that sets --hero-bg or --hero-fg on the
   * hero element can never make these references circular. The page ring and primary fill would
   * vanish on a hero painted in the primary colour
   */
  .ds-hero > * {
    --ring: var(--hero-fg);
    --primary: var(--hero-fg);
    --primary-hover: var(--hero-fg);
    --primary-pressed: var(--hero-fg);
    --primary-foreground: var(--hero-bg);
  }

  /* Hover and press underline the label and never tint the fill: a tint can drop it under 4.5:1 */
  .ds-hero
    .ds-button[data-variant='primary']:is(
      [data-hovered],
      [data-pressed],
      :not([data-rac]):hover,
      :not([data-rac]):active
    ) {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* A secondary button is an outline in the hero text colour, beside the inverted primary */
  .ds-hero .ds-button[data-variant='secondary'] {
    border-color: var(--hero-fg);
    background: transparent;
    color: var(--hero-fg);
  }

  /* Quiet and secondary take the hero text colour, so hover keeps the hero ground and underlines */
  .ds-hero
    .ds-button:is([data-variant^='quiet'], [data-variant='secondary']):is(
      [data-hovered],
      [data-pressed],
      :not([data-rac]):hover,
      :not([data-rac]):active
    ) {
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .ds-hero-title {
    position: relative;
    max-width: 14ch;
    font-size: var(--text-display);
    font-weight: var(--weight-display);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-display);
  }

  :root:lang(ko) .ds-hero-title {
    max-width: 11em;
    font-size: var(--text-display-korean);
  }

  /*
   * The decoration sits off the top right corner, cropped by the hero; stroke it with the class
   * below. It never reaches below the title's first line, so only large text ever crosses it.
   * Its type matches the title, so 1lh is one title line, and the hero's top padding plus that line
   * minus the (negative) inset is the most it may measure
   */
  .ds-hero-decoration {
    position: absolute;
    top: var(--hero-decoration-inset);
    right: var(--hero-decoration-inset);
    width: min(
      var(--hero-decoration-size),
      calc(var(--hero-padding-top) + 1lh - var(--hero-decoration-inset))
    );
    height: min(
      var(--hero-decoration-size),
      calc(var(--hero-padding-top) + 1lh - var(--hero-decoration-inset))
    );
    font-size: var(--text-display);
    line-height: var(--leading-tight);
    pointer-events: none;
  }

  :root:lang(ko) .ds-hero-decoration {
    font-size: var(--text-display-korean);
  }

  .ds-hero-decoration > svg {
    width: 100%;
    height: 100%;
    fill: none;
  }

  .ds-hero-decoration-stroke {
    stroke: var(--hero-decoration-colour);
  }

  .ds-hero > :not(.ds-hero-decoration) {
    position: relative;
  }
}

/*
 * Public page shell, no JavaScript: a skip link, a sticky full-width header, main and a footer,
 * each holding one centred content column, plus sections with a heading and a feature grid.
 *
 * <a class="ds-skip-link ds-button" data-variant="secondary" data-size="large" href="#main-title">
 * <div class="ds-page">
 *   <header class="ds-site-header"><div class="ds-page-content">
 *     <img class="ds-logo" ...> <nav class="ds-site-header-actions"> ... </nav>
 *   </div></header>
 *   <main> <section class="ds-page-content ds-section"> ... </section> </main>
 *   <footer class="ds-site-footer"><div class="ds-page-content"> ... </div></footer>
 * </div>
 */
@layer tokens, base, components, app;

@layer tokens {
  :where(:root) {
    --logo-height: calc(var(--space-6) + var(--space-2));
    --logo-height-small: var(--space-6);
    --page-padding: var(--space-4);
    --page-padding-wide: var(--space-6);
    --page-width: var(--width-page);
    --section-padding-block: var(--space-7);
    --section-padding-block-wide: var(--space-8);
    --site-header-height: var(--header-height);
  }
}

@layer components {
  /* Anchor targets land below the sticky header */
  :root:has(.ds-page) {
    scroll-padding-block-start: calc(var(--site-header-height) + var(--space-4));
  }

  .ds-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    min-block-size: 100svh;
  }

  /* The one content column: header, every section and the footer share its left edge */
  .ds-page-content {
    inline-size: 100%;
    max-inline-size: var(--page-width);
    margin-inline: auto;
    padding-inline: var(--page-padding);
  }

  @media (width >= 40rem) {
    .ds-page-content {
      padding-inline: var(--page-padding-wide);
    }
  }

  .ds-site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--z-index-sticky);
    border-block-end: var(--hairline) solid var(--border-subtle);
    background: var(--bg);
  }

  .ds-site-header > .ds-page-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-block-size: var(--site-header-height);
  }

  /* The right-hand group: wraps under the logo when it must, every target stays 44px */
  .ds-site-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-inline-start: auto;
  }

  .ds-site-header-actions > * {
    min-block-size: var(--target-min);
  }

  @media (width >= 40rem) {
    .ds-site-header-actions {
      gap: var(--space-2);
    }
  }

  .ds-site-footer {
    border-block-start: var(--hairline) solid var(--border-subtle);
    color: var(--fg-muted);
    font-size: var(--text-sm);
  }

  .ds-site-footer > .ds-page-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-5);
  }

  /* The lockup at its brand height, the small height on a phone or with data-size="small" */
  .ds-logo {
    display: block;
    flex: none;
    block-size: var(--logo-height);
    inline-size: auto;
  }

  .ds-logo[data-size='small'] {
    block-size: var(--logo-height-small);
  }

  @media (width < 40rem) {
    .ds-logo {
      block-size: var(--logo-height-small);
    }
  }

  /* First in the page, hidden until focused, above the sticky header. Pair it with .ds-button */
  .ds-skip-link {
    position: absolute;
    inset-block-start: var(--space-2);
    inset-inline-start: var(--space-2);
    z-index: calc(var(--z-index-sticky) + 1);
  }

  .ds-skip-link:not(:focus) {
    inline-size: var(--hairline);
    block-size: var(--hairline);
    overflow: hidden;
    clip-path: inset(50%);
    padding: 0;
    border: 0;
    white-space: nowrap;
  }

  /* A page section: its heading, then content at a readable measure */
  .ds-section {
    padding-block: var(--section-padding-block);
  }

  @media (width >= 64rem) {
    .ds-section {
      padding-block: var(--section-padding-block-wide);
    }
  }

  .ds-section-title {
    max-inline-size: var(--measure-heading);
    margin-block-end: var(--space-5);
    font-size: var(--text-h1);
  }

  /* Feature rows: one column, two from 48rem. data-wide spans the row */
  .ds-feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  @media (width >= 48rem) {
    .ds-feature-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--space-6) var(--space-5);
    }

    .ds-feature-grid > [data-wide] {
      grid-column: 1 / -1;
    }
  }

  .ds-feature {
    display: grid;
    align-content: start;
    gap: var(--space-2);
  }

  .ds-feature-title {
    font-size: var(--text-h3);
  }

  .ds-feature-body {
    max-inline-size: var(--measure);
    color: var(--fg-muted);
  }
}

/*
 * EmptyState, Avatar and ErrorSummary.
 */
@layer tokens, base, components, app;

@layer tokens {
  :where(:root) {
    --avatar-font-size: var(--text-caption);
    --avatar-size: 2rem;
    --avatar-size-large: 3rem;
    --empty-state-icon-size: 3rem;
    --error-summary-border-width: 2px;
  }
}

@layer components {
  .ds-empty-state {
    display: grid;
    gap: var(--space-2);
    justify-items: center;
    padding: var(--space-6) var(--space-4);
    color: var(--fg-muted);
    text-align: center;
  }

  .ds-empty-state > .ds-icon {
    width: var(--empty-state-icon-size);
    height: var(--empty-state-icon-size);
  }

  .ds-empty-state-title {
    color: var(--fg);
    font-size: var(--text-lead);
  }

  .ds-empty-state-action {
    margin-top: var(--space-2);
  }

  .ds-avatar {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: var(--avatar-size);
    height: var(--avatar-size);
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--primary-subtle);
    color: var(--fg);
    font-size: var(--avatar-font-size);
    font-weight: var(--weight-bold);
  }

  .ds-avatar[data-size='large'] {
    width: var(--avatar-size-large);
    height: var(--avatar-size-large);
    font-size: var(--text-body);
  }

  .ds-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .ds-error-summary {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: var(--error-summary-border-width) solid var(--danger);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .ds-error-summary[data-variant='plain'] {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .ds-error-summary-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--danger);
    font-size: var(--text-lead);
  }

  .ds-error-summary ul {
    margin: 0;
    padding-inline-start: var(--space-5);
  }

  /* Focused by script after a failed submit, by mouse too, so it always shows the ring */
  .ds-error-summary:focus {
    outline: var(--focus-width) solid var(--ring);
    outline-offset: var(--focus-offset);
  }
}

/*
 * Status: always an icon, a word and a fill together, so colour is never the only cue.
 */
@layer tokens, base, components, app;

@layer tokens {
  :where(:root) {
    --status-font-size: var(--text-caption);
    --status-icon-size: 0.875rem;
    --status-line-height: 1.25rem;
    --status-padding-block: 1px;
    --status-padding-end: var(--space-2);
    --status-padding-start: 6px;
    --table-secondary-leading: 1rem;
    --table-secondary-size: var(--text-caption);
  }
}

@layer components {
  .ds-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--status-padding-block) var(--status-padding-end) var(--status-padding-block)
      var(--status-padding-start);
    border: var(--hairline) solid transparent;
    border-radius: var(--radius-full);
    color: var(--ink);
    font-size: var(--status-font-size);
    font-weight: var(--weight-medium);
    line-height: var(--status-line-height);
    white-space: nowrap;
  }

  .ds-status .ds-icon {
    width: var(--status-icon-size);
    height: var(--status-icon-size);
  }

  .ds-status[data-tone='attention'] {
    background: var(--pop-attention);
  }

  .ds-status[data-tone='progress'] {
    background: var(--pop-progress);
  }

  .ds-status[data-tone='client'] {
    background: var(--pop-client);
  }

  .ds-status[data-tone='positive'] {
    background: var(--pop-positive);
  }

  .ds-status[data-tone='highlight'] {
    background: var(--selected-bg);
  }

  .ds-status[data-tone='info'] {
    background: var(--primary-subtle);
    color: var(--fg);
  }

  .ds-status[data-tone='primary'] {
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: var(--weight-bold);
  }

  .ds-status[data-tone='neutral'] {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--fg);
  }

  .ds-status[data-tone='closed'] {
    background: var(--surface-sunk);
    color: var(--fg-muted);
  }

  .ds-status[data-tone='danger'] {
    border-color: var(--danger);
    background: var(--surface);
    color: var(--danger);
    font-weight: var(--weight-bold);
  }

  /* Quiet: icon plus word, no fill, for a status that is context, not the row's news */
  .ds-status[data-tone='quiet'] {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fg);
  }

  .ds-status[data-tone='quiet'] .ds-icon {
    color: var(--fg-muted);
  }

  /* Compact: fits line two of a table cell, so the row stays one height */
  .ds-status[data-size='compact'] {
    gap: var(--space-1);
    padding: 0 var(--space-2) 0 var(--space-1);
    font-size: var(--table-secondary-size);
    line-height: var(--table-secondary-leading);
  }

  @media (forced-colors: active) {
    .ds-status:not([data-tone='quiet']) {
      border-color: CanvasText;
    }
  }
}

/*
 * Score: the number carries the value, fixed width so bars line up; the bar is only for scanning,
 * hidden from assistive technology, in a colour that is not an action.
 */
@layer tokens, base, components, app;

@layer tokens {
  :where(:root) {
    --score-bar-fill: var(--fg-muted);
    --score-bar-height: 0.375rem;
    --score-bar-track: var(--surface-sunk);
    --score-bar-width: 3.5rem;
    --score-number-width: 3ch;
  }
}

@layer components {
  .ds-score {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-variant-numeric: tabular-nums;
  }

  .ds-score-number {
    display: inline-block;
    min-width: 0;
    inline-size: var(--score-number-width);
    color: var(--fg);
    font-weight: var(--weight-bold);
    text-align: end;
  }

  .ds-score-bar {
    display: block;
    flex: none;
    overflow: hidden;
    inline-size: var(--score-bar-width);
    block-size: var(--score-bar-height);
    border-radius: var(--radius-full);
    background: var(--score-bar-track);
  }

  /* An SVG rect sized by its width attribute: no style attribute, so it passes a strict CSP */
  .ds-score-fill {
    fill: var(--score-bar-fill);
  }

  @media (forced-colors: active) {
    .ds-score-fill {
      fill: CanvasText;
    }
  }
}

/*
 * Board: a column per stage on wide screens, one stage at a time behind stage tabs on phones. Every
 * card has a Move menu. Load segmented.css and segmented-scroll.css for the phone stage tabs.
 */
@layer tokens, base, components, app;

@layer tokens {
  :where(:root) {
    --board-column-width: 15rem;
    --board-column-width-tablet: min(17.5rem, 42%);
  }
}

@layer components {
  /* Board */
  .ds-board {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--space-4);
  }

  .ds-board-column {
    display: grid;
    flex: 0 0 var(--board-column-width);
    align-content: start;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--surface-sunk);
    scroll-snap-align: start;
  }

  .ds-board[data-layout='tablet'] .ds-board-column {
    flex-basis: var(--board-column-width-tablet);
  }

  .ds-board-column-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
  }

  .ds-board-cards {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .ds-board-card {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    border: var(--hairline) solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .ds-board-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: var(--space-2);
  }

  .ds-board-card-title {
    font-weight: var(--weight-bold);
  }

  .ds-board-stage {
    display: grid;
    gap: var(--space-3);
  }

  .ds-board-stage-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
  }

  .ds-board-empty {
    padding: var(--space-5) var(--space-3);
    color: var(--fg-muted);
    text-align: center;
  }
}
