/* Alvøen's look: its design system's tokens over the app's own.

   Linked after the app's own stylesheets on every page of a deployment
   with EPLAST_CUSTOMER=alvoen (src/customer/alvoen.rs). It defines the
   design system's tokens (`--alv-*`: the colour scales, the semantic
   roles, the type scale, the typefaces, the radii, borders, spacing and
   control heights), points the tokens the app's stylesheets read at them,
   and sets the body's typeface; nothing else of the app's.

   Every colour is the design system's own value, not a sample: the
   scales 100-900 as the designer labels them (500 is the brand colour),
   the semantic roles of its "Alvøen · shadcn" variables in the light
   mode, under the same names, and the roles it adds for the CAD screen
   and the made-to-measure editor. Roles the file marks as a proposal
   ("Forslag": disabled, link, link-hover, success, attention, warning,
   info) are taken as they stand. The contrasts are the file's:
   foreground on background 17.55:1, muted-foreground on muted 7.43:1,
   input on white 9.06:1, link on white 7.56:1.

   The type scale is the design system's desktop scale, the phone's under
   768 px (size / line height in px, letter spacing 0). The typefaces are
   Geist and Geist Mono. Their files are not part of the app: a browser
   that has them installed shows them, any other falls back along the
   stack. Bundling them is a separate decision.

   The `--color-eplast-*` names are the brand's slots, not ePlast's
   colours: the blue scale is Alvøen's dark blue, the ice scale its greys
   and light blues. */

:root {
  /* The scales (the steps in use). */
  --alv-dark-blue-100: #cdd1d5;
  --alv-dark-blue-200: #9ba4aa;
  --alv-dark-blue-300: #687680;
  --alv-dark-blue-400: #364955;
  --alv-dark-blue-500: #041b2b;
  --alv-dark-blue-600: #031622;
  --alv-dark-blue-700: #02101a;
  --alv-dark-blue-800: #020b11;
  --alv-dark-blue-900: #010509;
  --alv-steel-blue-100: #cedbe4;
  --alv-steel-blue-300: #6c94ae;
  --alv-steel-blue-500: #0a4c78;
  --alv-steel-blue-600: #083d60;
  --alv-steel-blue-700: #062e48;
  --alv-steel-blue-800: #041e30;
  --alv-light-blue-100: #eef8ff;
  --alv-light-blue-200: #ddf1ff;
  --alv-light-blue-300: #cdebff;
  --alv-light-blue-500: #abddff;
  --alv-metal-grey-100: #fafbfb;
  --alv-metal-grey-200: #f5f6f7;
  --alv-metal-grey-300: #f0f2f4;
  --alv-metal-grey-400: #ebedf0;
  --alv-metal-grey-500: #e6e9ec;
  --alv-metal-grey-600: #b8babd;
  --alv-metal-grey-700: #8a8c8e;
  --alv-accent-orange-500: #fc5427;
  --alv-accent-orange-700: #973217;
  --alv-accent-orange-800: #652210;
  --alv-link-blue-300: #76beef;
  --alv-link-blue-500: #1b93e4;
  --alv-link-blue-600: #1676b6;
  --alv-link-blue-700: #105889;
  --alv-link-blue-800: #0b3b5b;
  --alv-link-blue-900: #051d2e;
  --alv-green-100: #e3f3dc;
  --alv-green-500: #74c350;
  --alv-green-800: #2e4e20;
  --alv-green-900: #172710;
  --alv-yellow-100: #fbf3cc;
  --alv-yellow-500: #eac300;
  --alv-yellow-800: #5e4e00;
  --alv-red-100: #f7cdcd;
  --alv-red-500: #d60404;
  --alv-red-600: #ab0303;
  --alv-red-700: #800202;
  --alv-white: #ffffff;
  --alv-black: #000000;

  /* The semantic roles (light mode). */
  --alv-background: var(--alv-white);
  --alv-foreground: var(--alv-dark-blue-500);
  --alv-card: var(--alv-white);
  --alv-card-foreground: var(--alv-dark-blue-500);
  --alv-popover: var(--alv-white);
  --alv-popover-foreground: var(--alv-dark-blue-500);
  --alv-muted: var(--alv-metal-grey-500);
  --alv-muted-foreground: var(--alv-steel-blue-500);
  --alv-primary: var(--alv-dark-blue-500);
  --alv-primary-foreground: var(--alv-white);
  --alv-secondary: var(--alv-light-blue-300);
  --alv-secondary-foreground: var(--alv-dark-blue-500);
  --alv-accent: var(--alv-metal-grey-500);
  --alv-accent-foreground: var(--alv-dark-blue-500);
  --alv-brand-action: var(--alv-dark-blue-500);
  --alv-brand-action-foreground: var(--alv-white);
  --alv-brand-action-border: var(--alv-dark-blue-500);
  --alv-destructive: var(--alv-red-500);
  --alv-destructive-foreground: var(--alv-white);
  --alv-disabled: var(--alv-metal-grey-300);
  --alv-disabled-foreground: var(--alv-steel-blue-700);
  --alv-border: var(--alv-metal-grey-500);
  --alv-input: var(--alv-steel-blue-500);
  --alv-ring: var(--alv-steel-blue-500);
  --alv-link: var(--alv-link-blue-700);
  --alv-link-hover: var(--alv-link-blue-800);
  --alv-success: var(--alv-green-500);
  --alv-success-foreground: var(--alv-dark-blue-500);
  --alv-attention: var(--alv-yellow-500);
  --alv-attention-foreground: var(--alv-dark-blue-500);
  --alv-warning: var(--alv-accent-orange-500);
  --alv-warning-foreground: var(--alv-dark-blue-500);
  --alv-info: var(--alv-steel-blue-100);
  --alv-info-foreground: var(--alv-steel-blue-800);
  --alv-success-text: var(--alv-green-800);
  --alv-attention-text: var(--alv-yellow-800);
  --alv-warning-text: var(--alv-accent-orange-700);
  --alv-error-text: var(--alv-red-700);

  /* The roles of the CAD screen and the made-to-measure editor. */
  --alv-workflow-toolbar: var(--alv-metal-grey-500);
  --alv-workflow-workspace: rgb(230 233 236 / 40%);
  --alv-cad-upload: var(--alv-link-blue-300);
  --alv-cad-upload-foreground: var(--alv-dark-blue-500);
  --alv-cad-upload-border: var(--alv-dark-blue-500);
  --alv-cad-selected-file: var(--alv-metal-grey-500);
  --alv-cad-selected-file-foreground: var(--alv-dark-blue-500);
  --alv-cad-price-badge: var(--alv-steel-blue-100);
  --alv-parametric-price-badge: var(--alv-steel-blue-300);
  --alv-workflow-price-foreground: var(--alv-steel-blue-800);
  --alv-parametric-view-selected: var(--alv-dark-blue-500);
  --alv-parametric-chain-unlinked: var(--alv-light-blue-300);
  --alv-parametric-chain-linked: var(--alv-steel-blue-500);
  --alv-parametric-chain-linked-foreground: var(--alv-metal-grey-500);
  --alv-parametric-chain-linked-border: var(--alv-dark-blue-500);
  --alv-parametric-field: var(--alv-white);
  --alv-parametric-field-foreground: var(--alv-dark-blue-500);
  --alv-parametric-canvas: var(--alv-metal-grey-500);
  --alv-parametric-grid: rgb(10 76 120 / 20%);
  --alv-parametric-canvas-foreground: var(--alv-dark-blue-500);
  --alv-parametric-price-header: var(--alv-metal-grey-500);
  --alv-parametric-price-selected: var(--alv-light-blue-300);
  --alv-field-placeholder: var(--alv-steel-blue-500);
  /* The upload screen's own fills: the upload card and the project rail
     in the primary light blue, the drawing's surface in the metal grey
     with its grid in the foreground at 9.5 %. */
  --alv-cad-upload-card: var(--alv-light-blue-500);
  --alv-project-rail: var(--alv-light-blue-500);
  --alv-viewer-surface: var(--alv-metal-grey-500);
  --alv-viewer-grid: rgb(4 27 43 / 9.5%);

  /* Type: Geist and Geist Mono, then what the system has. */
  --alv-font-sans: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --alv-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* The type scale, size and line height in px; desktop here, the phone's
     below. */
  --alv-display-size: 72px;
  --alv-display-line: 80px;
  --alv-h1-size: 52px;
  --alv-h1-line: 60px;
  --alv-h2-size: 36px;
  --alv-h2-line: 44px;
  --alv-h3-size: 28px;
  --alv-h3-line: 36px;
  --alv-ingress-size: 18px;
  --alv-ingress-line: 28px;
  --alv-body-size: 18px;
  --alv-body-line: 28px;
  --alv-small-size: 14px;
  --alv-small-line: 20px;
  --alv-label-size: 16px;
  --alv-label-line: 24px;
  --alv-control-size: 14px;
  --alv-control-line: 20px;
  --alv-input-size: 14px;
  --alv-input-line: 20px;
  --alv-mono-size: 14px;
  --alv-mono-line: 20px;
  --alv-byline-size: 11px;
  --alv-byline-line: 20px;
  /* The components' own sizes: a button's and a tab's label, a badge's,
     a file row's name and status (a material card's status is the
     row's). */
  --alv-button-size: 14px;
  --alv-badge-size: 12px;
  --alv-row-name-size: 13px;
  --alv-row-name-line: 19px;
  --alv-row-status-size: 11px;
  --alv-row-status-line: 17px;

  /* Shapes: radius/md for buttons, inputs, selects, tabs, tables and
     cards; 6 for the panel header, a file row, a material card, a
     stepper and the drawing's canvas; 4 for a checkbox; a badge's pill.
     1 px borders, a 2 px focus ring 2 px outside the control, and a
     disabled control at half opacity. */
  --alv-radius: 8px;
  --alv-radius-sm: 6px;
  --alv-radius-xs: 4px;
  --alv-radius-full: 9999px;
  --alv-border-width: 1px;
  --alv-ring-width: 2px;
  --alv-ring-offset: 2px;
  --alv-disabled-opacity: 0.5;

  /* Spacing (space/6 … space/36) and control heights. */
  --alv-space-6: 6px;
  --alv-space-8: 8px;
  --alv-space-12: 12px;
  --alv-space-16: 16px;
  --alv-space-32: 32px;
  --alv-space-36: 36px;
  --alv-control-height: 36px;
  --alv-control-height-sm: 32px;
  --alv-cart-height: 45px;
  --alv-badge-height: 22px;
  --alv-checkbox-size: 16px;
  --alv-table-header-height: 37px;
  --alv-panel-header-height: 44px;
  --alv-material-card-height: 56px;
  --alv-toolbar-height: 60px;

  /* The app's own tokens, from the design system's. */
  --color-eplast-blue-100: var(--alv-dark-blue-100);
  --color-eplast-blue-200: var(--alv-dark-blue-200);
  --color-eplast-blue-300: var(--alv-dark-blue-300);
  --color-eplast-blue-400: var(--alv-dark-blue-400);
  --color-eplast-blue-500: var(--alv-dark-blue-500);
  --color-eplast-blue-600: var(--alv-dark-blue-600);
  --color-eplast-blue-700: var(--alv-dark-blue-700);
  --color-eplast-blue-800: var(--alv-dark-blue-800);
  --color-eplast-blue-900: var(--alv-dark-blue-900);

  --color-eplast-ice-100: var(--alv-metal-grey-200);
  --color-eplast-ice-200: var(--alv-metal-grey-500);
  --color-eplast-ice-300: var(--alv-metal-grey-600);
  --color-eplast-ice-400: var(--alv-secondary);
  --color-eplast-ice-500: var(--alv-cad-upload);
  --color-eplast-ice-600: var(--alv-link-blue-600);
  --color-eplast-ice-700: var(--alv-link);
  --color-eplast-ice-800: var(--alv-link-blue-800);
  --color-eplast-ice-900: var(--alv-link-blue-900);

  /* The board's dark blues: the foreground. */
  --color-eplast-ink-500: var(--alv-foreground);
  --color-eplast-ink-600: var(--alv-foreground);
  --color-eplast-ink-700: var(--alv-foreground);
  --color-eplast-ink-800: var(--alv-foreground);

  /* The upload target's yellow is the upload role's blue (dark text on
     it); the files' column, green for ePlast, the light greys. */
  --color-yellow-500: var(--alv-cad-upload);
  --color-eplast-spring-200: var(--alv-metal-grey-200);
  --color-eplast-spring-300: var(--alv-metal-grey-500);

  /* Signals: the status texts. */
  --color-eplast-grass-500: var(--alv-success-text);
  --color-eplast-grass-600: var(--alv-green-900);
  --color-eplast-grass-700: var(--alv-green-900);
  --color-orange-500: var(--alv-warning-text);
  --color-orange-600: var(--alv-accent-orange-800);
  --color-red-600: var(--alv-red-600);
  --color-red-700: var(--alv-error-text);

  --primary: var(--alv-primary);
  --primary-foreground: var(--alv-primary-foreground);
  --secondary: var(--alv-secondary);
  --secondary-foreground: var(--alv-secondary-foreground);
  --accent: var(--alv-accent);
  --accent-foreground: var(--alv-accent-foreground);
  --destructive: var(--alv-destructive);
  --border: var(--alv-border);
  --input: var(--alv-input);
  --ring: var(--alv-ring);
  --link: var(--alv-link);
  --link-hover: var(--alv-link-hover);
  --radius: var(--alv-radius);
  --sidebar-primary: var(--alv-primary);
  --sidebar-primary-foreground: var(--alv-primary-foreground);
  --color-content-300: var(--alv-muted-foreground);
  --color-content-500: var(--alv-foreground);
  --cad-workflow-focus-ring: var(--alv-ring);
  --cad-thumbnail-bg: var(--alv-metal-grey-200);
}

@media (max-width: 767px) {
  :root {
    --alv-display-size: 40px;
    --alv-display-line: 48px;
    --alv-h1-size: 36px;
    --alv-h1-line: 44px;
    --alv-h2-size: 28px;
    --alv-h2-line: 36px;
    --alv-h3-size: 24px;
    --alv-h3-line: 32px;
    --alv-ingress-size: 16px;
    --alv-ingress-line: 24px;
    --alv-body-size: 16px;
    --alv-body-line: 24px;
    --alv-input-size: 16px;
    --alv-input-line: 24px;
  }
}

body {
  font-family: var(--alv-font-sans);
}

/* The few places the stylesheets write white on the accent: dark text
   instead, since white on the upload role's blue is about 2:1. */
.viewer-controls-button[aria-pressed="true"],
.ld-vbtn.ld-von,
.vw-button[aria-pressed="true"],
.vw-button:hover,
.vw-full:hover {
  color: var(--alv-foreground);
}

/* Colours the pages write into their class names (Tailwind's arbitrary
   values), not yet tokens: the same classes in Alvøen's colours. */
.text-\[\#202945\] { color: var(--color-eplast-blue-500); }
.bg-\[\#202945\] { background-color: var(--color-eplast-blue-500); }
.text-\[\#073955\] { color: var(--alv-foreground); }
.border-\[\#073955\] { border-color: var(--alv-foreground); }
.after\:bg-\[\#073955\]::after { background-color: var(--alv-foreground); }
/* The view buttons of the editor and the preview, in the design's view
   button: the control border, the chosen one secondary with dark text. */
.border-\[\#87a9b4\] { border-color: var(--alv-input); }
.focus\:border-\[\#87A9B4\]:focus { border-color: var(--color-eplast-ice-500); }
.focus\:ring-\[\#87A9B4\]:focus { --tw-ring-color: var(--color-eplast-ice-500); }
.aria-pressed\:bg-\[\#87a9b4\][aria-pressed="true"],
.data-\[active\=true\]\:bg-\[\#87a9b4\][data-active="true"],
.data-\[state\=open\]\:bg-\[\#87a9b4\][data-state="open"] {
  background-color: var(--alv-secondary);
  color: var(--alv-secondary-foreground);
}
.border-\[\#b7cbd2\] { border-color: var(--color-eplast-ice-300); }
.bg-\[\#8fb1bc\] { background-color: var(--color-eplast-ice-400); }
.bg-\[\#e7eef0\] { background-color: var(--color-eplast-ice-100); }
