/* styles/tokens.css */
/*
 * Design tokens for Tennisportal.
 *
 * This file is the single source of truth for colour, type, spacing, radii,
 * shadows and motion. Component CSS may only use these variables; a redesign
 * should normally be possible by editing this file alone.
 *
 * Club branding overrides a small set of tokens (primary colour, accent
 * colour, logo). The server generates a per-club stylesheet that redefines
 * --color-primary and --color-accent on the club page wrapper; component CSS
 * never changes for a club.
 *
 * The layer order is declared here because this file is loaded first.
 */
@layer reset, tokens, base, components, utilities;

@layer tokens {
  @font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range:
      U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
      U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
      U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }

  @font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/static/fonts/inter-latin.woff2") format("woff2");
    unicode-range:
      U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
      U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

  @font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("/static/fonts/newsreader-latin-ext.woff2") format("woff2");
    unicode-range:
      U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
      U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
      U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }

  @font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("/static/fonts/newsreader-latin.woff2") format("woff2");
    unicode-range:
      U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
      U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

  :root {
    color-scheme: light;

    /* Typography */
    --font-sans:
      "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
      "Helvetica Neue", Arial, sans-serif;
    --font-display:
      "Newsreader", Georgia, "Times New Roman", "Iowan Old Style", serif;
    --font-mono:
      ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      monospace;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-hero: clamp(var(--font-size-2xl), 1.65rem + 1.4vw, var(--font-size-3xl));
    --font-size-code: 0.95em;

    --line-height-solid: 1;
    --line-height-tight: 1.15;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.65;
    --underline-offset: 0.15em;
    --label-letter-spacing: 0.04em;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing scale */
    --space-0: 0;
    --space-hairline: 2px;
    --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;

    /* Borders and corners */
    --border-width-thin: 1px;
    --border-width-thick: 2px;
    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows — warm, soft, low-contrast */
    --shadow-sm: 0 1px 2px rgb(42 33 22 / 0.07);
    --shadow-md: 0 6px 18px rgb(42 33 22 / 0.1);
    --shadow-lg: 0 18px 44px rgb(42 33 22 / 0.16);
    --shadow-lift: 0 14px 34px rgb(42 33 22 / 0.14);

    /* Surfaces and text */
    --color-bg: #f5f0e7;
    --color-surface: #fffdf8;
    --color-surface-raised: #fffdf8;
    --color-surface-subtle: #f1eadf;
    --color-surface-muted: #ebe4d7;
    --color-text: #1e2a23;
    --color-text-muted: #5d665c;
    --color-border: #ddd3c2;
    --color-border-strong: #b9ab97;
    --color-overlay: rgb(20 28 23 / 0.46);

    /* Persistent global bar (mobile and admin) */
    --color-global-bar-bg: #1b2a21;
    --color-global-bar-surface: #24352a;
    --color-global-bar-text: #d6e1d5;
    --color-global-bar-text-strong: #fffdf8;
    --color-global-bar-active: #f0d6a3;
    --color-global-bar-border: #2b3c30;

    /* Brand (club-overridable) */
    --color-primary: #2f5c45;
    --color-primary-hover: #244735;
    --color-primary-active: #1b3729;
    --color-primary-soft: #e2ece3;
    --color-primary-line: #bfd2c2;
    --color-on-primary: #fbf7ee;
    --color-accent: #b56747;
    --color-accent-strong: #8f4a31;
    --color-accent-soft: #f4e3d9;
    --color-accent-line: #e4c3b3;
    --color-on-accent: #fffaf4;

    /* Warm clubhouse surfaces used by the application shell */
    --color-header-bg: #f7f2e9;
    --color-header-border: #ddd3c2;
    --color-nav-bg: #1b2a21;
    --color-nav-surface: #24352a;
    --color-nav-text: #d6e1d5;
    --color-nav-muted: #9fb2a2;
    --color-nav-active: #f0d6a3;
    --color-nav-line: #2b3c30;

    /* Status */
    --color-success: #2f6b4f;
    --color-success-bg: #e3efe6;
    --color-warning: #8a5a1f;
    --color-warning-bg: #f6ead3;
    --color-danger: #a23b2e;
    --color-danger-hover: #842c22;
    --color-danger-bg: #f6e1dd;
    --color-on-danger: #fffaf4;
    --color-info: #1f5f8b;
    --color-info-bg: #e6eff5;

    /* Focus */
    --color-focus: #1f5f8b;
    --focus-outline-width: 2px;
    --focus-outline-offset: 2px;
    --focus-outline-inset-offset: -2px;
    --color-focus-ring: 0 0 0 3px rgb(31 95 139 / 0.3);
    --color-danger-ring: 0 0 0 3px rgb(162 59 46 / 0.28);

    /* Layout */
    --container-width: 72rem;
    --container-narrow: 42rem;
    --page-gutter: var(--space-4);
    --control-height-sm: 2rem;
    --control-height: 2.5rem;
    --control-height-lg: 3rem;
    --nav-height: 4rem;
    --global-bar-height: 3.75rem;
    --mobile-preview-width: 22.5rem;
    --grid-min-column: 16rem;
    --code-list-min-column: 10rem;
    --spinner-size: 1em;
    --spinner-duration: 700ms;
    --disabled-opacity: 0.55;
    --skip-link-hidden-offset: -200%;
    --a11y-hidden-size: 1px;

    /* Motion */
    --transition-fast: 120ms ease;
    --transition-base: 180ms ease;

    /* Stacking */
    --z-nav: 10;
    --z-skip-link: 20;
    --z-overlay: 100;
  }

  @media (min-width: 48rem) {
    :root {
      --page-gutter: var(--space-6);
    }
  }
}

/* styles/base.css */
/*
 * Reset, element defaults and layout utilities.
 * Layer order is declared in tokens.css: reset, tokens, base, components, utilities.
 */

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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  figure,
  blockquote,
  dl,
  dd {
    margin: 0;
  }

  ul,
  ol {
    margin: 0;
    padding: 0;
  }

  ul[role="list"],
  ol[role="list"] {
    list-style: none;
  }

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

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

  button {
    cursor: pointer;
  }

  :target {
    scroll-margin-block-start: var(--space-6);
  }
}

@layer base {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-medium);
    letter-spacing: -0.015em;
    line-height: var(--line-height-tight);
    text-wrap: balance;
  }

  h1 {
    font-size: var(--font-size-hero);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }

  p {
    text-wrap: pretty;
  }

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

  a:hover {
    color: var(--color-primary-hover);
  }

  :focus-visible {
    outline: var(--focus-outline-width) solid var(--color-focus);
    outline-offset: var(--focus-outline-offset);
  }

  ::selection {
    background: var(--color-accent);
    color: var(--color-on-accent);
  }

  main {
    flex: 1;
  }

  table {
    border-collapse: collapse;
  }

  code,
  kbd,
  samp {
    font-family: var(--font-mono);
    font-size: var(--font-size-code);
  }
}

@layer utilities {
  .container {
    width: min(calc(100% - var(--page-gutter) * 2), var(--container-width));
    margin-inline: auto;
  }

  .container--narrow {
    max-width: var(--container-narrow);
    margin-inline: auto;
  }

  .page {
    padding-block: var(--space-6) var(--space-8);
  }

  .stack > * + * {
    margin-block-start: var(--stack-gap, var(--space-4));
  }

  .stack--sm {
    --stack-gap: var(--space-2);
  }

  .stack--lg {
    --stack-gap: var(--space-6);
  }

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

  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min-column)), 1fr));
    gap: var(--space-4);
  }

  .text-muted {
    color: var(--color-text-muted);
  }

  .break-all {
    overflow-wrap: anywhere;
  }

  .visually-hidden {
    position: absolute;
    width: var(--a11y-hidden-size);
    height: var(--a11y-hidden-size);
    padding: 0;
    margin: calc(var(--a11y-hidden-size) * -1);
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer base {
    html {
      scroll-behavior: auto;
    }
  }
}

@layer components {
  .place-handle {
    cursor: grab;
    color: var(--color-text-muted);
    user-select: none;
    touch-action: none;
    background: transparent;
    border: 0;
    padding: var(--space-1);
  }

  .place-row {
    cursor: default;
  }
}

@layer components {
  .table__detail {
    margin-top: var(--space-2);
    padding: var(--space-2);
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: var(--font-size-sm);
    background: var(--color-surface-subtle, var(--color-surface));
    border-radius: var(--radius-sm);
  }
}

/* layouts/site.css */
@layer components {
  .skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-4);
    z-index: var(--z-skip-link);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    transform: translateY(var(--skip-link-hidden-offset));
  }

  .skip-link:focus-visible {
    transform: translateY(0);
  }

  .site-footer {
    margin-top: var(--space-8);
    padding-block: var(--space-5);
    border-top: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  .site-footer__links {
    margin-block-start: var(--space-2);
  }

  .site-footer__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .site-footer__link {
    color: var(--color-text-muted);
    text-decoration: underline;
    text-underline-offset: var(--underline-offset);
  }

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

@layer components {
  .club-hero__eyebrow {
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
  }

  .club-hero {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background:
      radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--color-accent) 55%, transparent), transparent 34%),
      linear-gradient(135deg, var(--color-primary) 0%, color-mix(in srgb, var(--color-primary) 55%, var(--color-text)) 100%);
    color: var(--color-on-primary);
    box-shadow: var(--shadow-md);
  }

  .club-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.55fr);
    gap: var(--space-6);
    align-items: end;
    padding: clamp(1.75rem, 4vw, 4rem);
  }

  .club-hero__copy {
    display: grid;
    gap: var(--space-4);
    max-width: 46rem;
  }

  .club-hero__eyebrow {
    color: color-mix(in srgb, var(--color-on-primary) 72%, transparent);
  }

  .club-hero__title {
    color: var(--color-on-primary);
    font-size: clamp(2.4rem, 1.5rem + 3vw, 4.75rem);
    letter-spacing: -0.035em;
  }

  .club-hero__lede {
    max-width: 35rem;
    color: color-mix(in srgb, var(--color-on-primary) 82%, transparent);
    font-size: var(--font-size-lg);
  }

  .club-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
  }

  .club-hero__mark {
    position: relative;
    min-height: 12rem;
    border: var(--border-width-thin) solid color-mix(in srgb, var(--color-on-primary) 28%, transparent);
    border-radius: var(--radius-lg);
    background:
      linear-gradient(90deg, transparent 49.5%, color-mix(in srgb, var(--color-on-primary) 24%, transparent) 49.5% 50.5%, transparent 50.5%),
      linear-gradient(0deg, transparent 49.5%, color-mix(in srgb, var(--color-on-primary) 24%, transparent) 49.5% 50.5%, transparent 50.5%);
  }

  .club-hero__mark::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--color-accent) 20%, transparent);
    transform: translate(-50%, -50%);
  }

  .module-section {
    display: grid;
    gap: var(--space-4);
  }

  .content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: var(--space-4);
  }

  .prose-section {
    padding: var(--space-5);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
  }

  .prose-section h2 {
    margin-bottom: var(--space-3);
  }

  .booking-grid-panel {
    max-width: 72rem;
    margin-inline: auto;
    width: 100%;
  }

  .date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
  }

  .date-bar__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    text-decoration: none;
  }

  @media (max-width: 48rem) {
    .club-hero__inner {
      grid-template-columns: 1fr;
    }

    .club-hero__mark {
      display: none;
    }

  }

  @media (prefers-reduced-motion: reduce) {
  }
}

@layer components {
  .admin .page {
    padding-block-start: var(--space-5);
  }

  .admin .container--narrow {
    max-width: none;
    padding: var(--space-5);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .admin .page > .stack > header h1 {
    font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  }

  @media (max-width: 48rem) {
    .admin .container--narrow {
      padding: var(--space-4);
    }
  }
}

@layer components {
  .account-main .list-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .account-main .table-card {
    overflow-x: auto;
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .account-main .table-card table {
    width: 100%;
  }

  .account-main .table-card th,
  .account-main .table-card td {
    padding: var(--space-3) var(--space-4);
    border-bottom: var(--border-width-thin) solid var(--color-border);
    text-align: left;
  }

  .account-main .table-card tr:last-child td {
    border-bottom: 0;
  }

  .account-main > .stack > header h1 {
    font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  }

  .account .container--narrow {
    max-width: none;
    padding: var(--space-5);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  @media (max-width: 48rem) {
    .account .container--narrow {
      padding: var(--space-4);
    }
  }
}

@layer components {
  .account-main .empty-state,
  .admin .empty-state {
    border-style: solid;
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
  }
}

@layer components {
  .admin .page table {
    width: 100%;
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .admin-table-scroll {
    overflow-x: auto;
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .admin-table-scroll > table {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .admin .page thead th {
    padding: var(--space-3) var(--space-4);
    border-bottom: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-letter-spacing);
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .admin .page tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: var(--border-width-thin) solid var(--color-border);
    vertical-align: top;
  }

  .admin .page tbody tr:last-child td {
    border-bottom: 0;
  }

  .admin .page tbody tr:hover {
    background: color-mix(in srgb, var(--color-primary) 4%, var(--color-surface));
  }

  .admin .page ul[role="list"] {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
  }

  .admin .page ul[role="list"] > li {
    padding: var(--space-3) var(--space-4);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
  }
}

@layer components {
  .admin-table-tools {
    display: flex;
    justify-content: flex-end;
    margin-block: var(--space-2);
  }

  .admin-table-tools__search {
    max-width: 20rem;
    background: var(--color-surface);
  }

  .admin-table-sort {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
  }

  .admin-table-sort::after {
    content: " ↕";
    color: var(--color-text-muted);
    font-size: 0.8em;
  }

  th[aria-sort="ascending"] .admin-table-sort::after {
    content: " ↑";
  }

  th[aria-sort="descending"] .admin-table-sort::after {
    content: " ↓";
  }
}

@layer components {
  .admin-support-banner {
    padding-block-start: var(--space-4);
  }

  .admin-support-banner .admin-support-banner__alert {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .admin-support-banner__copy {
    display: grid;
    gap: var(--space-1);
  }
}

/* components/account_menu.css */
@layer components {
  .account-menu {
    position: relative;
    flex: none;
  }

  .account-menu__trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    padding: var(--space-1);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text);
    list-style: none;
    cursor: pointer;
  }

  .account-menu__trigger::-webkit-details-marker {
    display: none;
  }

  .account-menu__trigger:hover,
  .account-menu[open] > .account-menu__trigger {
    background: var(--color-surface-muted);
  }

  .account-menu__avatar {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.68rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
  }

  .account-menu__name {
    max-width: 9rem;
    overflow: hidden;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account-menu__chevron {
    width: 1rem;
    height: 1rem;
    color: var(--color-text-muted);
  }

  .account-menu__panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + var(--space-1));
    z-index: var(--z-overlay);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    width: min(18rem, calc(100vw - var(--space-6)));
    padding: var(--space-2);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
  }

  .account-menu__head {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: var(--space-2);
    border-bottom: var(--border-width-thin) solid var(--color-border);
    margin-bottom: var(--space-1);
  }

  .account-menu__head strong {
    font-size: var(--font-size-sm);
  }

  .account-menu__head span {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
  }

  .account-menu__link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    padding-inline: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
  }

  .account-menu__link:hover {
    background: var(--color-surface-muted);
  }

  .account-menu__link .icon {
    color: var(--color-text-muted);
  }

  .account-menu__signout {
    margin: 0;
    padding-top: var(--space-1);
    border-top: var(--border-width-thin) solid var(--color-border);
  }

  .account-menu__signout-button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--control-height);
    padding-inline: var(--space-2);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-align: left;
  }

  .account-menu__signout-button:hover {
    background: var(--color-danger-bg);
  }
}

@media (max-width: 63.99rem) {
  @layer components {
    .account-menu__name,
    .account-menu__chevron {
      display: none;
    }

    .account-menu__panel {
      position: fixed;
      inset-inline: var(--space-3);
      top: calc(3.625rem + var(--space-1));
      width: auto;
    }
  }
}

/* components/alert.css */
@layer components {
  .alert {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-4);
    border: var(--border-width-thin) solid currentColor;
    border-radius: var(--radius-md);
  }

  .alert__title {
    font-weight: var(--font-weight-bold);
  }

  .alert__message {
    color: inherit;
  }

  .alert--info {
    background: var(--color-info-bg);
    border-color: var(--color-info);
    color: var(--color-info);
  }

  .alert--success {
    background: var(--color-success-bg);
    border-color: var(--color-success);
    color: var(--color-success);
  }

  .alert--warning {
    background: var(--color-warning-bg);
    border-color: var(--color-warning);
    color: var(--color-warning);
  }

  .alert--danger {
    background: var(--color-danger-bg);
    border-color: var(--color-danger);
    color: var(--color-danger);
  }
}

/* components/app_header.css */
@layer components {
  .app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    border-bottom: var(--border-width-thin) solid var(--color-header-border);
    background: var(--color-header-bg);
  }

  .app-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-2) var(--space-4);
    min-height: var(--nav-height);
  }

  .app-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex: none;
    color: var(--color-text);
    text-decoration: none;
  }

  .app-brand:hover {
    color: var(--color-primary);
  }

  .app-brand__logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    flex: none;
  }

  .app-brand__mark {
    width: 1.7rem;
    height: 1.7rem;
    color: var(--color-primary);
  }

  .app-brand__word {
    font-family: var(--font-display);
    font-size: 1.22rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .app-header .club-switcher {
    flex: 0 1 auto;
  }

  .app-header .club-switcher__trigger {
    min-height: 2.25rem;
    padding: 0 var(--space-2);
    border-color: transparent;
    background: var(--color-surface-muted);
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
  }

  .app-header .club-switcher__trigger:hover,
  .app-header .club-switcher[open] > .club-switcher__trigger {
    border-color: var(--color-border);
    background: var(--color-surface);
  }

  .app-header .club-switcher__name {
    max-width: 12rem;
  }

  .app-nav {
    flex: 1 1 auto;
    min-width: 0;
    margin-inline-start: var(--space-2);
  }

  .app-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .app-nav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--control-height);
    padding-inline: var(--space-3);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    white-space: nowrap;
  }

  .app-nav__link:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
  }

  .app-nav__link--current {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
  }

  .app-header__utils {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-inline-start: auto;
  }

  .app-icon-link {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    text-decoration: none;
  }

  .app-icon-link:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
  }

  .app-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }

  .app-header__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding-inline: var(--space-3);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    white-space: nowrap;
  }

  .app-header__action:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-muted);
  }

  .app-header__action--primary {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
  }

  .app-header__action--primary:hover {
    border-color: var(--color-primary-hover);
    background: var(--color-primary-hover);
    color: var(--color-on-primary);
  }
}

@media (max-width: 63.99rem) {
  @layer components {
    .app-header {
      position: static;
    }

    .app-header__inner {
      min-height: 3.625rem;
      padding-block: var(--space-2);
      gap: var(--space-2);
    }

    .app-nav {
      display: none;
    }

    .app-header__actions {
      display: none;
    }

    .app-brand__word {
      font-size: 1.05rem;
    }

    .app-header .club-switcher__name {
      max-width: 9rem;
    }

    .app-icon-link {
      width: 2.375rem;
      height: 2.375rem;
    }
  }
}

/* components/badge.css */
@layer components {
  .badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border: var(--border-width-thin) solid transparent;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    white-space: nowrap;
  }

  .badge--neutral {
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    color: var(--color-text-muted);
  }

  .badge--success {
    background: var(--color-success-bg);
    border-color: var(--color-success);
    color: var(--color-success);
  }

  .badge--warning {
    background: var(--color-warning-bg);
    border-color: var(--color-warning);
    color: var(--color-warning);
  }

  .badge--danger {
    background: var(--color-danger-bg);
    border-color: var(--color-danger);
    color: var(--color-danger);
  }

  .badge--info {
    background: var(--color-info-bg);
    border-color: var(--color-info);
    color: var(--color-info);
  }

  .badge--accent {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-on-accent);
  }
}

/* components/button.css */
@layer components {
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    padding-inline: var(--space-4);
    border: var(--border-width-thin) solid transparent;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-solid);
    text-decoration: none;
    transition:
      background-color var(--transition-fast),
      border-color var(--transition-fast),
      color var(--transition-fast),
      box-shadow var(--transition-fast);
  }

  .button--sm {
    min-height: var(--control-height-sm);
    padding-inline: var(--space-3);
    font-size: var(--font-size-sm);
  }

  .button--lg {
    min-height: var(--control-height-lg);
    padding-inline: var(--space-5);
    font-size: var(--font-size-lg);
  }

  .button--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
  }

  .button--primary:hover:not(:disabled):not([aria-disabled="true"]),
  .button--primary[data-demo-state="hover"]:not(:disabled) {
    background: var(--color-primary-hover);
  }

  .button--primary:active:not(:disabled) {
    background: var(--color-primary-active);
  }

  .button--secondary {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
    color: var(--color-text);
  }

  .button--secondary:hover:not(:disabled):not([aria-disabled="true"]),
  .button--secondary[data-demo-state="hover"]:not(:disabled) {
    background: var(--color-surface-muted);
  }

  .button--ghost {
    background: transparent;
    color: var(--color-primary);
  }

  .button--ghost:hover:not(:disabled):not([aria-disabled="true"]),
  .button--ghost[data-demo-state="hover"]:not(:disabled) {
    background: var(--color-surface-muted);
  }

  .button--danger {
    background: var(--color-danger);
    color: var(--color-on-danger);
  }

  .button--danger:hover:not(:disabled):not([aria-disabled="true"]),
  .button--danger[data-demo-state="hover"]:not(:disabled) {
    background: var(--color-danger-hover);
  }

  .button:focus-visible,
  .button[data-demo-state="focus"] {
    outline: var(--focus-outline-width) solid var(--color-focus);
    outline-offset: var(--focus-outline-offset);
  }

  .button:disabled,
  .button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
  }

  .button[aria-busy="true"] {
    cursor: progress;
  }

  .button__label {
    display: inline-block;
  }

  .button__spinner {
    width: var(--spinner-size);
    height: var(--spinner-size);
    border: var(--border-width-thick) solid currentColor;
    border-right-color: transparent;
    border-radius: var(--radius-full);
    animation: button-spin var(--spinner-duration) linear infinite;
  }

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

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

    .button__spinner {
      animation: none;
    }
  }
}

/* components/card.css */
@layer components {
  .card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-surface);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  .card__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-4) 0;
  }

  .card__title {
    font-size: var(--font-size-lg);
  }

  .card__description {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  .card__body {
    flex: 1;
    padding: var(--space-4);
  }

  .card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-top: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface-muted);
  }
}

/* components/checkbox.css */
@layer components {
  .checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .checkbox__control {
    width: var(--control-height-sm);
    height: var(--control-height-sm);
    margin-block-start: var(--space-1);
    flex: 0 0 auto;
    accent-color: var(--color-primary);
  }

  .checkbox__control:focus-visible {
    outline: var(--focus-outline-width) solid var(--color-focus);
    outline-offset: var(--focus-outline-offset);
  }

  .checkbox__control:disabled {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
  }

  .checkbox__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  .checkbox__label {
    font-weight: var(--font-weight-medium);
  }

  .checkbox__hint {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }
}

/* components/club_switcher.css */
@layer components {
  .club-switcher {
    position: relative;
    flex: 0 1 auto;
    min-width: 0;
  }

  .club-switcher__trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    max-width: 100%;
    padding: var(--space-1) var(--space-2);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    list-style: none;
    cursor: pointer;
  }

  .club-switcher__trigger::-webkit-details-marker {
    display: none;
  }

  .club-switcher__trigger:hover,
  .club-switcher[open] > .club-switcher__trigger {
    border-color: var(--color-border);
    background: var(--color-surface-muted);
  }

  .club-switcher__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .club-switcher__chevron {
    flex: 0 0 auto;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  .club-switcher__panel {
    position: absolute;
    inset-inline-start: 0;
    top: calc(100% + var(--space-1));
    z-index: var(--z-overlay);
    display: grid;
    gap: var(--space-2);
    width: min(24rem, calc(100vw - var(--space-6)));
    padding: var(--space-3);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
  }

  .club-switcher__label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
  }

  .club-switcher__input {
    width: 100%;
    min-height: var(--control-height);
    padding-inline: var(--space-3);
    border: var(--border-width-thin) solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
  }

  .club-switcher__results {
    display: grid;
    gap: var(--space-hairline);
    max-height: 18rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .club-switcher__heading {
    margin: var(--space-1) 0 0;
    padding-inline: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
  }

  .club-switcher__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: var(--control-height);
    padding-inline: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
  }

  .club-switcher__option:hover,
  .club-switcher__option.is-active {
    background: var(--color-surface-muted);
  }

  .club-switcher__option--current {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
  }

  .club-switcher__current-label {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
  }

  .club-switcher__empty {
    margin: 0;
    padding: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  /* The gallery shows the panel inside its frame. */
  .demo .club-switcher__panel {
    position: static;
    width: 100%;
    margin-block-start: var(--space-1);
  }

  .club-switcher__all {
    padding: var(--space-2);
    border-top: var(--border-width-thin) solid var(--color-border);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-underline-offset: var(--underline-offset);
  }
}

@media (max-width: 63.99rem) {
  @layer components {
    .club-switcher__trigger {
      font-size: var(--font-size-lg);
    }

    .club-switcher__panel {
      position: fixed;
      inset-inline: var(--space-3);
      top: calc(var(--nav-height) + var(--space-1));
      width: auto;
      max-height: calc(100vh - var(--nav-height) - var(--space-6));
    }
  }
}

/* components/coaching.css */
@layer components {
  .coach-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    gap: var(--space-5);
    align-items: start;
  }

  .coach-availability {
    position: sticky;
    top: calc(var(--nav-height) + var(--space-4));
    padding: var(--space-4);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .coach-availability__scroll {
    overflow-x: auto;
  }

  .coach-availability__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
  }

  .coach-availability__table th,
  .coach-availability__table td {
    padding: var(--space-1) var(--space-2);
    border-bottom: var(--border-width-thin) solid var(--color-border);
    text-align: left;
    white-space: nowrap;
  }

  .coach-availability__cell--busy {
    color: var(--color-danger);
  }

  .coaching-block {
    width: 100%;
  }

  .coaching-block .field__control {
    min-width: 8rem;
  }
}

@media (max-width: 63.99rem) {
  @layer components {
    .coach-layout {
      display: block;
    }

    .coach-availability {
      position: static;
      margin-block-start: var(--space-5);
    }
  }
}

@layer components {
  .coach-courts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-2);
  }

  .coach-courts legend {
    grid-column: 1 / -1;
  }
}

@layer components {
  .coach-courts label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

@layer components {
  .coach-availability__cell--closed {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
  }
}

/* components/code_list.css */
@layer components {
  .code-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--code-list-min-column), 1fr));
    gap: var(--space-2);
    padding: var(--space-4);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    list-style: none;
  }

  .code-list li {
    text-align: center;
  }

  .code-list code {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--label-letter-spacing);
  }
}

/* components/demo.css */
/* Preview frame for the development component gallery. */
@layer components {
  .demo {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
  }

  .demo__label {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
  }

  .demo__preview {
    padding: var(--space-4);
    border: var(--border-width-thin) dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
  }

  /* Keep the navigation example inside its frame. */
  .demo .global-bar,
  .demo .space-nav,
  .demo .app-header,
  .demo .local-nav {
    position: static;
  }

  .demo__note {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
  }

  .demo--mobile .demo__preview {
    max-width: var(--mobile-preview-width);
    border-style: solid;
    box-shadow: var(--shadow-md);
  }
}

/* components/empty_state.css */
@layer components {
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    border: var(--border-width-thin) dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    text-align: center;
  }

  .empty-state__title {
    font-size: var(--font-size-lg);
  }

  .empty-state__description {
    max-width: var(--container-narrow);
    color: var(--color-text-muted);
  }

  .empty-state__action {
    margin-top: var(--space-2);
  }
}

/* components/field.css */
@layer components {
  .field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    width: 100%;
  }

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

  .field__required {
    margin-inline-start: var(--space-1);
    color: var(--color-danger);
  }

  .field__control {
    width: 100%;
    min-height: var(--control-height);
    padding: var(--space-2) var(--space-3);
    border: var(--border-width-thin) solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition:
      border-color var(--transition-fast),
      box-shadow var(--transition-fast);
  }

  .field__control::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
  }

  .field__control:hover:not(:disabled),
  .field__control[data-demo-state="hover"]:not(:disabled) {
    border-color: var(--color-text-muted);
  }

  .field__control:focus,
  .field__control[data-demo-state="focus"] {
    outline: none;
    border-color: var(--color-focus);
    box-shadow: var(--color-focus-ring);
  }

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

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

  .field__control:disabled {
    cursor: not-allowed;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
  }

  .field__hint {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  .field__error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
  }
}

/* components/icon.css */
@layer components {
  .icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.15em;
  }

  .icon--sm {
    width: 1rem;
    height: 1rem;
  }

  .icon--lg {
    width: 1.5rem;
    height: 1.5rem;
  }
}

/* components/local_nav.css */
@layer components {
  .local-nav {
    border-bottom: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface);
  }

  .local-nav__inner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 3rem;
  }

  .local-nav__heading {
    flex: none;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
    white-space: nowrap;
  }

  .local-nav__nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .local-nav__nav::-webkit-scrollbar {
    display: none;
  }

  .local-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .local-nav__item {
    flex: none;
  }

  .local-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 3rem;
    padding-inline: var(--space-2);
    border-bottom: var(--border-width-thick) solid transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    white-space: nowrap;
  }

  .local-nav__link:hover {
    color: var(--color-text);
  }

  .local-nav__link--current {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
  }

  .local-nav__link--section {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
  }

  .local-nav__link--sub {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
  }

  .local-nav__link--sub.local-nav__link--current {
    color: var(--color-primary);
  }

  .local-nav__divider {
    flex: none;
    width: 1px;
    height: 1.2rem;
    margin-inline: var(--space-1);
    background: var(--color-border);
  }
}

/* components/mobile_tabbar.css */
@layer components {
  .mobile-tabbar {
    display: none;
  }
}

@media (max-width: 63.99rem) {
  @layer components {
    .mobile-tabbar {
      display: block;
      position: fixed;
      inset-inline: 0;
      bottom: 0;
      z-index: var(--z-nav);
      padding-bottom: env(safe-area-inset-bottom);
      border-top: var(--border-width-thin) solid var(--color-nav-line);
      background: var(--color-nav-bg);
      color: var(--color-nav-text);
      box-shadow: var(--shadow-lg);
    }

    .mobile-tabbar__list {
      display: flex;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .mobile-tabbar__slot {
      flex: 1 1 0;
      min-width: 0;
    }

    .mobile-tabbar__item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      min-height: var(--global-bar-height);
      padding: var(--space-2) var(--space-1);
      overflow: hidden;
      color: var(--color-nav-muted);
      font-size: 0.62rem;
      font-weight: var(--font-weight-semibold);
      text-align: center;
      text-decoration: none;
      white-space: nowrap;
    }

    .mobile-tabbar__icon {
      width: 1.4rem;
      height: 1.4rem;
    }

    .mobile-tabbar__item:hover {
      background: var(--color-nav-surface);
      color: var(--color-nav-text);
    }

    .mobile-tabbar__item--current {
      color: var(--color-nav-active);
    }

    body:not(.admin) {
      padding-block-end: calc(var(--global-bar-height) + env(safe-area-inset-bottom));
    }
  }
}

/* components/modal.css */
@layer components {
  .modal {
    width: min(30rem, calc(100vw - var(--space-6)));
    max-width: none;
    max-height: calc(100vh - var(--space-6));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--color-text);
  }

  .modal::backdrop {
    background: var(--color-overlay);
  }

  .modal__panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--space-6));
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
  }

  .modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: var(--border-width-thin) solid var(--color-border);
  }

  .modal__title {
    margin: 0;
    font-size: var(--font-size-xl);
  }

  .modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-height);
    height: var(--control-height);
    margin: calc(var(--space-2) * -1);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-solid);
    cursor: pointer;
  }

  .modal__close:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
  }

  .modal__body {
    overflow-y: auto;
    padding: var(--space-5);
    overscroll-behavior: contain;
  }

  /* The gallery shows the frame in the page flow. */
  .demo .modal {
    position: static;
    width: 100%;
    max-height: none;
  }
}

@media (max-width: 48rem) {
  @layer components {
    .modal {
      width: 100%;
      max-width: none;
      height: 100%;
      max-height: none;
      margin: 0;
      border-radius: 0;
    }

    .modal__panel {
      min-height: 100%;
      max-height: none;
      border-radius: 0;
    }

    .modal__body {
      padding: var(--space-4);
    }
  }
}

@layer components {
  .auth-modal__tabs {
    display: flex;
    gap: var(--space-1);
    margin-block-end: var(--space-4);
    padding: var(--space-1);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
  }

  .auth-modal__tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding-inline: var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
  }

  .auth-modal__tab:hover {
    color: var(--color-text);
  }

  .auth-modal__tab--current {
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    box-shadow: var(--shadow-sm);
  }

  .auth-modal__fallback {
    margin-block-start: var(--space-4);
    font-size: var(--font-size-sm);
  }

  .auth-modal__notice-close {
    margin-block-start: var(--space-4);
  }
}

/* components/module_card.css */
@layer components {
  .module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: var(--space-3);
  }

  .module-card {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-5);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  }

  .module-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(calc(var(--space-hairline) * -1));
  }

  .module-card__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
  }

  .module-card__text {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  .module-card__arrow {
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
  }

  .module-card__list {
    list-style: none;
    display: grid;
    gap: var(--space-1);
    padding: 0;
    margin: 0;
  }

  .module-card__link {
    border: 0;
    background: none;
    padding: 0;
    text-align: left;
    font: inherit;
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .module-card__link:hover {
    color: var(--color-primary-hover);
  }

  .module-card__slots-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
  }

  .module-card__list--inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
  }

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

/* components/news_body.css */
.news-body {
	white-space: pre-line;
	white-space: pre-line;
}

/* components/news_image.css */
.news-image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 20rem;
	object-fit: cover;
	border-radius: var(--radius-md);
	background: var(--color-surface-muted);
}

/* components/page_header.css */
@layer components {
  .page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-4) var(--space-5);
  }

  .page-head__copy {
    display: grid;
    gap: var(--space-2);
    max-width: 44rem;
  }

  .page-head__eyebrow {
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
  }

  .page-head__title {
    font-size: clamp(2rem, 1.45rem + 1.5vw, 2.75rem);
    text-wrap: balance;
  }

  .page-head__intro {
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
    max-width: 38rem;
  }

  .page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
  }

  @media (max-width: 44rem) {
    .page-head {
      align-items: start;
    }
  }
}

/* components/report_chart.css */
@layer components {
  .report-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
  }
}

/* components/select.css */
@layer components {
  .field__control--select {
    cursor: pointer;
    appearance: auto;
  }

  .field__control--select:disabled {
    cursor: not-allowed;
  }
}

/* components/stat_card.css */
@layer components {
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: var(--space-3);
  }

  .stat-card {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .stat-card__label {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  .stat-value {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
  }

  .stat-card__hint {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
  }
}

/* components/table.css */
@layer components {
  .table-wrapper {
    overflow-x: auto;
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
  }

  .table {
    width: 100%;
    font-size: var(--font-size-sm);
  }

  .table th,
  .table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    vertical-align: top;
  }

  .table th {
    background: var(--color-surface-muted);
    border-bottom: var(--border-width-thin) solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
    white-space: nowrap;
  }

  .table tbody tr + tr td {
    border-top: var(--border-width-thin) solid var(--color-border);
  }

  .table tbody tr:hover td {
    background: var(--color-surface-muted);
  }

  .table__empty {
    color: var(--color-text-muted);
    text-align: center;
  }
}

/* components/tabs.css */
@layer components {
  .tabs {
    overflow-x: auto;
    border-bottom: var(--border-width-thin) solid var(--color-border);
  }

  .tabs__list {
    display: flex;
    gap: var(--space-1);
    list-style: none;
  }

  .tabs__link {
    display: inline-flex;
    align-items: center;
    min-height: 3rem;
    padding-inline: var(--space-2);
    border-bottom: var(--border-width-thick) solid transparent;
    margin-bottom: calc(var(--border-width-thin) * -1);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    white-space: nowrap;
  }

  .tabs__link:hover,
  .tabs__link[data-demo-state="hover"] {
    color: var(--color-text);
    background: var(--color-surface-muted);
  }

  .tabs__link:focus-visible,
  .tabs__link[data-demo-state="focus"] {
    outline: var(--focus-outline-width) solid var(--color-focus);
    outline-offset: var(--focus-outline-inset-offset);
  }

  .tabs__link[aria-current="page"] {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
  }
}

@layer components {
  .tabs__group + .tabs__group {
    margin-block-start: var(--space-3);
  }

  .tabs__heading {
    margin-bottom: var(--space-1);
    padding-inline: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
  }
}

@layer components {
  .tabs__toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--control-height);
    padding: var(--space-2) var(--space-3);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
  }

  @media (max-width: 64rem) {
    .tabs__toggle {
      display: flex;
    }

    .tabs__panel {
      display: none;
    }

    [data-tabs][data-open="true"] .tabs__panel {
      display: block;
    }
  }
}

/* components/textarea.css */
@layer components {
  .field__control--textarea {
    min-height: calc(var(--control-height) * 3);
    resize: vertical;
    line-height: var(--line-height-normal);
  }
}

/* components/timezone_field.css */
.timezone-field__search { margin-bottom: var(--space-2); }
.timezone-field select { width: 100%; }

