/* @tokens — the values file of the keer-style style: colors, sizes, shadows, fonts and motion are written here and only here.
 *
 * The style taken from the source app (packages/ui/src/styles/tokens.css, 28.11.2026).
 * Include it with <link rel="stylesheet" href="design/keer-style/tokens.css"> or @import in the CSS of the project.
 * Components and pages take only var(--ds-…). The norms KS-R01…KS-R03 let no raw colors,
 * own radii and own shadows anywhere except in files marked @tokens in the first lines.
 * The only source of values.
 *
 * Colors and sizes are written here and only here. The shadcn variables and the
 * Tailwind theme in keer-ui.css (the keer-ui package) only refer to these roles; components take
 * Tailwind classes or var(--ds-…). The style norms let no raw color
 * (hex, rgb, hsl, oklch) anywhere except this file.
 *
 * Two accepted themes:
 *   draft: “Draft, graphite, champagne” (theme 1, the default);
 *   grain: “Grain, white backing, gray panel” (theme 2).
 * The first block is all the tokens with the values of theme 1. The block [data-theme="grain"] below
 * overrides only what theme 2 differs in. A theme is turned on by the attribute
 * data-theme on <html> (or on any element, then it works inside it).
 * The style has no dark look. The block [data-theme="draft-dark"] at the end is the dark
 * variant of theme 1 of the source app for the “Draft” skin of the lenses (the kit-style package).
 *
 * Group markup: the line “@group <id> | <title>” opens a group,
 * the comment right above a declaration is its note. src/guards/token-sheet.ts
 * parses the file by this markup; a test checks that every token is in a group.
 */

[data-theme],
:root {
  color-scheme: light;

  /* @group colour/ink | Ink */
  /* A triple of channels: borders, hover fills and shadows are built from it with different transparency. */
  --ds-ink-rgb: 24 24 24;
  /* The strength of the hairline: all borders are counted from it. */
  --ds-hair-alpha: 0.1;

  /* @group colour/surface | Surfaces */
  --ds-bg: #fbfbfb;
  /* Cards, menus and dialogs lie on the same white paper: they are set apart by a shadow ring, not by another background. */
  --ds-bg-raised: #ffffff;
  /* The side panel and quiet backings: a warm, almost white. */
  --ds-bg-secondary: #f7f7f7;
  --ds-bg-tertiary: #efefef;
  /* The dark surface: the primary button and tooltips. Equal to the text color. */
  --ds-bg-inverse: #1f1f21;
  /* The table header. */
  --ds-bg-database-header: #ffffff;
  /* A table row under the pointer is opaque, so that it does not darken in sticky columns. */
  --ds-bg-record-hover: #f8f8f8;
  /* The input strip inside an open field. Semi-transparent: it tints the paper it lies on. */
  --ds-bg-field: transparent;
  /* The side panel: gray, noticeably darker than the backing. */
  --ds-bg-sidebar: #f0f0f0;
  /* The sheen of the side panel: a bit lighter at the top, darker toward the bottom, as in the mockup. */
  --ds-sidebar-sheen: linear-gradient(180deg, #f2f2f2, #eeeeee);
  /* The page header. */
  --ds-bg-topbar: #fbfbfb;
  /* The active item of the side menu: a flat white tile with a hairline edge, no shadow. */
  --ds-nav-active-bg: #ffffff;
  --ds-nav-active-ring: rgb(var(--ds-ink-rgb) / var(--ds-hair-alpha));
  /* The search field and the fields on a gray panel. */
  --ds-bg-field-lane: rgb(255 255 255 / 0.6);

  /* @group colour/wash | Hover and press */
  /* Hover is a warm semi-transparent fill, not a gray: over any background it reads as paper. */
  --ds-wash-hover: rgb(var(--ds-ink-rgb) / 0.04);
  --ds-wash-pressed: rgb(var(--ds-ink-rgb) / 0.08);
  /* The chosen item under the pointer: one and a half steps of the usual hover (0.05 × 1.5). */
  --ds-wash-selected-hover: rgb(var(--ds-ink-rgb) / 0.06);
  /* The side panel on its own gray background needs a stronger step. */
  --ds-wash-hover-lane: rgb(var(--ds-ink-rgb) / 0.05);

  /* @group colour/text | Text */
  --ds-text-primary: #1a1a1a;
  --ds-text-secondary: #606060;
  --ds-text-tertiary: #717171;
  --ds-text-disabled: #cacaca;
  /* The side panel text: its own ladder, on a gray background the main text is too heavy. */
  --ds-text-lane: #1a1a1a;
  --ds-text-lane-secondary: #606060;
  /* Text on a dark surface: not pure white but the same warm tone as the secondary background. */
  --ds-text-inverse: #ffffff;
  --ds-fg-on-accent: #ffffff;

  /* @group colour/mark | Icons */
  /* Icons have their own ladder, separate from text: these are the icon colors of a note-taking app. */
  --ds-mark-primary: #1a1a1a;
  --ds-mark-secondary: #606060;
  --ds-mark-tertiary: #9e9e9e;
  --ds-mark-disabled: #cacaca;

  /* @group colour/border | Borders */
  --ds-border-primary: rgb(var(--ds-ink-rgb) / var(--ds-hair-alpha));
  /* A divider inside a surface: one step quieter than the main border. */
  --ds-border-secondary: rgb(
    var(--ds-ink-rgb) /
    calc(var(--ds-hair-alpha) * 0.75)
  );
  /* The border of an input and of the “outline” button: one step more visible than the main one. */
  --ds-border-strong: rgb(
    var(--ds-ink-rgb) /
    calc(var(--ds-hair-alpha) * 1.73)
  );
  /* The focus ring: neutral, like ring in the shadcn theme. */
  --ds-ring: #9e9e9e;

  /* @group colour/accent | Accent */
  /* The accent is the same graphite as the primary button: the accepted themes have no colored accent. */
  --ds-accent: #1f1f21;
  --ds-accent-hover: #2e2e2e;
  --ds-accent-pressed: #101011;
  --ds-accent-soft: #efefef;

  /* @group colour/status | States */
  --ds-danger: #b5443d;
  /* Error text on a light red backing: the red --ds-danger is not readable on it. */
  --ds-danger-fg: #8a2a26;
  --ds-danger-bg: #f8eae8;
  --ds-warning: #8a5c0e;
  --ds-warning-bg: #f6eedb;
  --ds-success: #2f8f68;
  /* Waiting for a person's answer: yellow, so that the request to act looks neither like an alarm nor like a link. */
  --ds-needs-you: #bda27c;
  --ds-info: #606060;
  --ds-info-bg: #efefef;
  /* Text on a state color fill (success, warning, info). */
  --ds-fg-on-status: #ffffff;

  /* @group colour/tone | State badges */
  /* “Text on backing” pairs for short badges (the status of a lead, of a task). */
  --ds-tone-blue-fg: #3f5878;
  --ds-tone-blue-bg: #ecf0f5;
  --ds-tone-green-fg: #1d5c41;
  --ds-tone-green-bg: #e8f3ed;
  --ds-tone-amber-fg: #6a583d;
  --ds-tone-amber-bg: #f6f0e4;
  --ds-tone-red-fg: #8a2a26;
  --ds-tone-red-bg: #f8eae8;
  /* A calm badge with no tone: “running”, “queued”. */
  --ds-tone-neutral-fg: #606060;
  --ds-tone-neutral-bg: #efefef;

  /* @group colour/metal | Champagne and white gold */
  /* The crosshair of the frame and thin accents. */
  --ds-champagne: #b9b4a2;
  /* The hairline light rim of the primary button. */
  --ds-button-rim: rgb(255 255 255 / 0.1);
  /* The shine along the top edge of the primary button. */
  --ds-button-highlight: rgb(255 255 255 / 0.16);
  /* A light edge along the inner rim of the card: the paper is slightly raised. */
  --ds-card-highlight: rgb(255 255 255 / 0.9);
  /* The dark button: a light tone transition from top to bottom, lighter at the top edge, deeper toward the bottom. */
  --ds-button-gradient: linear-gradient(
    180deg,
    #3e3e40,
    var(--ds-bg-inverse) 58%,
    #1b1b1d
  );
  /* The same button under the pointer: the whole transition is one step lighter. */
  --ds-button-gradient-hover: linear-gradient(
    180deg,
    #505052,
    #2c2c2e 58%,
    var(--ds-bg-inverse)
  );
  /* The edge of the assistant output block: a calm white gold. */
  --ds-copilot-edge-1: #f1efe8;
  --ds-copilot-edge-2: #d3cfc1;
  --ds-copilot-edge-3: #fbfaf6;
  --ds-copilot-edge-4: #c4bfae;
  --ds-copilot-edge: linear-gradient(
    135deg,
    var(--ds-copilot-edge-1),
    var(--ds-copilot-edge-2),
    var(--ds-copilot-edge-3),
    var(--ds-copilot-edge-4),
    var(--ds-copilot-edge-1)
  );
  /* The edge of the request line while a task runs: the “White gold” shine (the owner's choice of 26.11.2026). */
  --ds-rim-1: #e6dec6;
  --ds-rim-2: #a99b70;
  --ds-rim-3: #f6f1e0;
  --ds-rim-4: #8f8259;
  /* The rim width: 1.5 px × 0.6 (“Narrow”). */
  --ds-rim-width: 0.9px;
  /* One pass of the shine from corner to corner and back (“Faster”: the source time). */
  --ds-rim-duration: 14s;
  /* The rim goes beyond the card border by its thickness. */
  --ds-rim-inset: -1px;
  /* The shine field is three times the card: the shine travels along it. */
  --ds-rim-field-size: 300% 300%;
  --ds-rim-field-start: 0% 0%;
  --ds-rim-field-end: 100% 100%;
  /* The rim mask: only a strip of the width `--ds-rim-width` is visible. The mask color is opacity, not a theme color; common to all themes. */
  --ds-rim-mask-webkit:
    linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  --ds-rim-mask:
    linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  --ds-rim-opacity-off: 0;
  --ds-rim-opacity-on: 1;
  --ds-rim-fade: opacity 0.6s ease;
  /* The edge of the assistant output: a transparent border under which the shimmer is visible. */
  --ds-copilot-edge-border: 1px solid transparent;

  /* @group colour/option | Option colors */
  /* Option colors in the “choice” fields of a table. The backings are semi-transparent: they lie on a white row and on a highlighted one. */
  --ds-option-gray-bg: rgba(28, 19, 1, 0.11);
  --ds-option-gray-fg: #494846;
  --ds-option-gray-dot: #8e8b87;
  --ds-option-brown-bg: rgba(127, 51, 0, 0.157);
  --ds-option-brown-fg: #584437;
  --ds-option-brown-dot: #9f6b53;
  --ds-option-orange-bg: rgba(196, 88, 0, 0.204);
  --ds-option-orange-fg: #6a4222;
  --ds-option-orange-dot: #d9730d;
  --ds-option-yellow-bg: rgba(209, 156, 0, 0.282);
  --ds-option-yellow-fg: #655121;
  --ds-option-yellow-dot: #cb912f;
  --ds-option-green-bg: rgba(0, 96, 38, 0.157);
  --ds-option-green-fg: #2a533c;
  --ds-option-green-dot: #448361;
  --ds-option-blue-bg: rgba(0, 118, 217, 0.204);
  --ds-option-blue-fg: #264a72;
  --ds-option-blue-dot: #337ea9;
  --ds-option-purple-bg: rgba(92, 0, 163, 0.14);
  --ds-option-purple-fg: #553b69;
  --ds-option-purple-dot: #9065b0;
  --ds-option-pink-bg: rgba(183, 0, 78, 0.153);
  --ds-option-pink-fg: #68354e;
  --ds-option-pink-dot: #c14c8a;
  --ds-option-red-bg: rgba(206, 24, 0, 0.165);
  --ds-option-red-fg: #6d3531;
  --ds-option-red-dot: #d44c47;

  /* @group colour/chat | Chat */
  /* A person's message is ivory, opaque and independent of hover. */
  --ds-chat-bubble-bg: #f7f7f7;

  /* @group colour/overlay | Backings over the page */
  /* The dimming under a dialog. */
  --ds-backdrop: rgb(var(--ds-ink-rgb) / 0.36);
  /* A light dimming under a side panel or a search. */
  --ds-backdrop-light: rgb(var(--ds-ink-rgb) / 0.16);
  /* Semi-transparent paper over the content while it loads. */
  --ds-veil: rgb(255 255 255 / 0.78);
  /* The scroll thumb: shown only under the pointer. */
  --ds-scrollbar-thumb: rgb(var(--ds-ink-rgb) / 0.24);

  /* @group colour/shadow-ink | Shadow ink */
  /* The ring is a hairline; the shadow drops are barely visible: the accepted themes have no volume. */
  --ds-elevation-ring: rgb(var(--ds-ink-rgb) / var(--ds-hair-alpha));
  --ds-shadow-control-ink-1: rgb(28 30 33 / 0.035);
  --ds-shadow-soft-ink-1: rgb(28 30 33 / 0.025);
  --ds-shadow-soft-ink-2: rgb(28 30 33 / 0.05);
  --ds-shadow-popover-ink-1: rgb(28 30 33 / 0.05);
  --ds-shadow-popover-ink-2: rgb(28 30 33 / 0.16);
  --ds-shadow-overlay-ink-1: rgb(28 30 33 / 0.05);
  --ds-shadow-overlay-ink-2: rgb(28 30 33 / 0.26);
  --ds-shadow-overlay-ink-3: rgb(28 30 33 / 0.08);
  --ds-shadow-primary-ink-1: rgb(var(--ds-ink-rgb) / 0.24);
  --ds-shadow-primary-ink-2: rgb(var(--ds-ink-rgb) / 0.32);
  /* The dark edge around the primary button. */
  --ds-shadow-primary-edge: #161617;

  /* @group colour/role | Roles (references to the values above) */
  --ds-fg: var(--ds-text-primary);
  --ds-fg-muted: var(--ds-text-secondary);
  --ds-icon: var(--ds-mark-tertiary);
  --ds-bg-hover: var(--ds-wash-hover);
  --ds-menu-colour: var(--ds-bg-raised);
  --ds-chat-bubble-fg: var(--ds-fg);
  /* A tile button on a row: a 5% step toward the ink from the hover background. */
  --ds-bg-control-hover: color-mix(
    in srgb,
    var(--ds-bg-hover) 95%,
    var(--ds-fg) 5%
  );
  --ds-link-underline: var(--ds-border-strong);
  /* Chart series are taken from the option dots: a chart and a badge in a table speak in one color. */
  --ds-chart-series-1: var(--ds-accent);
  --ds-chart-series-2: var(--ds-option-orange-dot);
  --ds-chart-series-3: var(--ds-option-purple-dot);
  --ds-chart-series-4: var(--ds-option-green-dot);
  --ds-chart-series-5: var(--ds-option-pink-dot);

  /* @group type/family | Fonts */
  /* Geist is the interface font of the accepted themes; next is the system set for when the font is not loaded. */
  --ds-font-sans:
    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --ds-font-mono:
    "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  /* The assistant voice: the conclusion and the outcome are set in a serif. */
  --ds-font-serif:
    "Source Serif 4", "Iowan Old Style", "Charter", Georgia, serif;

  /* @group type/weight | Weight */
  --ds-font-weight-regular: 400;
  /* Book: items of the side menu. */
  --ds-font-weight-book: 450;
  --ds-font-weight-medium: 500;
  /* Dense: the active menu item, the name in the panel footer. */
  --ds-font-weight-strong: 550;
  --ds-font-weight-semibold: 600;
  --ds-font-weight-bold: 700;

  /* @group type/scale | Font size and line height */
  /* “Font size / line” pairs in pixels: the line is measured on the grid, not with a multiplier. */
  --ds-font-ui-small-size: 12px;
  --ds-line-ui-small: 16px;
  /* The main interface text. */
  --ds-font-ui-size: 14px;
  --ds-line-ui: 20px;
  /* The field caption: the line equals the font size. */
  --ds-line-ui-label: 14px;
  /* Codes and numbers: a tax id, an article number, a purchase number. */
  --ds-font-code-size: 13px;
  --ds-line-code: 20px;
  /* Chat and the input field: their own reading size, not the page one. */
  --ds-font-editor-size: 14px;
  --ds-line-editor: 21px;
  /* Page reading: 16px with a line of 1.5, measured from a note-taking app page. */
  --ds-font-page-reading-size: 16px;
  --ds-line-page-reading: 24px;
  --ds-font-heading-6-size: 14px;
  --ds-line-heading-6: 22px;
  --ds-font-heading-5-size: 16px;
  --ds-line-heading-5: 24px;
  --ds-font-heading-4-size: 18px;
  --ds-line-heading-4: 28px;
  --ds-font-heading-3-size: 20px;
  --ds-line-heading-3: 28px;
  --ds-font-heading-2-size: 24px;
  --ds-line-heading-2: 32px;
  --ds-font-heading-1-size: 31px;
  --ds-line-heading-1: 36px;
  --ds-font-page-title-size: 40px;
  --ds-line-page-title: 48px;
  /* The document font size is not the reading size: unstyled text inherits it, and 1rem is counted from it. */
  --ds-font-root-size: 16px;
  --ds-line-root: 24px;
  /* A field under a finger is no smaller than 16px: otherwise iOS zooms the page on focus. This is a platform number, not a choice. */
  --ds-font-field-touch-size: 16px;
  /* The font size that the field would inherit from its parent. */
  --ds-font-size-inherited: 1em;
  /* A state badge and the function choice under the request line: between the caption and the main text. */
  --ds-font-chip-size: 12.5px;
  --ds-line-chip: 18px;
  /* A list row: the title and the description in cards, a task example, a choice option. */
  --ds-font-row-size: 13.5px;
  --ds-line-row: 20px;
  /* A side menu item. */
  --ds-font-nav-size: 14.5px;
  --ds-line-nav: 21px;
  /* The product name in the header of the side panel. */
  --ds-font-brand-size: 15.5px;
  --ds-line-brand: 18px;
  /* The name in the footer of the side panel is smaller than a menu item. */
  --ds-font-account-size: 13px;
  --ds-line-account: 16px;
  /* The request line field: larger than the main text, it is the main input of the screen. */
  --ds-font-composer-size: 17px;
  --ds-line-composer: 24px;
  /* The assistant voice: a conclusion and an outcome in a serif, denser than the heading. */
  --ds-font-voice-size: 19.5px;
  --ds-line-voice: 28px;

  /* @group type/line | Special lines */
  /* A line exactly the height of the text: for an icon or a single glyph that needs no line height. */
  --ds-line-none: 1;
  --ds-line-ui-compact: 18px;
  --ds-line-ui-relaxed: 1.4;

  /* @group type/tracking | Letter spacing */
  --ds-letter-spacing-title: -0.01em;
  /* The product name: denser than the heading. */
  --ds-letter-spacing-brand: -0.02em;
  /* The page heading: the large font size is set tighter. */
  --ds-letter-spacing-page-title: -0.035em;
  /* The main interface text: barely noticeably tighter. */
  --ds-letter-spacing-ui: -0.008em;
  /* Uppercase captions: spaced out a little. */
  --ds-letter-spacing-label: 0.06em;

  /* @group type/overline | Uppercase captions */
  /* A caption above a value, a menu group heading and a table header: in theme 1 they are monospaced uppercase. */
  --ds-overline-font: var(--ds-font-mono);
  --ds-overline-size: 11px;
  --ds-overline-tracking: 0.05em;
  --ds-overline-transform: uppercase;
  /* Counters in menus and tabs. */
  --ds-count-font: var(--ds-font-mono);

  /* @group space | Spacing */
  /* The step is 4px; quarter steps are for measured dense geometry. Tailwind counts its --spacing from --ds-space-1, so p-2.5 is --ds-space-2-5. */
  --ds-space-0-25: 1px;
  --ds-space-0-5: 2px;
  --ds-space-0-75: 3px;
  --ds-space-1: 4px;
  --ds-space-1-25: 5px;
  --ds-space-1-5: 6px;
  --ds-space-1-75: 7px;
  --ds-space-2: 8px;
  --ds-space-2-5: 10px;
  --ds-space-3: 12px;
  --ds-space-3-5: 14px;
  --ds-space-4: 16px;
  --ds-space-4-5: 18px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-7: 28px;
  --ds-space-7-5: 30px;
  --ds-space-8: 32px;
  --ds-space-9: 36px;
  --ds-space-10: 40px;
  --ds-space-12: 48px;
  --ds-space-14: 56px;
  --ds-space-20: 80px;
  --ds-space-24: 96px;

  /* @group radius | Radii */
  --ds-radius-xs: 4px;
  /* Buttons and fields. */
  --ds-radius-sm: 5px;
  /* Menus, cards, the usual shadcn --radius. */
  --ds-radius-md: 6px;
  /* Large surfaces: a panel, a dialog. There is nothing larger than 12px in the design code. */
  --ds-radius-lg: 8px;
  /* Cards. */
  --ds-radius-xl: 8px;
  --ds-radius-round: 9999px;

  /* @group shadow | Shadows */
  /* A shadow only for what floats: menus, dialogs, floating buttons. The drops are lighter in strength than in a note-taking app, because the edges are drawn by a ring and our geometry is denser. */
  --ds-shadow-control: 0 1px 2px 0 var(--ds-shadow-control-ink-1);
  /* The card: the edge is drawn by a hairline border, the drop is barely visible. */
  --ds-shadow-soft:
    0 1px 1px 0 var(--ds-shadow-soft-ink-1),
    0 4px 10px -4px var(--ds-shadow-soft-ink-2);
  /* One 1px ring ends the shadow of a popup surface: we do not draw a border over it, otherwise the edge doubles. */
  --ds-shadow-popover:
    0 2px 6px 0 var(--ds-shadow-popover-ink-1),
    0 12px 28px -12px var(--ds-shadow-popover-ink-2);
  /* A panel or a dialog over the page, a floating action bar. */
  --ds-shadow-overlay:
    0 0 0 1px var(--ds-shadow-overlay-ink-3),
    0 2px 6px 0 var(--ds-shadow-overlay-ink-1),
    0 28px 56px -18px var(--ds-shadow-overlay-ink-2);
  /* The primary button: one thin light edge on top, a hairline rim inside and a soft shadow below. There is no dark edge outside: no double rim is visible. */
  --ds-shadow-primary:
    inset 0 1px 0 0 var(--ds-button-highlight),
    inset 0 0 0 1px var(--ds-button-rim),
    0 1px 2px 0 var(--ds-shadow-primary-ink-1),
    0 4px 10px -6px var(--ds-shadow-primary-ink-2);
  /* A hairline edge inside: a segmented panel, a quiet backing. */
  --ds-shadow-hair: inset 0 0 0 1px var(--ds-border-primary);
  /* An edge one step more visible: the choice button under the request line. */
  --ds-shadow-hair-strong: inset 0 0 0 1px var(--ds-border-strong);
  /* The chosen choice button: the edge is darker, so that the choice reads without color. */
  --ds-shadow-hair-pressed: inset 0 0 0 1px rgb(var(--ds-ink-rgb) / 0.28);
  /* The primary button at the moment of pressing: pushed in, the shadow goes inside. */
  --ds-shadow-primary-pressed: inset 0 1px 2px 0 var(--ds-shadow-primary-ink-2);
  /* A card on the page backing: a light edge inside, a hairline rim and a soft shadow below instead of a border. */
  --ds-shadow-card:
    inset 0 0 0 1px var(--ds-card-highlight),
    0 0 0 1px var(--ds-border-primary),
    0 2px 3px 0 rgb(var(--ds-ink-rgb) / 0.03),
    0 14px 28px -18px rgb(var(--ds-ink-rgb) / 0.14);
  /* The active tab and a tile on a gray strip. */
  --ds-shadow-tile:
    0 0 0 1px var(--ds-elevation-ring),
    0 1px 2px 0 var(--ds-shadow-control-ink-1);

  /* @group border | Border thickness */
  --ds-border-width: 1px;
  /* The insertion line while dragging. */
  --ds-drop-line-thickness: 3px;

  /* @group focus | Focus ring */
  /* One thickness and one color for everything the keyboard reaches. Outside if there is room around; inward (inset) if the element is pressed to an edge where an outer ring would fall off. */
  --ds-focus-ring-width: var(--ds-space-0-5);
  --ds-focus-ring-colour: var(--ds-ring);
  --ds-focus-ring: var(--ds-focus-ring-width) solid var(--ds-focus-ring-colour);
  --ds-focus-ring-offset: var(--ds-space-0-5);
  --ds-focus-ring-inset: inset 0 0 0 var(--ds-focus-ring-width)
    var(--ds-focus-ring-colour);

  /* @group control | Control sizes */
  /* A button and a field are 32px. */
  --ds-control-height: var(--ds-space-9);
  /* An icon button and the table toolbar buttons are 28px. */
  --ds-control-height-sm: var(--ds-space-8);
  /* A menu item. */
  --ds-menu-item-height: var(--ds-space-7-5);
  --ds-menu-padding: var(--ds-space-1-5);
  --ds-menu-item-radius: var(--ds-space-1-75);
  /* An option badge (a status) in a row. */
  --ds-chip-height: var(--ds-space-5);
  /* A finger cannot hit anything smaller than 44px. */
  --ds-touch-target: 44px;
  --ds-tooltip-max-width: 220px;
  /* The line measure of the main text: ~80 characters, the reading norm is up to 90. */
  --ds-reading-measure: 75ch;
  /* A disabled element. */
  --ds-disabled-opacity: 0.42;

  /* @group table | Table density */
  --ds-database-header-height: var(--ds-space-9);
  --ds-database-row-height: 52px;
  --ds-database-cell-padding-inline: var(--ds-space-2);
  --ds-database-cell-padding-block: var(--ds-space-1-5);
  --ds-database-toolbar-height: var(--ds-space-10);
  --ds-database-header-ink: var(--ds-text-tertiary);
  --ds-database-header-weight: var(--ds-font-weight-medium);
  --ds-database-header-font: var(--ds-overline-font);
  --ds-database-header-size: var(--ds-overline-size);
  --ds-database-header-tracking: var(--ds-overline-tracking);
  --ds-database-header-transform: var(--ds-overline-transform);
  --ds-database-grid-line: var(--ds-border-primary);
  --ds-database-grid-line-width: var(--ds-border-width);
  /* The row-select checkbox. */
  --ds-database-checkbox-size: var(--ds-space-4);
  /* An opened row of a wide table: no wider than the visible area of the scroll container. */
  --ds-table-view-width: 100cqw;
  /* A “caption: value” row: a caption column up to 12rem and a field. */
  --ds-grid-label-field: minmax(0, 12rem) minmax(0, 1fr);
  /* A list row: a stretching text and an action on the right at its own width. */
  --ds-grid-main-aside: minmax(0, 1fr) auto;
  /* A “badge: text” row: a short badge (time, date) at its own width and a stretching text. */
  --ds-grid-aside-main: auto minmax(0, 1fr);
  /* A list table with two numbers: a title, a short number, a long number. */
  --ds-grid-figures: minmax(0, 1fr) 3rem 6rem;
  /* The same on a wide screen plus a column of a link or an address. */
  --ds-grid-figures-wide: minmax(0, 1fr) 3rem 7rem minmax(0, 9rem);
  /* A list table with two equal columns of values (for example, two search engines). */
  --ds-grid-pair-values: minmax(0, 1fr) 6rem 6rem;
  /* A “value: change” cell: a number on the right and a change badge of constant width. */
  --ds-grid-value-delta: minmax(0, 1fr) 2.25rem;

  /* @group frame | Page frame */
  --ds-sidebar-width: 240px;
  /* A collapsed panel is a strip of icons: the sign and the icons stand on one axis in the middle. */
  --ds-sidebar-width-icon: 60px;
  --ds-topbar-height: 58px;
  /* Page content padding. */
  --ds-page-gutter: var(--ds-space-7);
  /* The sign-in form column (scr-login): 360px, the same for all themes. */
  --ds-login-form-width: calc(var(--ds-space-24) * 3.75);
  /* Frame lines: the panel edge, the bottom of the header, the rule under the page heading. */
  --ds-frame-line: var(--ds-border-strong);
  /* The line under the product name in the side panel: it continues the line under the header. */
  --ds-frame-brand-line: var(--ds-frame-line);
  /* A crosshair where the frame lines meet. Zero in a theme without a frame. */
  --ds-frame-cross-size: 17px;
  --ds-frame-cross-colour: var(--ds-champagne);
  --ds-frame-cross:
    linear-gradient(var(--ds-frame-cross-colour), var(--ds-frame-cross-colour))
    center / 1px 100% no-repeat,
    linear-gradient(var(--ds-frame-cross-colour), var(--ds-frame-cross-colour))
    center / 100% 1px no-repeat;
  /* Blurring of the content under the semi-transparent header. */
  --ds-topbar-blur: none;

  /* @group canvas | Backing */
  /* The backing is flat, with no gradient. The pattern (dots) and the grain are only in theme 2. */
  --ds-canvas-pattern: none;
  --ds-canvas-dot: rgb(22 22 24 / 0.115);
  --ds-canvas-step: 20px;
  --ds-canvas-offset: 10px;
  /* A fine noise: it lies on the backing, the panel and the header; cards stay clean. */
  --ds-grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.6 0 0 0 -1.05'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
  --ds-grain-size: 128px;
  --ds-grain-opacity: 0;

  /* @group chat | Chat */
  /* A person's message is no wider than 80% of the feed. */
  --ds-chat-user-max-width: 80%;
  --ds-composer-radius: 8px;
  /* The input field grows to this height, then it scrolls. */
  --ds-composer-body-max-height: 184px;
  --ds-composer-control-height: var(--ds-space-7-5);
  --ds-chat-context-chip-max-width: 160px;

  /* @group motion | Motion */
  /* The delay before showing the wait: a quick answer does not flash an indicator. */
  --ds-wait-appear-delay: 300ms;
  --ds-motion-instant: 100ms;
  --ds-motion-quick: 150ms;
  --ds-motion-lane: 200ms;
  --ds-motion-enter: cubic-bezier(0, 0, 0.58, 1);
  --ds-motion-exit: cubic-bezier(0.42, 0, 1, 1);
  --ds-motion-move: cubic-bezier(0.45, 0, 0.55, 1);
  --ds-transition: var(--ds-motion-instant) var(--ds-motion-move);
  /* Collapsing the side panel and sliding out the message panel: calm, slowing toward the end, with no bounce. */
  --ds-motion-panel: 280ms;
  --ds-motion-panel-ease: cubic-bezier(0.32, 0.72, 0.24, 1);
  /* Captions in a collapsing panel fade faster than the panel narrows: the text does not get squeezed. */
  --ds-motion-fade: 140ms;
  /* Starting a task (View Transitions): the request line moves into the task screen, the screen changes by cross-fade. */
  --ds-motion-request-move: 300ms;
  --ds-motion-request-ease: cubic-bezier(0.2, 0.75, 0.2, 1);
  --ds-motion-request-out: 120ms;
  --ds-motion-request-in: 160ms;
  --ds-motion-request-in-delay: 60ms;
  --ds-motion-page-swap: 200ms;
  --ds-motion-page-ease: cubic-bezier(0.3, 0, 0.3, 1);
  /* Opacity at the start and end of the screen cross-fade. */
  --ds-motion-page-opacity-gone: 0;
  /* The snapshot of the request line during the move takes the whole height of the shared element. */
  --ds-motion-request-snapshot-height: 100%;
  /* The step of the appearance of the sign-in screen parts: each next one starts this much later. */
  --ds-login-stagger: 40ms;

  /* @group scrollbar | Scrolling */
  --ds-scrollbar-width: thin;
  --ds-scrollbar-track: transparent;
  /* At rest the thumb is not visible; it is shown under the pointer. */
  --ds-scrollbar-thumb-rest: transparent;
}

/*
 * Theme 2: “Grain, white backing, gray panel”.
 * Only the differences from theme 1; everything else is inherited from the block above.
 */
[data-theme="grain"] {
  --ds-ink-rgb: 22 22 24;
  --ds-hair-alpha: 0.075;

  --ds-bg: #ffffff;
  --ds-bg-sidebar: #f9f9fa;
  --ds-sidebar-sheen: none;
  --ds-bg-topbar: rgb(255 255 255 / 0.8);
  --ds-topbar-blur: blur(18px) saturate(1.4);
  /* The active menu item is a gray fill without an edge. */
  --ds-nav-active-bg: rgb(var(--ds-ink-rgb) / 0.07);
  --ds-nav-active-ring: transparent;
  --ds-bg-field-lane: #ffffff;

  --ds-text-primary: #18181a;
  --ds-text-secondary: #55565b;
  --ds-text-tertiary: #737479;
  --ds-text-disabled: #bfc0c4;
  --ds-text-lane: #18181a;
  --ds-text-lane-secondary: #55565b;
  --ds-mark-primary: #18181a;
  --ds-mark-secondary: #55565b;
  --ds-mark-tertiary: #8b8c91;
  --ds-mark-disabled: #bfc0c4;
  --ds-ring: #8b8c91;
  --ds-info: #55565b;
  --ds-tone-neutral-fg: #55565b;

  /* “Clarify” is amber instead of champagne. */
  --ds-needs-you: #c98d33;
  --ds-tone-amber-fg: #7c5612;
  --ds-tone-amber-bg: #f7efdf;
  /* The rim of the primary button is a neutral light. */
  --ds-button-rim: rgb(255 255 255 / 0.1);
  --ds-button-highlight: rgb(255 255 255 / 0.16);

  /* Uppercase captions and the table header are in the regular font. */
  --ds-overline-font: var(--ds-font-sans);
  --ds-overline-size: 11px;
  --ds-overline-tracking: 0.07em;
  --ds-database-header-size: 11.5px;
  --ds-database-header-tracking: 0;
  --ds-database-header-transform: none;
  --ds-count-font: var(--ds-font-sans);

  --ds-sidebar-width: 224px;
  --ds-topbar-height: 50px;
  /* There is no frame of lines: the panel and the header are separated by a hairline, there are no crosshairs. */
  --ds-frame-line: var(--ds-border-primary);
  --ds-frame-brand-line: transparent;
  --ds-frame-cross-size: 0px;
  --ds-frame-cross-colour: transparent;

  --ds-canvas-pattern: radial-gradient(
    circle,
    var(--ds-canvas-dot) 1px,
    transparent 1.3px
  );
  --ds-grain-opacity: 0.023;
}

/*
 * The dark variant of theme 1 is draft-dark, as in the source app
 * (packages/ui/src/styles/themes.css, 28.11.2026). The style pages do not turn it on themselves:
 * the “Draft” skin of the kit-style package takes it for the dark theme of the lenses. Only the differences from theme 1.
 */
[data-theme="draft-dark"] {
  color-scheme: dark;
  --ds-ink-rgb: 240 234 220;
  --ds-hair-alpha: 0.12;

  --ds-bg: #222221;
  --ds-bg-raised: #2f2e2c;
  --ds-bg-secondary: #292826;
  --ds-bg-tertiary: #3a3937;
  --ds-bg-sidebar: #1c1c1b;

  --ds-text-primary: #f4f1e9;
  --ds-text-secondary: #cdc9be;
  --ds-text-tertiary: #a09c90;
  --ds-text-disabled: #68655c;
  --ds-text-inverse: #1f1e1b;
  --ds-mark-primary: var(--ds-text-primary);
  --ds-mark-secondary: var(--ds-text-secondary);
  --ds-mark-tertiary: var(--ds-text-tertiary);
  --ds-mark-disabled: var(--ds-text-disabled);

  --ds-champagne: #a8925f;
  --ds-accent: #d0c19c;
  --ds-accent-soft: color-mix(in srgb, var(--ds-accent) 14%, transparent);
  --ds-card-highlight: rgb(255 255 255 / 0.03);

  /* Options: the dot is the same, the text and the fill are derived from it. */
  --ds-option-gray-fg: color-mix(in srgb, var(--ds-option-gray-dot) 45%, #ffffff);
  --ds-option-gray-bg: color-mix(in srgb, var(--ds-option-gray-dot) 24%, transparent);
  --ds-option-brown-fg: color-mix(in srgb, var(--ds-option-brown-dot) 45%, #ffffff);
  --ds-option-brown-bg: color-mix(in srgb, var(--ds-option-brown-dot) 24%, transparent);
  --ds-option-orange-fg: color-mix(in srgb, var(--ds-option-orange-dot) 45%, #ffffff);
  --ds-option-orange-bg: color-mix(in srgb, var(--ds-option-orange-dot) 24%, transparent);
  --ds-option-yellow-fg: color-mix(in srgb, var(--ds-option-yellow-dot) 45%, #ffffff);
  --ds-option-yellow-bg: color-mix(in srgb, var(--ds-option-yellow-dot) 24%, transparent);
  --ds-option-green-fg: color-mix(in srgb, var(--ds-option-green-dot) 45%, #ffffff);
  --ds-option-green-bg: color-mix(in srgb, var(--ds-option-green-dot) 24%, transparent);
  --ds-option-blue-fg: color-mix(in srgb, var(--ds-option-blue-dot) 45%, #ffffff);
  --ds-option-blue-bg: color-mix(in srgb, var(--ds-option-blue-dot) 24%, transparent);
  --ds-option-purple-fg: color-mix(in srgb, var(--ds-option-purple-dot) 45%, #ffffff);
  --ds-option-purple-bg: color-mix(in srgb, var(--ds-option-purple-dot) 24%, transparent);
  --ds-option-pink-fg: color-mix(in srgb, var(--ds-option-pink-dot) 45%, #ffffff);
  --ds-option-pink-bg: color-mix(in srgb, var(--ds-option-pink-dot) 24%, transparent);
  --ds-option-red-fg: color-mix(in srgb, var(--ds-option-red-dot) 45%, #ffffff);
  --ds-option-red-bg: color-mix(in srgb, var(--ds-option-red-dot) 24%, transparent);

  /* Shadows on dark are black and denser. */
  --ds-shadow-control-ink-1: rgb(0 0 0 / 0.25);
  --ds-shadow-soft-ink-1: rgb(0 0 0 / 0.2);
  --ds-shadow-soft-ink-2: rgb(0 0 0 / 0.3);
  --ds-shadow-popover-ink-1: rgb(0 0 0 / 0.3);
  --ds-shadow-popover-ink-2: rgb(0 0 0 / 0.55);
  --ds-shadow-overlay-ink-1: rgb(0 0 0 / 0.3);
  --ds-shadow-overlay-ink-2: rgb(0 0 0 / 0.65);
  --ds-shadow-overlay-ink-3: rgb(0 0 0 / 0.3);
  --ds-backdrop: rgb(0 0 0 / 0.55);
  --ds-backdrop-light: rgb(0 0 0 / 0.3);

  /* The backing dots are the light ink of the theme. */
  --ds-canvas-dot: rgb(var(--ds-ink-rgb) / 0.14);
}

/* On a touch screen a menu item is sized for a finger. */
@media (hover: none) and (pointer: coarse) {
  [data-theme],
  :root {
    --ds-menu-item-height: var(--ds-touch-target);
  }
}

/*
 * The layout breakpoints. A media query does not read var(), so the value
 * stands right here, in the Tailwind theme, not as a role in :root.
 * split: from 820 px the list of sections and the card stand side by side, narrower they stack
 * (settings, a function page): `split:grid-cols-…`.
 * phone is the phone width: the value is repeated in hooks/use-mobile.ts.
 */
@theme {
  --breakpoint-split: 820px;
  /* phone: below 560 px the panel turns into a sliding sheet, above it stays a strip of icons. */
  --breakpoint-phone: 560px;
}
