/*
 * Klockix UI · Tokens
 *
 * The values every product surface of Klockix is built from: the CRM, the
 * booking page and later the customer portal. Only custom properties, no
 * selectors besides :root and the dark theme, so this file drops into any
 * project, Tailwind included. STYLEGUIDE.md explains every role.
 *
 * Two layers:
 *   --klx-*  the brand palette, verbatim from the Klockix Grafik-Design-System
 *            v1.0 (September 2026).
 *   --k-*    roles. Components use these and nothing else. Neutral steps the
 *            brand system does not define are mixed from two brand colours.
 *            Status colours and shadows are the only literals among the
 *            roles: the brand system has none.
 */

:root {
  /* Brand palette */
  --klx-anthrazit: #23272c;
  --klx-tiefschwarz: #0f1215;
  --klx-stahl: #5b6470;
  --klx-linie: #e1e4e8;
  --klx-nebel: #f3f5f7;
  --klx-weiss: #ffffff;
  --klx-dunkelflaeche: #1d2126;
  --klx-dunkellinie: #3a4149;
  --klx-text-auf-dunkel: #c9ced4;
  --klx-ramp-1: #e6f1fb;
  --klx-ramp-2: #beddf7;
  --klx-ramp-3: #8cc8f5; /* Hellblau. A surface, never text on white (1.75:1). */
  --klx-ramp-4: #4e97d4;
  --klx-ramp-5: #23628f;

  /* Surfaces, from the back to the front */
  --k-canvas: var(--klx-nebel);
  --k-base: var(--klx-weiss);
  --k-elevated: color-mix(in oklab, var(--klx-nebel) 55%, var(--klx-weiss));
  --k-recessed: color-mix(in oklab, var(--klx-linie) 45%, var(--klx-nebel));
  --k-tint: var(--klx-nebel);
  --k-selected: var(--klx-ramp-1);
  --k-contrast: var(--klx-anthrazit);

  /* Lines */
  --k-hairline: var(--klx-linie);
  --k-line: var(--klx-text-auf-dunkel);
  --k-focus: var(--klx-ramp-5);

  /* Text */
  --k-text: var(--klx-anthrazit);
  --k-text-strong: var(--klx-tiefschwarz);
  --k-text-subtle: var(--klx-stahl);
  --k-text-inactive: color-mix(in oklab, var(--klx-stahl) 55%, var(--klx-weiss));
  --k-text-inverse: var(--klx-weiss);
  --k-link: var(--klx-ramp-5);

  /* Brand roles. Anthrazit carries the primary action, Hellblau marks. */
  --k-brand: var(--klx-anthrazit);
  --k-brand-hover: var(--klx-tiefschwarz);
  --k-on-brand: var(--klx-weiss);
  --k-accent: var(--klx-ramp-3);
  --k-on-accent: var(--klx-anthrazit);
  --k-accent-soft: var(--klx-ramp-1);
  --k-accent-ink: var(--klx-ramp-5);

  /* Status. Text colour, tinted surface, solid mark. The brand system has no
     status colours; these are tuned to sit next to Anthrazit and the blue ramp
     and reach 4.5:1 as text on their own tint. Info is the blue ramp. */
  --k-info: var(--klx-ramp-4);
  --k-info-tint: var(--klx-ramp-1);
  --k-info-text: var(--klx-ramp-5);
  --k-success: #3d8a52;
  --k-success-tint: #e7f2ea;
  --k-success-text: #2f6f3e;
  --k-warning: #d4900f;
  --k-warning-tint: #fbf1dc;
  --k-warning-text: #7c5100;
  --k-danger: #c8373c;
  --k-danger-tint: #f9e9e9;
  --k-danger-text: #a3262a;
  --k-on-danger: var(--klx-weiss);
  --k-danger-hover: color-mix(in oklab, var(--k-danger) 85%, var(--klx-tiefschwarz));

  /* Elevation. Flat by default, a hairline does the work. Shadows only for
     what floats: menus, dialogs, the card a pointer is on. */
  --k-shadow-xs: 0 1px 2px rgb(15 18 21 / 0.05);
  --k-shadow-card: 0 1px 2px rgb(15 18 21 / 0.04), 0 6px 16px rgb(15 18 21 / 0.06);
  --k-shadow-overlay: 0 2px 4px rgb(15 18 21 / 0.06), 0 16px 40px rgb(15 18 21 / 0.16);
  --k-backdrop: rgb(15 18 21 / 0.4);

  /* Shape, from the brand system: 6 / 8 / 12 and the pill */
  --k-radius-s: 6px;
  --k-radius-m: 8px;
  --k-radius-l: 12px;
  --k-radius-pill: 999px;

  /* Space, a 4px grid */
  --k-space-1: 4px;
  --k-space-2: 8px;
  --k-space-3: 12px;
  --k-space-4: 16px;
  --k-space-5: 20px;
  --k-space-6: 24px;
  --k-space-8: 32px;
  --k-space-10: 40px;
  --k-space-12: 48px;

  /* Type. Sora for everything, weight separates heading from text. */
  --k-font: 'Sora', system-ui, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --k-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --k-text-xs: 12px;
  --k-text-sm: 13px;
  --k-text-base: 14px;
  --k-text-md: 16px;
  --k-text-lg: 18px;
  --k-text-xl: 22px;
  --k-text-2xl: 28px;
  --k-leading: 1.5;
  --k-leading-tight: 1.25;
  --k-tracking-heading: -0.015em;

  /* Controls */
  --k-control-h: 36px;
  --k-control-h-sm: 30px;
  --k-control-h-lg: 44px;

  /* Layout */
  --k-sidebar-w: 248px;
  --k-topbar-h: 56px;
  --k-content-max: 1200px;
  --k-content-narrow: 760px;

  color-scheme: light;
}

/* Dark theme: follows the system. On dark ground Hellblau carries the action,
   as on klockix.com. A project with its own theme switch copies this block
   under its dark selector, see STYLEGUIDE.md. */
@media (prefers-color-scheme: dark) {
  :root {
    --k-canvas: var(--klx-tiefschwarz);
    --k-base: var(--klx-dunkelflaeche);
    --k-elevated: color-mix(in oklab, var(--klx-dunkelflaeche) 60%, var(--klx-tiefschwarz));
    --k-recessed: var(--klx-tiefschwarz);
    --k-tint: color-mix(in oklab, var(--klx-dunkellinie) 45%, var(--klx-dunkelflaeche));
    --k-selected: color-mix(in oklab, var(--klx-ramp-5) 40%, var(--klx-dunkelflaeche));
    --k-contrast: var(--klx-weiss);
    --k-hairline: var(--klx-dunkellinie);
    --k-line: color-mix(in oklab, var(--klx-text-auf-dunkel) 35%, var(--klx-dunkellinie));
    --k-focus: var(--klx-ramp-3);
    --k-text: var(--klx-weiss);
    --k-text-strong: var(--klx-weiss);
    --k-text-subtle: var(--klx-text-auf-dunkel);
    --k-text-inactive: color-mix(in oklab, var(--klx-text-auf-dunkel) 50%, var(--klx-dunkelflaeche));
    --k-text-inverse: var(--klx-anthrazit);
    --k-link: var(--klx-ramp-3);
    --k-brand: var(--klx-ramp-3);
    --k-brand-hover: var(--klx-ramp-2);
    --k-on-brand: var(--klx-anthrazit);
    --k-accent-soft: color-mix(in oklab, var(--klx-ramp-5) 30%, var(--klx-dunkelflaeche));
    --k-accent-ink: var(--klx-ramp-3);
    /* Ramp-4, so info stays apart from Hellblau, which marks and acts here. */
    --k-info: var(--klx-ramp-4);
    --k-info-tint: color-mix(in oklab, var(--klx-ramp-5) 30%, var(--klx-dunkelflaeche));
    --k-info-text: var(--klx-ramp-2);
    --k-success: #5fb176;
    --k-success-tint: color-mix(in oklab, #3d8a52 22%, var(--klx-dunkelflaeche));
    --k-success-text: #9fd6ad;
    --k-warning: #e8a83a;
    --k-warning-tint: color-mix(in oklab, #d4900f 20%, var(--klx-dunkelflaeche));
    --k-warning-text: #f2c879;
    --k-danger: #c8373c;
    --k-danger-tint: color-mix(in oklab, #c8373c 22%, var(--klx-dunkelflaeche));
    --k-danger-text: #f3a5a7;
    --k-shadow-xs: 0 1px 2px rgb(0 0 0 / 0.3);
    --k-shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 16px rgb(0 0 0 / 0.3);
    --k-shadow-overlay: 0 2px 4px rgb(0 0 0 / 0.3), 0 16px 40px rgb(0 0 0 / 0.5);
    --k-backdrop: rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

/*
 * Klockix UI · Components
 *
 * Built on tokens.css, which comes first. Structure and patterns follow the
 * Cloudflare dashboard (sidebar, page header, layered cards, setting rows,
 * quiet tables); the look is Klockix (Sora, Anthrazit, the blue ramp).
 * STYLEGUIDE.md describes the components and when to use them, /styleguide
 * in the CRM shows them.
 *
 * Rules for this file:
 * - Colours only through --k-* roles. A --klx-* colour or a hex value here is
 *   a bug, except in the swatches of the styleguide section at the end.
 * - No inline styles anywhere: the CSP forbids them. Variants are classes.
 * - Interactive parts work without JavaScript: links, forms and the popover
 *   attribute.
 */

/* ── Fonts ──────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/sora-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/sora-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/sora-600.woff2') format('woff2');
}

/* ── Base ───────────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--k-font);
  font-size: var(--k-text-base);
  line-height: var(--k-leading);
  color: var(--k-text);
  background: var(--k-canvas);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--k-text-strong);
  font-weight: 600;
  line-height: var(--k-leading-tight);
}

p {
  margin: 0;
}

a {
  color: var(--k-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--k-focus);
  outline-offset: 2px;
}

::selection {
  background: var(--k-accent-soft);
}

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

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

hr {
  border: 0;
  border-top: 1px solid var(--k-hairline);
  margin: var(--k-space-4) 0;
}

/* ── Utilities, deliberately few ────────────────────────────────────────── */

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

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-2);
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-6);
}

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

.spread {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-3);
}

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

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

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

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Main column and a side column, as on a record page. */
.grid-main-aside {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-main-aside {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Four tiles stay two by two on a phone, a single column wastes the screen. */
@media (max-width: 340px) {
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.subtle {
  color: var(--k-text-subtle);
}

.small {
  font-size: var(--k-text-sm);
}

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

.mono {
  font-family: var(--k-font-mono);
  font-size: 0.92em;
}

.nowrap {
  white-space: nowrap;
}

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

.pre-line {
  white-space: pre-line;
}

/* A link that wraps a block and should not look like one. */
a.row-plain {
  color: inherit;
  text-decoration: none;
  border-radius: var(--k-radius-s);
}

a.row-plain:hover .spread > :first-child {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Icons ──────────────────────────────────────────────────────────────── */

.icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

.icon-xl {
  width: 32px;
  height: 32px;
}

/* ── Logo ───────────────────────────────────────────────────────────────── */

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

.logo img {
  height: 26px;
  width: auto;
}

/* The product name beside the lockup: "CRM", later "Portal". */
.logo-product {
  padding-left: var(--k-space-2);
  border-left: 1px solid var(--k-hairline);
  font-size: var(--k-text-sm);
  font-weight: 500;
  color: var(--k-text-subtle);
  letter-spacing: 0.02em;
}

/* ── App shell: sidebar, top bar, content ───────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--k-sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--k-space-4);
  height: 100vh;
  padding: var(--k-space-4) var(--k-space-3);
  overflow-y: auto;
  background: var(--k-base);
  border-right: 1px solid var(--k-hairline);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--k-space-2);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--k-space-1);
  padding-top: var(--k-space-3);
  border-top: 1px solid var(--k-hairline);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  min-height: 36px;
  padding: var(--k-space-2);
  border-radius: var(--k-radius-s);
  color: var(--k-text);
  text-decoration: none;
  font-weight: 400;
}

.nav a .icon {
  color: var(--k-text-subtle);
}

.nav a:hover {
  background: var(--k-tint);
}

.nav a[aria-current='page'] {
  background: var(--k-selected);
  color: var(--k-text-strong);
}

.nav a[aria-current='page'] .icon {
  color: var(--k-accent-ink);
}

/* Navigation section: space above, a grey label in the size of the entries, then the entries. */
.nav-section {
  margin-top: var(--k-space-5);
}

.nav-section-label {
  margin: 0;
  padding: var(--k-space-2);
  font-weight: 400;
  color: var(--k-text-subtle);
}

/* Navigation group: folds open and shut, a line in front of its pages. */
.nav-group > summary {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  min-height: 36px;
  padding: var(--k-space-2);
  border-radius: var(--k-radius-s);
  color: var(--k-text);
  font-weight: 400;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group > summary .icon {
  color: var(--k-text-subtle);
}

.nav-group > summary:hover {
  background: var(--k-tint);
}

.nav-group:has([aria-current='page']) > summary {
  color: var(--k-text-strong);
}

.nav-group:has([aria-current='page']) > summary .icon:first-child {
  color: var(--k-accent-ink);
}

.nav-group-chevron {
  margin-left: auto;
  transition: transform 150ms ease;
}

.nav-group[open] > summary .nav-group-chevron {
  transform: rotate(90deg);
}

/* The line sits under the middle of the group icon: padding plus half of 16px. */
.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 var(--k-space-1) calc(var(--k-space-2) + 7.5px);
  padding-left: var(--k-space-2);
  border-left: 1px solid var(--k-hairline);
}

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

/* Area in the first level: a chevron says a click goes one level deeper. */
.nav-area-chevron {
  margin-left: auto;
}

/* Inside an area: back to all areas, quiet, then the area's name. */
.nav-area-head {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-1);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  min-height: 32px;
  padding: var(--k-space-1) var(--k-space-2);
  border-radius: var(--k-radius-s);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  text-decoration: none;
}

.nav-back:hover {
  background: var(--k-tint);
  color: var(--k-text);
}

.nav-area-title {
  margin: 0;
  padding: var(--k-space-1) var(--k-space-2);
  color: var(--k-text-strong);
  font-size: var(--k-text-md);
  font-weight: 600;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--k-space-3);
  min-height: var(--k-topbar-h);
  padding: 0 var(--k-space-6);
  background: color-mix(in oklab, var(--k-canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--k-hairline);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
}

.topbar .topbar-menu {
  display: none;
}

.content {
  width: 100%;
  max-width: var(--k-content-max);
  margin: 0 auto;
  padding: var(--k-space-6) var(--k-space-6) var(--k-space-12);
  display: flex;
  flex-direction: column;
  gap: var(--k-space-6);
}

.content-narrow {
  max-width: var(--k-content-narrow);
}

/* Search in the top bar: the field, and below it the panel the search script fills while typing. */
.search-box {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.search-box .input {
  width: 100%;
  padding-right: 48px;
}

.search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: max(100%, min(560px, calc(100vw - 32px)));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: var(--k-space-2);
  background: var(--k-base);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  box-shadow: var(--k-shadow-overlay);
}

.search-group + .search-group {
  margin-top: var(--k-space-2);
  padding-top: var(--k-space-2);
  border-top: 1px solid var(--k-hairline);
}

.search-group-head {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  margin: 0;
  padding: var(--k-space-1) var(--k-space-2);
  color: var(--k-text-subtle);
  font-size: var(--k-text-xs);
}

.search-group-head a {
  margin-left: auto;
}

.search-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-item {
  display: flex;
  align-items: center;
  gap: var(--k-space-3);
  padding: var(--k-space-2);
  border-radius: var(--k-radius-s);
  color: var(--k-text);
  text-decoration: none;
}

.search-item > .icon {
  flex: none;
  color: var(--k-text-subtle);
}

.search-item:hover,
.search-item.is-active {
  background: var(--k-selected);
}

.search-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-item-title,
.search-item-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-item-title {
  color: var(--k-text-strong);
  font-weight: 500;
}

.search-item-meta {
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.search-empty {
  margin: 0;
  padding: var(--k-space-3) var(--k-space-2);
  color: var(--k-text-subtle);
}

.search-all {
  display: block;
  margin-top: var(--k-space-2);
  padding: var(--k-space-2);
  border-top: 1px solid var(--k-hairline);
  font-size: var(--k-text-sm);
}

@media (max-width: 720px) {
  .topbar .breadcrumbs,
  .search-box-key {
    display: none;
  }

  .search-box {
    max-width: none;
  }
}

/* Below this width the sidebar becomes a drawer behind a menu button. */
@media (max-width: 960px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .app > .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 var(--k-space-4);
  }

  .topbar .topbar-menu {
    display: inline-flex;
  }

  .content {
    padding: var(--k-space-5) var(--k-space-4) var(--k-space-10);
  }
}

/* The drawer is the same sidebar inside a popover. */
.drawer[popover] {
  inset: 0 auto 0 0;
  width: min(300px, 86vw);
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--k-hairline);
  background: var(--k-base);
  color: var(--k-text);
  box-shadow: var(--k-shadow-overlay);
}

.drawer[popover]::backdrop {
  background: var(--k-backdrop);
}

.drawer .sidebar {
  position: static;
  height: 100%;
  border-right: 0;
}

/* ── Breadcrumbs ────────────────────────────────────────────────────────── */

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--k-space-1);
  list-style: none;
  font-size: var(--k-text-sm);
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-1);
  color: var(--k-text-subtle);
}

.breadcrumbs li + li::before {
  content: '/';
  color: var(--k-text-inactive);
  padding-right: var(--k-space-1);
}

.breadcrumbs a {
  color: var(--k-text-subtle);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--k-text);
  text-decoration: underline;
}

.breadcrumbs [aria-current='page'] {
  color: var(--k-text-strong);
  font-weight: 500;
}

/* ── Page header ────────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--k-space-4);
}

.page-heading {
  display: flex;
  align-items: center;
  gap: var(--k-space-3);
  min-width: 0;
}

.page-title {
  font-size: var(--k-text-2xl);
  letter-spacing: var(--k-tracking-heading);
}

.page-description {
  margin-top: var(--k-space-1);
  max-width: 68ch;
  color: var(--k-text-subtle);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--k-space-2);
}

/* ── Section: a heading above a group of cards ──────────────────────────── */

.section {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-3);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--k-space-2) var(--k-space-4);
}

.section-title {
  font-size: var(--k-text-lg);
  letter-spacing: var(--k-tracking-heading);
}

.section-description {
  margin-top: 2px;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--k-base);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-l);
  box-shadow: var(--k-shadow-xs);
  overflow: hidden;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-2) var(--k-space-4);
  padding: var(--k-space-4) var(--k-space-5);
  border-bottom: 1px solid var(--k-hairline);
}

.card-title {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  font-size: var(--k-text-md);
}

.card-description {
  margin-top: 2px;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-4);
  padding: var(--k-space-5);
}

/* Tables and lists run edge to edge. */
.card-flush {
  padding: 0;
  gap: 0;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-5);
  background: var(--k-elevated);
  border-top: 1px solid var(--k-hairline);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.card-footer > :last-child {
  margin-left: auto;
}

/* Fields in a footer, as for adding files to a card's list, take its whole width. */
.card-footer > .stack,
.card-footer > .form-row {
  flex: 1 1 100%;
  margin-left: 0;
}

/* The danger zone: one irreversible action, set apart. */
.card-danger {
  border-color: color-mix(in oklab, var(--k-danger) 45%, var(--k-hairline));
}

.card-danger .card-header {
  border-bottom-color: color-mix(in oklab, var(--k-danger) 25%, var(--k-hairline));
}

.card-danger .card-title {
  color: var(--k-danger-text);
}

.card-danger .card-footer {
  background: var(--k-danger-tint);
  border-top-color: color-mix(in oklab, var(--k-danger) 25%, var(--k-hairline));
}

/* A whole card as a link, for choices and shortcuts. */
a.card {
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms, box-shadow 120ms;
}

a.card:hover {
  border-color: var(--k-line);
  box-shadow: var(--k-shadow-card);
}

/* ── Editable card: the data first, a form on "Bearbeiten" ──────────────── */

/* The switch is a <details> in the header. It reads "Bearbeiten" while shut
   and "Abbrechen" while open; the card shows either its view or its form. */
.editable-switch > summary {
  list-style: none;
  user-select: none;
}

.editable-switch > summary::-webkit-details-marker {
  display: none;
}

.editable-switch[open] .editable-closed,
.editable-switch:not([open]) .editable-open,
.editable:has(.editable-switch[open]) .editable-view,
.editable:not(:has(.editable-switch[open])) .editable-form {
  display: none;
}

/* ── Danger zone: the irreversible action, folded away at the end ───────── */

.danger-zone > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-2);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.danger-zone > summary::-webkit-details-marker {
  display: none;
}

.danger-zone > summary:hover {
  color: var(--k-danger-text);
}

.danger-zone-chevron {
  transition: transform 150ms ease;
}

.danger-zone[open] .danger-zone-chevron {
  transform: rotate(90deg);
}

.danger-zone-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-3) var(--k-space-6);
  margin-top: var(--k-space-3);
  padding: var(--k-space-4) var(--k-space-5);
  border: 1px solid color-mix(in oklab, var(--k-danger) 45%, var(--k-hairline));
  border-radius: var(--k-radius-l);
  background: var(--k-danger-tint);
  font-size: var(--k-text-sm);
}

/* ── Setting row: what it is on the left, the control on the right ──────── */

.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: var(--k-space-3) var(--k-space-6);
  align-items: start;
  padding: var(--k-space-5);
}

.setting + .setting {
  border-top: 1px solid var(--k-hairline);
}

.setting-title {
  font-size: var(--k-text-base);
  font-weight: 600;
  color: var(--k-text-strong);
}

.setting-description {
  margin-top: 2px;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

@media (max-width: 720px) {
  .setting {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Stat tiles ─────────────────────────────────────────────────────────── */

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-1);
  padding: var(--k-space-4) var(--k-space-5);
  background: var(--k-base);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-l);
  box-shadow: var(--k-shadow-xs);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

a.stat:hover {
  border-color: var(--k-line);
  box-shadow: var(--k-shadow-card);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  font-weight: 500;
}

.stat-value {
  font-size: var(--k-text-2xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: var(--k-tracking-heading);
  color: var(--k-text-strong);
  font-variant-numeric: tabular-nums;
}

.stat-meta {
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

/* ── Tiles: one thing in a sentence, the last mail or the next appointment ─ */

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--k-space-1);
  min-width: 0;
  padding: var(--k-space-4) var(--k-space-5);
  background: var(--k-base);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-l);
  box-shadow: var(--k-shadow-xs);
}

.tile:has(.row-link):hover {
  border-color: var(--k-line);
  box-shadow: var(--k-shadow-card);
}

.tile-label {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  margin-bottom: var(--k-space-1);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  font-weight: 500;
}

.tile-title {
  overflow: hidden;
  color: var(--k-text-strong);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-empty {
  color: var(--k-text-subtle);
  font-weight: 400;
}

.tile-meta {
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.tile-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--k-text);
  font-size: var(--k-text-sm);
}

.tile-action {
  position: relative;
  z-index: 1;
  margin-top: var(--k-space-2);
}

/* ── Chat: a conversation, theirs on the left, ours on the right ─────────── */

/* Newest first in the markup, shown at the bottom. A column in reverse
   scrolls from its end, so the latest message is in view without a script. */
.chat {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--k-space-4);
  max-height: 560px;
  overflow-y: auto;
  padding: var(--k-space-5);
  list-style: none;
}

.chat-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--k-space-1);
  max-width: min(80%, 560px);
}

.chat-message-out {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-meta {
  color: var(--k-text-subtle);
  font-size: var(--k-text-xs);
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  padding: var(--k-space-3) var(--k-space-4);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-l);
  border-top-left-radius: var(--k-radius-s);
  background: var(--k-elevated);
  color: inherit;
  text-decoration: none;
}

.chat-message-out .chat-bubble {
  border-radius: var(--k-radius-l);
  border-top-right-radius: var(--k-radius-s);
  background: var(--k-accent-soft);
  border-color: transparent;
}

a.chat-bubble:hover {
  border-color: var(--k-line);
  box-shadow: var(--k-shadow-card);
}

.chat-title {
  color: var(--k-text-strong);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.chat-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--k-text);
  font-size: var(--k-text-sm);
  overflow-wrap: anywhere;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--k-space-2);
  height: var(--k-control-h);
  padding: 0 14px;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius-s);
  background: var(--k-base);
  color: var(--k-text);
  font: inherit;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}

.btn:hover {
  background: var(--k-tint);
  text-decoration: none;
}

.btn-primary {
  background: var(--k-brand);
  border-color: var(--k-brand);
  color: var(--k-on-brand);
}

.btn-primary:hover {
  background: var(--k-brand-hover);
  border-color: var(--k-brand-hover);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-danger {
  background: var(--k-danger);
  border-color: var(--k-danger);
  color: var(--k-on-danger);
}

.btn-danger:hover {
  background: var(--k-danger-hover);
  border-color: var(--k-danger-hover);
}

/* Destructive, but one step before the real thing: opens a confirmation. */
.btn-danger-outline {
  color: var(--k-danger-text);
  border-color: color-mix(in oklab, var(--k-danger) 50%, var(--k-hairline));
}

.btn-danger-outline:hover {
  background: var(--k-danger-tint);
}

.btn-sm {
  height: var(--k-control-h-sm);
  padding: 0 10px;
  font-size: var(--k-text-sm);
}

.btn-lg {
  height: var(--k-control-h-lg);
  padding: 0 20px;
  font-size: var(--k-text-md);
}

.btn-icon {
  width: var(--k-control-h);
  padding: 0;
}

.btn-icon.btn-sm {
  width: var(--k-control-h-sm);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.5;
  pointer-events: none;
}

/* A form that is only a button sits inline. */
form.inline-form {
  display: inline-flex;
  margin: 0;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.label {
  font-size: var(--k-text-sm);
  font-weight: 500;
  color: var(--k-text-strong);
}

.label .optional {
  font-weight: 400;
  color: var(--k-text-subtle);
}

.hint {
  font-size: var(--k-text-sm);
  color: var(--k-text-subtle);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--k-text-sm);
  color: var(--k-danger-text);
}

.input {
  width: 100%;
  height: var(--k-control-h);
  padding: 0 var(--k-space-3);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius-s);
  background: var(--k-base);
  color: var(--k-text);
  font: inherit;
  transition: border-color 120ms, box-shadow 120ms;
}

.input::placeholder {
  color: var(--k-text-inactive);
}

.input:hover {
  border-color: var(--k-text-subtle);
}

.input:focus-visible {
  outline: none;
  border-color: var(--k-focus);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--k-focus) 25%, transparent);
}

.input[aria-invalid='true'] {
  border-color: var(--k-danger);
}

textarea.input {
  height: auto;
  min-height: 96px;
  padding: var(--k-space-2) var(--k-space-3);
  line-height: var(--k-leading);
  resize: vertical;
}

select.input {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* A file field: the choose button drawn like a small secondary button, the chosen names beside it. */
input.input-file {
  height: auto;
  min-height: var(--k-control-h);
  padding: 3px;
  cursor: pointer;
}

.input-file::file-selector-button {
  height: var(--k-control-h-sm);
  margin-right: var(--k-space-3);
  padding: 0 10px;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius-s);
  background: var(--k-base);
  color: var(--k-text);
  font: inherit;
  font-size: var(--k-text-sm);
  font-weight: 500;
  cursor: pointer;
}

.input-file::file-selector-button:hover {
  background: var(--k-tint);
}

/* An uploaded image on its file page: as wide as the card, never taller than a screen. */
.file-preview {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 640px);
  margin: 0 auto;
  border-radius: var(--k-radius-s);
}

/* A smaller control for toolbars, as high as a small button. */
.input-sm {
  height: var(--k-control-h-sm);
  font-size: var(--k-text-sm);
}

select.input-sm {
  padding-right: 28px;
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
}

.input[readonly] {
  background: var(--k-elevated);
}

/* For pasted lists and other text where columns matter. */
textarea.input-code {
  min-height: 240px;
  font-family: var(--k-font-mono);
  font-size: var(--k-text-sm);
  white-space: pre;
}

.input-lg {
  height: var(--k-control-h-lg);
  font-size: var(--k-text-md);
}

/* An input with an icon at the start, e.g. search. */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group > .icon {
  position: absolute;
  left: 10px;
  color: var(--k-text-subtle);
  pointer-events: none;
}

.input-group > .input {
  padding-left: 34px;
}

.input-group > .kbd {
  position: absolute;
  right: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-2);
  cursor: pointer;
}

.check input:not(.switch) {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--k-brand);
}

/* A checkbox drawn as a switch, for on/off settings. */
.switch {
  position: relative;
  flex: none;
  appearance: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: var(--k-radius-pill);
  background: var(--k-line);
  cursor: pointer;
  transition: background-color 150ms;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--k-base);
  box-shadow: var(--k-shadow-xs);
  transition: transform 150ms;
}

.switch:checked {
  background: var(--k-brand);
}

.switch:checked::after {
  transform: translateX(16px);
}

/* Week editor: one day per row, a switch on the left, up to two windows on the right. */
.week {
  display: flex;
  flex-direction: column;
}

.week-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--k-space-2) var(--k-space-4);
  padding: var(--k-space-3) var(--k-space-4);
  border-top: 1px solid var(--k-hairline);
}

.week-row:first-child {
  border-top: 0;
}

.week-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--k-space-2) var(--k-space-4);
}

.week-range {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
}

.week-range .input {
  width: 7.5rem;
}

.week-sep {
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

/* A day switched off keeps its times for next time, quietly. */
.week-row:has(.switch:not(:checked)) .week-times {
  opacity: 0.45;
}

.week-error {
  grid-column: 2;
  margin: 0;
  color: var(--k-danger-text);
  font-size: var(--k-text-sm);
}

@media (max-width: 640px) {
  .week-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .week-error {
    grid-column: 1;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--k-space-4);
}

.form-grid .span-all {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Fields in one line, aligned on their inputs. */
.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--k-space-3);
}

.form-row > .field {
  flex: 1 1 140px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--k-space-2);
}

/* ── Table ──────────────────────────────────────────────────────────────── */

.table-wrap {
  /* Positioned, so absolutely placed parts of the table, such as a hidden
     label for screen readers, scroll with it instead of widening the page. */
  position: relative;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--k-text-base);
}

.table th {
  padding: 10px var(--k-space-4);
  background: var(--k-elevated);
  border-bottom: 1px solid var(--k-hairline);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: var(--k-space-3) var(--k-space-4);
  border-bottom: 1px solid var(--k-hairline);
  vertical-align: middle;
}

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

.table tbody tr {
  position: relative;
}

.table tbody tr:hover {
  background: var(--k-tint);
}

/* The whole row follows its first link. */
.row-link {
  color: var(--k-text-strong);
  font-weight: 500;
  text-decoration: none;
}

.row-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.row-link:hover {
  text-decoration: underline;
}

/* Anything clickable in a linked row sits above the row link. */
.table .cell-actions {
  position: relative;
  z-index: 1;
  text-align: right;
  white-space: nowrap;
}

.table .cell-actions > :not([popover]) {
  display: inline-flex;
  vertical-align: middle;
}

.table .cell-actions > :not([popover]) + :not([popover]) {
  margin-left: var(--k-space-2);
}

/* A link in a linked row that goes somewhere else, e.g. an address. */
.table .cell-link {
  position: relative;
  z-index: 1;
}

.cell-sub {
  display: block;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

/* A warning that belongs to one cell, e.g. a name that differs. */
.cell-warning {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--k-warning-text);
}

.cell-warning .icon {
  width: 12px;
  height: 12px;
}

.table .cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── List: rows inside a card ───────────────────────────────────────────── */

.list {
  list-style: none;
}

.list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-5);
}

.list-item + .list-item {
  border-top: 1px solid var(--k-hairline);
}

.list-item:has(.row-link):hover {
  background: var(--k-tint);
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-title {
  display: block;
  font-weight: 500;
  color: var(--k-text-strong);
}

.list-meta {
  display: block;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.list-trailing {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  flex: none;
}

/* A time in front of a list row: "10:00" over "10:30". */
.list-time {
  flex: none;
  width: 56px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--k-text-strong);
}

.list-time small {
  display: block;
  font-weight: 400;
  color: var(--k-text-subtle);
}

/* Day heading between list rows. */
.list-group {
  padding: var(--k-space-2) var(--k-space-5);
  background: var(--k-elevated);
  border-top: 1px solid var(--k-hairline);
  border-bottom: 1px solid var(--k-hairline);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  font-weight: 500;
}

.list-group:first-child {
  border-top: 0;
}

.list-group + .list-item {
  border-top: 0;
}

/* ── Badge ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--k-radius-pill);
  background: var(--k-tint);
  color: var(--k-text);
  font-size: var(--k-text-xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.badge-plain::before {
  display: none;
}

.badge-info {
  background: var(--k-info-tint);
  color: var(--k-info-text);
}

.badge-success {
  background: var(--k-success-tint);
  color: var(--k-success-text);
}

.badge-warning {
  background: var(--k-warning-tint);
  color: var(--k-warning-text);
}

.badge-danger {
  background: var(--k-danger-tint);
  color: var(--k-danger-text);
}

/* Done and handed on, e.g. a converted lead, and anything under test: a test
   device, a partner testing. Anthrazit on light ground, white on dark, so it
   never looks like the blue badges. */
.badge-contrast {
  background: var(--k-contrast);
  color: var(--k-text-inverse);
}

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

.badge .icon {
  width: 12px;
  height: 12px;
}

/* The small × inside a badge that removes it. */
.chip-remove.btn {
  width: 18px;
  height: 18px;
  margin-right: -4px;
  border-radius: 50%;
  color: inherit;
}

.chip-remove .icon {
  width: 12px;
  height: 12px;
}

/* ── Banner ─────────────────────────────────────────────────────────────── */

.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-4);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  background: var(--k-base);
}

.banner > .icon {
  margin-top: 2px;
}

.banner-body {
  flex: 1;
  min-width: 0;
}

.banner-title {
  font-weight: 600;
  color: inherit;
}

.banner-actions {
  flex: none;
  align-self: center;
}

.banner-info {
  background: var(--k-info-tint);
  border-color: color-mix(in oklab, var(--k-info) 35%, transparent);
  color: var(--k-info-text);
}

.banner-success {
  background: var(--k-success-tint);
  border-color: color-mix(in oklab, var(--k-success) 35%, transparent);
  color: var(--k-success-text);
}

.banner-warning {
  background: var(--k-warning-tint);
  border-color: color-mix(in oklab, var(--k-warning) 40%, transparent);
  color: var(--k-warning-text);
}

.banner-danger {
  background: var(--k-danger-tint);
  border-color: color-mix(in oklab, var(--k-danger) 35%, transparent);
  color: var(--k-danger-text);
}

.banner a {
  color: inherit;
  font-weight: 500;
}

/* A list inside a hint, e.g. the rows an import skipped. */
.banner ul {
  margin-top: var(--k-space-1);
  padding-left: 1.2em;
  list-style: disc;
}

/* On a phone the action moves under the text, aligned with it. */
@media (max-width: 720px) {
  .banner {
    flex-wrap: wrap;
  }

  .banner-actions {
    flex-basis: 100%;
    padding-left: 28px;
  }
}

/* ── Empty state ────────────────────────────────────────────────────────── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--k-space-2);
  padding: var(--k-space-10) var(--k-space-6);
  text-align: center;
  color: var(--k-text-subtle);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--k-space-1);
  border-radius: var(--k-radius-l);
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}

.empty-title {
  font-size: var(--k-text-md);
  font-weight: 600;
  color: var(--k-text-strong);
}

.empty-text {
  max-width: 46ch;
}

.empty .form-actions {
  margin-top: var(--k-space-2);
}

.empty-sm {
  padding: var(--k-space-6) var(--k-space-5);
}

/* ── Avatar ─────────────────────────────────────────────────────────────── */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
  font-size: var(--k-text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: var(--k-text-md);
}

/* People are told apart by colour first, initials second. Four steps of the
   brand palette, picked by a hash of the name. */
.avatar-b {
  background: var(--k-accent);
  color: var(--k-on-accent);
}

.avatar-c {
  background: var(--k-contrast);
  color: var(--k-text-inverse);
}

.avatar-d {
  background: var(--k-recessed);
  color: var(--k-text);
}

/* ── Dialog and menu (popover attribute, no script) ─────────────────────── */

.dialog[popover],
.menu[popover] {
  /* A popover inherits from where it sits in the markup, e.g. a table cell
     with nowrap and right alignment. Reset what would break the text. */
  white-space: normal;
  text-align: start;
}

.dialog[popover],
.dialog-layer > .dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-l);
  background: var(--k-base);
  color: var(--k-text);
  box-shadow: var(--k-shadow-overlay);
}

.dialog-wide[popover],
.dialog-layer > .dialog-wide {
  width: min(680px, calc(100vw - 32px));
}

/* A wide dialog holds a form: its body scrolls, header and buttons stay. */
.dialog-wide > form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 66px);
}

.dialog-wide .dialog-body {
  overflow-y: auto;
  color: var(--k-text);
}

.dialog[popover]::backdrop {
  background: var(--k-backdrop);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--k-space-3);
  padding: var(--k-space-5) var(--k-space-5) 0;
}

.dialog-title {
  font-size: var(--k-text-lg);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-5) var(--k-space-5);
  color: var(--k-text-subtle);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--k-space-2);
  padding: var(--k-space-3) var(--k-space-5);
  background: var(--k-elevated);
  border-top: 1px solid var(--k-hairline);
}

/* A dialog that stays open across a reload: shown while its id, or the id of
   something in it, is the address's fragment (RemovalDialog). Above the top
   bar, over a backdrop that catches stray clicks, and the page behind does not
   scroll. */
.dialog-layer {
  display: none;
}

.dialog-layer:target,
.dialog-layer:has(:target) {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--k-space-4);
  background: var(--k-backdrop);
}

.dialog-layer:target > .dialog,
.dialog-layer:has(:target) > .dialog {
  display: flex;
  flex-direction: column;
  /* The visible height, so the buttons stay above a phone's toolbar. */
  max-height: calc(100dvh - 32px);
  /* The grey footer keeps to the rounded corners. */
  overflow: hidden;
}

.dialog-layer .dialog-body {
  min-height: 0;
}

html:has(.dialog-layer:target, .dialog-layer :target) {
  overflow: hidden;
}

/* Entries to remove one by one: list rows edge to edge, the sentence above
   them indented like any dialog text. */
.dialog-body.removal-body {
  gap: 0;
  padding: 0;
}

.removal-intro {
  padding: var(--k-space-3) var(--k-space-5);
}

.removal-body .list {
  border-top: 1px solid var(--k-hairline);
}

.removal-done {
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.removal-blocked {
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  white-space: nowrap;
}

.btn-remove:hover {
  background: var(--k-danger-tint);
  color: var(--k-danger-text);
}

.removal-left {
  margin-right: auto;
  align-self: center;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.menu[popover] {
  min-width: 220px;
  padding: var(--k-space-1);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  background: var(--k-base);
  color: var(--k-text);
  box-shadow: var(--k-shadow-overlay);
}

/* Next to its button where the browser can anchor it, centred otherwise. */
@supports (position-area: bottom) {
  .menu[popover] {
    position-area: bottom span-left;
    position-try-fallbacks: flip-block;
    margin: 6px 0;
  }

  .menu-anchor {
    anchor-name: --menu;
  }

  .menu[popover] {
    position-anchor: --menu;
  }
}

.menu-header {
  padding: var(--k-space-2) var(--k-space-3);
  border-bottom: 1px solid var(--k-hairline);
  margin-bottom: var(--k-space-1);
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  width: 100%;
  padding: 7px var(--k-space-3);
  border: 0;
  border-radius: var(--k-radius-s);
  background: none;
  color: var(--k-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu a:hover,
.menu button:hover {
  background: var(--k-tint);
}

/* ── Toolbar and filter chips ───────────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-4);
  border-bottom: 1px solid var(--k-hairline);
}

.toolbar > form {
  display: flex;
  flex: 1 1 280px;
  gap: var(--k-space-2);
  max-width: 440px;
}

.toolbar .input-group {
  flex: 1;
}

/* Search and filter lists in one row above a table. Takes the whole toolbar
   width, the chips follow below. */
.toolbar > form.filter-bar {
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  max-width: none;
}

.filter-bar .input-group {
  flex: 1 1 220px;
  max-width: 320px;
}

.filter-select {
  flex: 0 1 200px;
  min-width: 140px;
}

/* A list that narrows what is shown is marked while it does. */
.filter-select.is-active .input {
  border-color: var(--k-accent-ink);
  background-color: var(--k-selected);
  color: var(--k-text-strong);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--k-control-h-sm);
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--k-radius-pill);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  font-weight: 500;
  text-decoration: none;
}

.chip:hover {
  background: var(--k-tint);
  color: var(--k-text);
}

.chip[aria-current='true'] {
  background: var(--k-selected);
  border-color: color-mix(in oklab, var(--k-accent-ink) 25%, transparent);
  color: var(--k-text-strong);
}

.chip-count {
  color: var(--k-text-subtle);
  font-variant-numeric: tabular-nums;
}

/* ── View switch: list or board, as icon buttons ────────────────────────── */

.view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  background: var(--k-base);
}

.view-switch-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: var(--k-radius-s);
  color: var(--k-text-subtle);
}

.view-switch-item:hover {
  background: var(--k-tint);
  color: var(--k-text);
}

.view-switch-item[aria-current='true'] {
  background: var(--k-selected);
  color: var(--k-accent-ink);
}

/* ── Board: columns of cards, e.g. the sales pipeline ──────────────────── */

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(196px, 1fr);
  gap: var(--k-space-3);
  overflow-x: auto;
  padding-bottom: var(--k-space-2);
}

.board-column {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-l);
  background: var(--k-recessed);
}

/* Where a dragged card would land. */
.board-column.is-over {
  outline: 2px dashed var(--k-focus);
  outline-offset: -2px;
}

.board-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-2);
  padding: var(--k-space-3);
}

.board-column-title {
  font-size: var(--k-text-base);
  font-weight: 500;
}

.board-column-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--k-space-2);
  padding: 0 var(--k-space-2) var(--k-space-2);
}

.board-column-footer {
  padding: var(--k-space-2) var(--k-space-3);
  border-top: 1px solid var(--k-hairline);
  font-size: var(--k-text-sm);
  color: var(--k-text-subtle);
}

.board-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--k-space-2);
  padding: var(--k-space-3);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  background: var(--k-base);
  box-shadow: var(--k-shadow-xs);
}

.board-card:hover {
  border-color: var(--k-line);
}

.board-card[draggable='true'] {
  cursor: grab;
}

.board-card.is-dragging {
  opacity: 0.5;
}

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

.board-card-title {
  overflow-wrap: anywhere;
}

/* Above the card-wide title link. */
.board-card-actions {
  position: relative;
  z-index: 1;
  margin: -4px -4px 0 0;
}

.board-card-meta {
  margin: 0;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
  overflow-wrap: anywhere;
}

.board-card-footer {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.board-card-end {
  margin-left: auto;
}

.board-empty {
  padding: var(--k-space-4) var(--k-space-2);
  color: var(--k-text-inactive);
  font-size: var(--k-text-sm);
  text-align: center;
}

/* ── Distribution: how a whole splits into parts ────────────────────────── */

.distribution {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-3);
}

.distribution-bar {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: var(--k-radius-pill);
  overflow: hidden;
}

.distribution-track {
  fill: var(--k-tint);
}

/* A hairline of the card between neighbouring parts. */
.distribution-part {
  stroke: var(--k-base);
  stroke-width: 0.4;
  vector-effect: non-scaling-stroke;
}

.distribution-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--k-space-1) var(--k-space-5);
  list-style: none;
  font-size: var(--k-text-sm);
}

.distribution-legend a,
.distribution-legend li > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--k-text);
  text-decoration: none;
}

.distribution-legend a:hover .distribution-label {
  text-decoration: underline;
}

.distribution-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.distribution-value {
  font-weight: 600;
  color: var(--k-text-strong);
}

.distribution-share {
  color: var(--k-text-subtle);
}

.distribution-info { fill: var(--k-info); background: var(--k-info); }
.distribution-accent { fill: var(--k-accent); background: var(--k-accent); }
.distribution-warning { fill: var(--k-warning); background: var(--k-warning); }
.distribution-success { fill: var(--k-success); background: var(--k-success); }
.distribution-neutral { fill: var(--k-line); background: var(--k-line); }
.distribution-contrast { fill: var(--k-contrast); background: var(--k-contrast); }

/* ── Pager: where a long list stands, back and forward ──────────────────── */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-4);
  border-top: 1px solid var(--k-hairline);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

/* ── Details: labels and values side by side ───────────────────────────── */

.details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--k-space-2) var(--k-space-4);
  margin: 0;
}

.details dt {
  color: var(--k-text-subtle);
}

.details dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ── Mail text ──────────────────────────────────────────────────────────── */

/* A mail as Outlook hands it over in plain text: line breaks and indents as
   written, long links wrapped, a line length that stays readable. */
.mail-body {
  max-width: 72ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── Timeline ───────────────────────────────────────────────────────────── */

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: var(--k-space-3);
  padding-bottom: var(--k-space-5);
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 2px;
  width: 1px;
  background: var(--k-hairline);
}

.timeline-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--k-tint);
  color: var(--k-text-subtle);
}

.timeline-icon-accent {
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}

/* A done check-in in customer care. */
.timeline-icon-success {
  background: var(--k-success-tint);
  color: var(--k-success-text);
}

.timeline-body {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
}

.timeline-meta {
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.timeline-text {
  margin-top: var(--k-space-2);
  padding: var(--k-space-3) var(--k-space-4);
  border-radius: var(--k-radius-m);
  background: var(--k-elevated);
  border: 1px solid var(--k-hairline);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */

progress.bar {
  appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--k-radius-pill);
  background: var(--k-tint);
  overflow: hidden;
  color: var(--k-accent-ink);
}

progress.bar::-webkit-progress-bar {
  background: var(--k-tint);
}

progress.bar::-webkit-progress-value {
  background: currentColor;
  border-radius: var(--k-radius-pill);
}

progress.bar::-moz-progress-bar {
  background: currentColor;
  border-radius: var(--k-radius-pill);
}

progress.bar-info {
  color: var(--k-info);
}

progress.bar-success {
  color: var(--k-success);
}

progress.bar-warning {
  color: var(--k-warning);
}

progress.bar-danger {
  color: var(--k-danger);
}

progress.bar-accent {
  color: var(--k-accent);
}

progress.bar-neutral {
  color: var(--k-text-subtle);
}

progress.bar-contrast {
  color: var(--k-contrast);
}

/* ── Small things ───────────────────────────────────────────────────────── */

.kbd {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--k-hairline);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--k-elevated);
  color: var(--k-text-subtle);
  font-family: var(--k-font-mono);
  font-size: 11px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--k-text-inactive);
}

.status-dot-success {
  background: var(--k-success);
}

.status-dot-warning {
  background: var(--k-warning);
}

.status-dot-danger {
  background: var(--k-danger);
}

/* ── Steps: where a visitor is in a short flow ──────────────────────────── */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--k-space-2) var(--k-space-5);
  list-style: none;
  font-size: var(--k-text-sm);
}

.step {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-2);
  color: var(--k-text-subtle);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--k-line);
  font-size: var(--k-text-xs);
  font-weight: 600;
}

.step[aria-current='step'] {
  color: var(--k-text-strong);
  font-weight: 500;
}

.step[aria-current='step'] .step-number {
  background: var(--k-brand);
  border-color: var(--k-brand);
  color: var(--k-on-brand);
}

.step-done .step-number {
  background: var(--k-accent);
  border-color: var(--k-accent);
  color: var(--k-on-accent);
}

/* ── Choices: options a visitor picks from ──────────────────────────────── */

.choices {
  display: grid;
  gap: var(--k-space-2);
  list-style: none;
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--k-space-3);
  padding: var(--k-space-4);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  background: var(--k-base);
  color: var(--k-text);
  text-decoration: none;
  transition: border-color 120ms, box-shadow 120ms, background-color 120ms;
}

.choice:hover {
  border-color: var(--k-text-subtle);
  text-decoration: none;
}

.choice[aria-current] {
  border-color: var(--k-brand);
  box-shadow: inset 0 0 0 1px var(--k-brand);
  background: var(--k-selected);
}

.choice-main {
  flex: 1;
  min-width: 0;
}

.choice-title {
  display: block;
  font-weight: 600;
  color: var(--k-text-strong);
}

.choice-meta {
  display: block;
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

/* Day buttons: weekday over date. */
.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: var(--k-space-2);
  list-style: none;
}

.day-grid .choice {
  flex-direction: column;
  gap: 0;
  padding: var(--k-space-2) var(--k-space-1);
  text-align: center;
}

.day-weekday {
  font-size: var(--k-text-xs);
  color: var(--k-text-subtle);
  font-weight: 500;
}

.day-date {
  font-weight: 600;
  color: var(--k-text-strong);
  font-variant-numeric: tabular-nums;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--k-space-2);
  list-style: none;
}

.slot-grid .choice {
  justify-content: center;
  padding: var(--k-space-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.slot-grid .choice:hover {
  border-color: var(--k-brand);
  background: var(--k-selected);
}

/* ── Public pages: booking now, sign-in later ───────────────────────────── */

.public {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.public-header,
.public-footer {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-3);
  padding: var(--k-space-5) var(--k-space-4);
}

.public-footer {
  margin-top: auto;
  justify-content: flex-start;
  gap: var(--k-space-2) var(--k-space-5);
  color: var(--k-text-subtle);
  font-size: var(--k-text-sm);
}

.public-footer a {
  color: var(--k-text-subtle);
}

.public-main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--k-space-4);
}

/* A panel with a summary on the left and the task on the right. */
.panel {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--k-base);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-l);
  box-shadow: var(--k-shadow-card);
  overflow: hidden;
}

.panel-aside {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-4);
  padding: var(--k-space-6);
  background: var(--k-elevated);
  border-right: 1px solid var(--k-hairline);
}

.panel-aside > .btn {
  align-self: flex-start;
  margin-left: calc(-1 * var(--k-space-2));
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-5);
  padding: var(--k-space-6) var(--k-space-8) var(--k-space-8);
  min-width: 0;
}

.panel-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 620px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-aside {
    border-right: 0;
    border-bottom: 1px solid var(--k-hairline);
    padding: var(--k-space-5);
  }

  .panel-body {
    padding: var(--k-space-5);
  }
}

.facts {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-2);
  list-style: none;
  color: var(--k-text-subtle);
}

.facts li {
  display: flex;
  align-items: flex-start;
  gap: var(--k-space-2);
}

.facts .icon {
  margin-top: 2px;
}

.facts strong {
  color: var(--k-text-strong);
  font-weight: 500;
}

.heading-lg {
  font-size: var(--k-text-xl);
  letter-spacing: var(--k-tracking-heading);
}

.heading-md {
  font-size: var(--k-text-md);
}

/* A big tick or cross at the top of a result page. */
.result-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--k-success-tint);
  color: var(--k-success-text);
}

/* ── Styleguide page ────────────────────────────────────────────────────── */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--k-space-3);
  list-style: none;
}

.swatch {
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  overflow: hidden;
  background: var(--k-base);
  font-size: var(--k-text-xs);
}

.swatch-color {
  height: 56px;
  border-bottom: 1px solid var(--k-hairline);
}

.swatch-label {
  padding: var(--k-space-2) var(--k-space-3);
}

.swatch-label code {
  display: block;
  color: var(--k-text-subtle);
  font-family: var(--k-font-mono);
}

.sw-canvas { background: var(--k-canvas); }
.sw-base { background: var(--k-base); }
.sw-elevated { background: var(--k-elevated); }
.sw-recessed { background: var(--k-recessed); }
.sw-tint { background: var(--k-tint); }
.sw-selected { background: var(--k-selected); }
.sw-contrast { background: var(--k-contrast); }
.sw-hairline { background: var(--k-hairline); }
.sw-line { background: var(--k-line); }
.sw-text { background: var(--k-text); }
.sw-text-subtle { background: var(--k-text-subtle); }
.sw-link { background: var(--k-link); }
.sw-brand { background: var(--k-brand); }
.sw-accent { background: var(--k-accent); }
.sw-accent-soft { background: var(--k-accent-soft); }
.sw-info { background: var(--k-info); }
.sw-success { background: var(--k-success); }
.sw-warning { background: var(--k-warning); }
.sw-danger { background: var(--k-danger); }

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

/* The brand palette on /styleguide. The one place outside tokens.css that
   names a --klx-* colour, because showing the palette is its job. */
.sw-klx-anthrazit { background: var(--klx-anthrazit); }
.sw-klx-tiefschwarz { background: var(--klx-tiefschwarz); }
.sw-klx-stahl { background: var(--klx-stahl); }
.sw-klx-linie { background: var(--klx-linie); }
.sw-klx-nebel { background: var(--klx-nebel); }
.sw-klx-weiss { background: var(--klx-weiss); }
.sw-klx-dunkelflaeche { background: var(--klx-dunkelflaeche); }
.sw-klx-dunkellinie { background: var(--klx-dunkellinie); }
.sw-klx-text-auf-dunkel { background: var(--klx-text-auf-dunkel); }
.sw-klx-ramp-1 { background: var(--klx-ramp-1); }
.sw-klx-ramp-2 { background: var(--klx-ramp-2); }
.sw-klx-ramp-3 { background: var(--klx-ramp-3); }
.sw-klx-ramp-4 { background: var(--klx-ramp-4); }
.sw-klx-ramp-5 { background: var(--klx-ramp-5); }

.type-xs { font-size: var(--k-text-xs); }
.type-sm { font-size: var(--k-text-sm); }
.type-base { font-size: var(--k-text-base); }
.type-md { font-size: var(--k-text-md); }
.type-lg { font-size: var(--k-text-lg); font-weight: 600; }
.type-xl { font-size: var(--k-text-xl); font-weight: 600; letter-spacing: var(--k-tracking-heading); }
.type-2xl { font-size: var(--k-text-2xl); font-weight: 600; letter-spacing: var(--k-tracking-heading); }

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: var(--k-space-2);
  list-style: none;
}

.icon-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--k-space-2);
  padding: var(--k-space-3) var(--k-space-2);
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-m);
  font-size: var(--k-text-xs);
  color: var(--k-text-subtle);
}

.icon-grid .icon {
  color: var(--k-text);
}

/* A closed popover never shows, whatever layout rule reaches it. */
.dialog:not(:popover-open),
.menu:not(:popover-open),
.drawer:not(:popover-open) {
  display: none;
}
