/* Shared geometry and motion. Colours remain in the light/dark theme files.
   See docs/ui-system/README.md for the migration contract. */
:root {
  --ui-icon-font-family: 'Font Awesome 7 Pro';
  --ui-icon-font-family-brands: 'Font Awesome 7 Brands';
  --ui-icon-font-family-duotone: 'Font Awesome 7 Duotone';
  --ui-icon-weight: 300;
  /* Thin, for a glyph drawn large, where Light reads heavy. */
  --ui-icon-weight-thin: 100;
  --ui-icon-size: 16px;
  --ui-icon-size-large: 20px;
  --ui-font-family: 'DPG Sans', 'DPG Sans Fallback', sans-serif;
  /* The display type (--ui-font-size-display): Plus Jakarta Sans, falling
     back to the interface font. */
  --ui-font-family-display: 'DPG Display', 'DPG Sans', 'DPG Sans Fallback', sans-serif;
  /* The interface font has no condensed width; nothing uses this yet. */
  --ui-font-family-condensed: var(--ui-font-family);
  --ui-font-family-code: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
  --ui-line-height-code: 1.6;
  --ui-weight-light: 300;
  --ui-weight-regular: 400;
  --ui-weight-medium: 500;
  --ui-weight-strong: 600;
  --ui-weight-bold: 700;
  /* The display type's two ends: a heavy title over a thin line (DPG
     Display runs 200 to 800). */
  --ui-weight-thin: 200;
  --ui-weight-heavy: 800;
  /* The type scale: six sizes. Every text size in admin is a role below that
     points at one of them. Changing a size here changes it on every screen,
     and a role can move to another size on its own. Icon glyph sizes are
     separate. */
  --ui-type-xs: 12px;
  --ui-type-s: 13px;
  --ui-type-m: 14px;
  --ui-type-l: 16px;
  --ui-type-xl: 20px;
  --ui-type-xxl: 26px;
  --ui-type-xxxl: 32px;
  --ui-type-display: 48px;
  --ui-font-size-body: var(--ui-type-s);
  --ui-font-size-code: var(--ui-type-s);
  --ui-line-height-body: 1.5;
  --ui-font-optical-sizing: auto;
  --ui-space-unit: 4px;
  --ui-space-1: calc(var(--ui-space-unit) * 1);
  --ui-space-2: calc(var(--ui-space-unit) * 2);
  --ui-space-3: calc(var(--ui-space-unit) * 3);
  --ui-space-4: calc(var(--ui-space-unit) * 4);
  --ui-space-6: calc(var(--ui-space-unit) * 6);
  --ui-space-8: calc(var(--ui-space-unit) * 8);
  --ui-space-12: calc(var(--ui-space-unit) * 12);
  --ui-control-height: 36px;
  --ui-control-height-compact: 30px;
  --ui-control-height-inline: 28px;
  --ui-control-height-large: 54px;
  --ui-touch-target: 44px;
  /* DPG's square language: near-square controls, panels and surfaces. */
  --ui-radius-control: 2px;
  --ui-radius-pill: 999px;
  --ui-radius-panel: 2px;
  --ui-radius-surface: 2px;

  /* Stacking layers, bottom to top, named by what sits on each. The values
     are the ones the literals had, so nothing moves. Dialogs and popovers
     use the browser's top layer and need none. */
  --ui-layer-raised: 2;          /* an item over its siblings: a dragged tile, crop handles, toolbar controls over the toolbar row */
  --ui-layer-overhang: 3;        /* a piece that overhangs its row: the toolbar's custom menu, the full breadcrumb trail, the drawer's pinned header */
  --ui-layer-user-bar: 4;        /* the user bar across the top of the page */
  --ui-layer-sticky-header: 5;   /* a screen header that stays at the top as the page scrolls under it (page_header sticky:) */
  --ui-layer-drawer-backdrop: 6; /* the dimmed page behind the phone panel drawer */
  --ui-layer-drawer: 7;          /* the panel drawer on a phone */
  --ui-layer-navigation: 8;      /* the navigation bar and its menus */
  --ui-layer-header: 9;          /* the header, over the navigation */
  --ui-layer-marker: 10;         /* a mark over its own component: the reorder position badge, a map popup's close button */
  --ui-layer-menu: 20;           /* a text editor's menus and block menu, over its content and marks */
  --ui-layer-overlay: 100;       /* over the workspace: the alert, the panel divider while it is dragged */
  --ui-layer-toast: 2000;        /* the loading images toast */
  --ui-layer-fullscreen: 10000;  /* a text editor in full screen, over the page and the toast */
  --ui-layer-notification: 12666; /* the notification bar, over everything else on the page */

  /* The frame around every screen stays compact so photographs get the room:
     navigation, the toolbar's boxed icons and panel headers. */
  --ui-nav-height: 34px;
  /* The space before and after each navigation word. The logo starts at
     this inset too, so it lines up with the first word. */
  --ui-nav-item-inline: 14px;
  /* One toolbar geometry on every device: on a phone the tools share a single
     row instead of wrapping. */
  --ui-toolbar-control: 24px;
  --ui-toolbar-icon-size: 13px;
  /* Boxed toolbar tools use DPG's solid glyphs; the unboxed symbols beside
     them (favourite, background actions, rating) are regular outlines. Every
     other icon uses the light --ui-icon-weight. */
  --ui-toolbar-icon-weight: 900;
  --ui-toolbar-symbol-weight: 300;
  /* Type roles, largest first (sizes from the scale above). */
  /* Display: a screen given over to one message (an empty set, a website
     being built), heavy over thin, as a poster sets it. */
  --ui-font-size-display: var(--ui-type-display);
  /* A prominent page title (page_header prominent: true, the website screens). */
  --ui-font-size-page-title: var(--ui-type-xxxl);
  --ui-font-size-title: var(--ui-type-xxl);
  /* Screen and dialog titles below the page title. */
  --ui-font-size-subtitle: var(--ui-type-xl);
  /* Section headings (surfaces, empty states). */
  --ui-font-size-heading: var(--ui-type-xl);
  /* Headings inside a section: surface and panel headings, prominent values. */
  --ui-font-size-lead: var(--ui-type-l);
  /* Card, tab and pagination labels. */
  --ui-font-size-subheading: var(--ui-type-m);
  --ui-font-size-control: var(--ui-type-m);
  /* Text entry: 16px on touch so iOS does not zoom into a focused field. */
  --ui-font-size-field: var(--ui-font-size-control);
  --ui-font-size-label: var(--ui-type-s);
  --ui-font-size-small: var(--ui-type-xs);
  /* Counts, badges and metadata beside other text. */
  --ui-font-size-caption: var(--ui-type-xs);
  --ui-line-height-control: 1.5;
  --ui-panel-header-height: 32px;
  --ui-panel-action-min-width: 120px;
  --ui-action-min-width: 120px;
  /* A small action with words in a list's row (Run, Open, Details). */
  --ui-row-action-min-width: 88px;
  --ui-inspector-min-width: 280px;
  --ui-workspace-min-width: 320px;
  --ui-page-gutter: var(--ui-space-6);
  --ui-section-gap: var(--ui-space-6);
  --ui-panel-padding: var(--ui-space-4);
  --ui-surface-padding: var(--ui-space-6);
  --ui-dialog-width-compact: 360px;
  --ui-dialog-width-standard: 600px;
  --ui-dialog-width-wide: 900px;
  --ui-dialog-width-workspace: var(--ui-dialog-width-wide);
  --ui-dialog-height-workspace: 800px;
  --ui-dialog-column-min: 260px;
  --ui-picker-thumbnail-size: 100px;
  /* Cards with a screenshot (choice_group media:): their narrowest column,
     and the media's strength until its card is hovered, focused or chosen. */
  --ui-media-card-min: 240px;
  --ui-opacity-dimmed: 0.4;
  /* Photo grids (the 2026 image views preview): the gap between tiles, on
     both axes, for each Spacing choice, and the icon view's target tile. */
  --ui-image-gap-small: var(--ui-space-1);
  --ui-image-gap-medium: var(--ui-space-4);
  --ui-image-gap-large: var(--ui-space-8);
  --ui-image-icon-size: 118px;
  --ui-card-padding: var(--ui-space-4);
  --ui-field-gap: var(--ui-space-3);
  --ui-label-gap: var(--ui-space-1);
  --ui-action-gap: var(--ui-space-2);
  /* DPG's table density: 8px above and below each cell. */
  --ui-table-cell-block: var(--ui-space-2);
  --ui-table-cell-inline: var(--ui-space-4);
  --ui-delay-intent: 500ms;
  /* How long a placeholder waits for the script that lays its content out
     before showing the content as it is (RULES §24.4). Not motion, so
     reduced motion keeps it. */
  --ui-delay-enhancement: 3s;
  /* How long a loading line stays hidden in its place, so a fast load never
     flashes it (the fragment owner's loading line). Not motion, so reduced
     motion keeps it. */
  --ui-delay-loading: 300ms;
  --ui-duration-feedback: 160ms;
  --ui-duration-busy: 800ms;
  --ui-duration-background-work: 15s;
  --ui-duration-pulse: 1500ms;
  --ui-duration-caret: 1100ms;
  --ui-duration-shimmer: 3500ms;
  /* An upload row's progress: the sweep along a bar, and processing's breath. */
  --ui-duration-sweep: 2400ms;
  --ui-duration-breathe: 1800ms;
  --ui-duration-reveal: 200ms;
  --ui-duration-dismiss: 160ms;
  --ui-duration-reorder: 160ms;
  --ui-ease-reveal: cubic-bezier(0.2, 0, 0, 1);
  --ui-ease-dismiss: cubic-bezier(0.4, 0, 1, 1);
  --ui-ease-reorder: cubic-bezier(0.2, 0, 0, 1);
  --ui-ease-feedback: ease-out;
  --ui-ease-pulse: ease-in-out;
  /* A press: the pressed thing shows at once (press) and settles back with a
     small overshoot when the finger lifts (release), transform and opacity only. */
  --ui-duration-press: 80ms;
  --ui-duration-release: 320ms;
  --ui-ease-press: cubic-bezier(0.3, 0, 0.5, 1);
  --ui-ease-release: cubic-bezier(0.34, 1.45, 0.64, 1);
  --ui-press-scale: 0.95;
}

@media (width <= 1024px) {
  :root {
    --ui-page-gutter: var(--ui-space-3);
    --ui-surface-padding: var(--ui-space-4);
  }
}


@media (any-pointer: coarse) {
  :root {
    --ui-font-size-field: var(--ui-type-l);
    --ui-control-height: 44px;
    --ui-control-height-compact: 44px;
    --ui-control-height-inline: 44px;
    --ui-panel-header-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ui-delay-intent: 0ms;
    --ui-duration-feedback: 0ms;
    --ui-duration-reveal: 0ms;
    --ui-duration-dismiss: 0ms;
    --ui-duration-reorder: 0ms;
    --ui-duration-press: 0ms;
    --ui-duration-release: 0ms;
    --ui-press-scale: 1;
  }
}
