/* The redesign's palette and type: printed paper, ink, burnt orange, amber highlighter.
   With tokens.css and css/themes/, the only files where a colour literal may appear.
   Light, Dim and Dark are redrawn here; every theme but Light also has a layer, css/themes/<key>.css,
   linked after every other stylesheet (layout.php) and swapped with the theme (app.js). */
:root {
  --font-sans: 'Chakra Petch', 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mast-band: 56px;
  --mast-strip: 48px;
  --topbar-height: calc(var(--mast-band) + var(--mast-strip));
  --rule: 3px;
  --tracking-label: 0.08em;
  --tracking-th: 0.08em;

  /* a calmer scale: display sizes are for one word on a poster, not for every figure */
  --text-2xl: 22px;
  --text-display-1: 24px;
  --text-display-2: 30px;
  --text-display-3: 40px;
  --gutter: 28px;

  /* square: nothing is rounded */
  --radius-control: 0px;
  --radius-panel: 0px;
  --radius-menu: 0px;
  --radius-badge: 0px;
  --radius-chip: 0px;
  --radius-round: 0px;

  /* names kept from the first shell; pages read them for "ink on amber" and the index sheet */
  --rail-bg: #17130e;
  --rail-text: #f3ebda;
  --rail-text-strong: #ffffff;
  --rail-muted: #b8ad98;
  --rail-hover-bg: #2a231a;
  --rail-active-bg: #2a231a;
  --rail-line: #3a3126;
  --rail-accent: #f0a818;
  --rail-accent-ink: #17130e;
  --rail-accent-hover: #ffc247;

  /* theme tiles and the theme menu */
  --swatch-light: linear-gradient(135deg, #f3ebda 0 50%, #b5451b 50% 100%);
  --swatch-dim: linear-gradient(135deg, #221c15 0 50%, #b5451b 50% 100%);
  --swatch-dark: linear-gradient(135deg, #14110d 0 50%, #f0a818 50% 100%);
}

:root[data-theme="light"], :root:not([data-theme]) {
  --color-page-bg: #f3ebda;
  --color-surface: #f3ebda;
  --color-surface-alt: #eae0ca;
  --color-surface-sunken: #dfd3b8;
  --color-border: #d3c6a8;
  --color-border-strong: #17130e;

  --color-text: #17130e;
  --color-text-muted: #5a5245;
  --color-label: #37312a;
  --color-text-input: #17130e;
  --color-text-faint: #8f846e;
  --color-text-inverse: #f3ebda;

  --color-link: #a03a10;
  --color-link-hover: #17130e;
  --color-primary: #f0a818;
  --color-primary-hover: #d99500;
  --color-on-primary: #f3ebda;
  --color-primary-strong: #17130e;
  --color-primary-strong-hover: #3a3126;
  --color-danger: #c41c1c;
  --color-danger-hover: #9f1515;
  --color-focus: #17130e;
  --color-focus-ring: rgba(23, 19, 14, 0.4);

  --color-create: #b5451b;
  --color-create-hover: #8f3413;
  --color-create-strong: #b5451b;
  --color-create-strong-hover: #8f3413;
  --color-warning: #b45309;
  --color-warning-hover: #8f4207;
  --color-warning-strong: #b45309;
  --color-warning-strong-hover: #8f4207;
  --color-on-button: #ffffff;
  --color-cancel: #5a5245;
  --color-cancel-hover: #37312a;

  --color-topbar-bg: #b5451b;
  --color-topbar-text: #ffffff;
  --color-topbar-muted: #ffe6d6;
  --color-nav-bg: #b5451b;
  --color-nav-text: #ffffff;
  --color-nav-hover-bg: #8f3413;
  --color-nav-active-bg: #f3ebda;
  --color-nav-active-text: #17130e;
  --color-nav-text-shadow: transparent;
  --color-store-link: #ffe6d6;
  --color-store-icon: #ffe6d6;
  --color-avatar-bg: #17130e;
  --color-avatar-text: #f0a818;
  --color-menu-bg: #fffaf0;
  --color-menu-border: #17130e;
  --color-menu-hover-bg: #17130e;
  --color-menu-hover-text: #f3ebda;
  --color-search-bg: #8f3413;
  --color-search-border: #8f3413;
  --color-search-placeholder: #ffe6d6;

  --color-th-bg: #f3ebda;
  --color-th-text: #17130e;
  --color-th-border: #17130e;
  --color-th-bar: #17130e;
  --color-row-stripe: #f3ebda;
  --color-row-hover: #eae0ca;
  --color-row-selected: #fbe3a6;
  --color-accent-tint: #fbe3a6;
  --color-date-band-bar: #d3c6a8;

  --color-input-bg: #fffaf0;
  --color-input-border: #17130e;
  --color-input-shadow: transparent;
  --color-addon-bg: #eae0ca;
  --color-icon-btn: #17130e;
  --color-icon-btn-ring: #17130e;
  --color-btn-bg: #f3ebda;
  --color-btn-text: #17130e;
  --color-btn-border: #17130e;
  --color-tile: #17130e;
  --color-tile-hover: #3a3126;
  --color-dash-panel: #f3ebda;
  --color-dash-track: #dfd3b8;
  --color-dash-fill: #17130e;
  --color-section-count: #f0a818;
  --color-tag-border: #17130e;
  --color-tab-active-bg: #17130e;
  --color-footer-text: #5a5245;
  --color-shadow: transparent;
  --color-modal-shadow: transparent;
  --color-backdrop: rgba(23, 19, 14, 0.72);
  --shadow-overlay: 0 0 0 1px var(--color-text);
  --color-pictogram: #a89c84;

  --color-flash-success: #17663a;
  --color-flash-error: #c81e1e;
  --color-flash-info: #17130e;
  --color-success-bg: #dcebd3;
  --color-success-ink: #14522d;
  --color-success-border: #14522d;
  --color-error-bg: #f6d5cd;
  --color-error-ink: #8f1414;
  --color-error-border: #8f1414;
  --color-info-bg: #fbe3a6;
  --color-info-ink: #17130e;
  --color-info-border: #17130e;
  --color-warn-bg: #f6d9c4;
  --color-warn-ink: #7a2e0c;
  --color-warn-border: #7a2e0c;
  --color-neutral-bg: #eae0ca;
  --color-neutral-ink: #37312a;
  --color-neutral-border: #a89c84;
  --color-dark-bg: #17130e;
  --color-dark-ink: #f3ebda;
  --color-weekend: #eae0ca;

  --module-dashboard: #f0a818;
  --module-reports: #b5451b;
  --tile-blue: #17130e;

  /* The life of a job in the product's own hues: paper-cool before it is priced, amber while it is an offer,
     rust once it is an order. Chosen for this palette; each holds 3:1 on the paper for the planner's edges. */
  --state-enquiry: #4f7387;
  --state-draft: #6f7d3c;
  --state-quotation: #c98a00;
  --state-order: #a03a10;
  --status-open: #4f7387;
  --status-provisional: #c98a00;
  --status-reserved: #6a4a86;
  --status-active: #a03a10;
  --status-invoiced: #2f7a48;
  --status-inactive: #8a8170;
  --pl-line-enquiry: #4f7387;
  --pl-line-draft: #6f7d3c;
  --pl-line-quotation: #a87300;
  --pl-line-inactive: #7a7263;
  --stage-quoted: #4f7387;
  --stage-reserved: #6a4a86;

  /* cream figures on the over-booked fill: the shared mix (#c94300) leaves them at 4.1:1 */
  --avail-warn-strong: #bc3e00;
}

/* Dark: the manifest under a work lamp. Warm black stock, cream ink, the masthead in ink so the amber
   highlighter carries the page. Dim (below) is the same sheet on cocoa stock with softer ink, under the
   burnt-orange band. Every hue here is lifted to hold 3:1 as an edge and a dot on both grounds.
   Screen only, as the palettes in tokens.css are: cream ink would print on white paper. */
@media screen {
:root[data-theme="dark"], :root[data-theme="dim"] {
  --color-page-bg: #14110d;
  --color-surface: #14110d;
  --color-surface-alt: #1f1a14;
  --color-surface-sunken: #2a231a;
  --color-border: #3a3126;
  --color-border-strong: #f3ebda;
  --color-text: #f3ebda;
  --color-text-muted: #b8ad98;
  --color-label: #dfd3b8;
  --color-text-input: #f3ebda;
  --color-text-faint: #7a6e5c;
  --color-text-inverse: #14110d;
  --color-link: #ff9d6b;
  --color-link-hover: #f3ebda;
  --color-primary: #f0a818;
  --color-primary-hover: #ffc247;
  --color-on-primary: #14110d;
  --color-primary-strong: #f3ebda;
  --color-primary-strong-hover: #ffffff;
  --color-danger: #d42c22;
  --color-danger-hover: #a51d16;
  --color-on-danger: #ffffff;
  --color-focus: #f0a818;
  --color-focus-ring: rgba(240, 168, 24, 0.45);
  --color-create: #d2562a;
  --color-create-hover: #b5451b;
  --color-create-strong: #b5451b;
  --color-create-strong-hover: #c24d21;
  --color-warning: #b45309;
  --color-warning-hover: #8f4207;
  --color-warning-strong: #b45309;
  --color-warning-strong-hover: #8f4207;
  --color-on-button: #ffffff;
  --color-cancel: #6b6253;
  --color-cancel-hover: #5a5245;
  --rail-accent-ink: #14110d;

  --color-topbar-bg: #0a0806;
  --color-topbar-text: #f3ebda;
  --color-topbar-muted: #b8ad98;
  --color-nav-bg: #0a0806;
  --color-nav-text: #f3ebda;
  --color-nav-hover-bg: #2a231a;
  --color-nav-active-bg: #14110d;
  --color-nav-active-text: #f3ebda;
  --color-nav-text-shadow: transparent;
  --color-store-link: #b8ad98;
  --color-store-icon: #b8ad98;
  --color-avatar-bg: #14110d;
  --color-avatar-text: #f0a818;
  --color-menu-bg: #1f1a14;
  --color-menu-border: #f3ebda;
  --color-menu-hover-bg: #f3ebda;
  --color-menu-hover-text: #14110d;
  --color-search-bg: #1f1a14;
  --color-search-border: #3a3126;
  --color-search-placeholder: #b8ad98;

  --color-th-bg: #14110d;
  --color-th-text: #f3ebda;
  --color-th-border: #f3ebda;
  --color-th-bar: #f3ebda;
  --color-row-stripe: #14110d;
  --color-row-hover: #1f1a14;
  --color-row-selected: #4a3608;
  --color-accent-tint: #4a3608;
  --color-date-band-bar: #3a3126;
  --color-shortage-bg: #4a1a14;

  --color-input-bg: #0c0a07;
  --color-input-border: #f3ebda;
  --color-input-shadow: transparent;
  --color-addon-bg: #1f1a14;
  --color-icon-btn: #f3ebda;
  --color-icon-btn-ring: #f3ebda;
  --color-btn-bg: #14110d;
  --color-btn-text: #f3ebda;
  --color-btn-border: #f3ebda;
  --color-toggle-off: #4d4234;
  --color-toggle-off-text: #dfd3b8;
  --color-tile: #f3ebda;
  --color-tile-hover: #ffffff;
  --color-dash-panel: #14110d;
  --color-dash-track: #3a3126;
  --color-dash-fill: #f3ebda;
  --color-dash-muted: #b8ad98;
  --color-section-count: #f0a818;
  --color-tag-border: #8a7f6c;
  --color-tab-active-bg: #f3ebda;
  --color-footer-text: #b8ad98;
  --color-state-seg-on: #b8ad98;
  --color-state-seg-off: #3a3126;
  --color-shadow: transparent;
  --color-modal-shadow: transparent;
  --color-backdrop: rgba(5, 4, 3, 0.78);
  --shadow-overlay: 0 0 0 1px var(--color-text);
  --color-pictogram: #6e6352;
  --color-weekend: #1f1a14;
  --color-dark-bg: #0a0806;
  --color-dark-ink: #f3ebda;
  --color-chip-ink: #17130e;

  --color-flash-success: #1d6b3f;
  --color-flash-error: #c81e1e;
  --color-flash-info: #3a3126;
  --color-success-bg: #16251a;
  --color-success-ink: #9cd6a6;
  --color-success-border: #4a8a5a;
  --color-error-bg: #3a1410;
  --color-error-ink: #ffa592;
  --color-error-border: #b5392b;
  --color-info-bg: #4a3608;
  --color-info-ink: #f3ebda;
  --color-info-border: #f0a818;
  --color-warn-bg: #36210e;
  --color-warn-ink: #f4b783;
  --color-warn-border: #a35a22;
  --color-neutral-bg: #1f1a14;
  --color-neutral-ink: #cfc4ae;
  --color-neutral-border: #5a5040;

  --module-dashboard: #f0a818;
  --module-reports: #d2562a;
  --module-people: #e5483b;
  --tile-blue: #f3ebda;
  --tile-red: #e5483b;

  --state-enquiry: #7fa3b8;
  --state-draft: #9aa860;
  --state-quotation: #d9a21e;
  --state-order: #e8703a;
  --status-open: #7fa3b8;
  --status-provisional: #d9a21e;
  --status-reserved: #a98bd0;
  --status-active: #e8703a;
  --status-invoiced: #5fb27a;
  --status-inactive: #978c78;
  --pl-line-enquiry: #7fa3b8;
  --pl-line-draft: #9aa860;
  --pl-line-quotation: #d9a21e;
  --pl-line-provisional: #d9a21e;
  --pl-line-reserved: #a98bd0;
  --pl-line-order: #e8703a;
  --pl-line-inactive: #978c78;
  --pl-line-completed: #f3ebda;
  --stage-quoted: #7fa3b8;
  --stage-reserved: #a98bd0;
  --item-completed: #8a7f6c;
  --item-booked-out: #e5483b;
  --item-part-checked-in: #c25fd0;
  --item-deal-price: #e5483b;
  --type-rental: #5a8cff;
  --type-sale: #c25fd0;
  --type-service: #e5483b;
  --incl-mandatory: #e5483b;
  --avail-short: #e5483b;
  --avail-warn-strong: #f08a4b;
  --avail-ok-tint: #446300;
  --stage-prep: #d0503c;
  --stage-de-prep: #d0503c;
  --stage-load: #7d6bff;
  --stage-unload: #7d6bff;
  --stage-setup: #d6458f;
  --stage-take-down: #d6458f;
  --stage-quarantine: #d6458f;
}
:root[data-theme="dim"] {
  --color-page-bg: #221c15;
  --color-surface: #221c15;
  --color-surface-alt: #2c251c;
  --color-surface-sunken: #3a3126;
  --color-border: #4a4033;
  --color-border-strong: #ebe1cd;
  --color-text: #ebe1cd;
  --color-text-muted: #bcb19b;
  --color-label: #ddd2bb;
  --color-text-input: #ebe1cd;
  --color-text-faint: #7e7262;
  --color-primary-strong: #ebe1cd;
  --color-link-hover: #ebe1cd;

  --color-topbar-bg: #b5451b;
  --color-topbar-text: #ffffff;
  --color-topbar-muted: #ffe6d6;
  --color-nav-bg: #b5451b;
  --color-nav-text: #ffffff;
  --color-nav-hover-bg: #8f3413;
  --color-nav-active-bg: #221c15;
  --color-nav-active-text: #ebe1cd;
  --color-store-link: #ffe6d6;
  --color-store-icon: #ffe6d6;
  --color-avatar-bg: #17130e;
  --color-search-bg: #8f3413;
  --color-search-border: #8f3413;
  --color-search-placeholder: #ffe6d6;
  --color-menu-bg: #2c251c;
  --color-menu-border: #ebe1cd;
  --color-menu-hover-bg: #ebe1cd;
  --color-menu-hover-text: #221c15;

  --color-th-bg: #221c15;
  --color-th-text: #ebe1cd;
  --color-th-border: #ebe1cd;
  --color-th-bar: #ebe1cd;
  --color-row-stripe: #221c15;
  --color-row-hover: #2c251c;
  --color-row-selected: #54400f;
  --color-accent-tint: #54400f;
  --color-date-band-bar: #4a4033;
  --color-shortage-bg: #57211a;
  --color-input-bg: #191510;
  --color-input-border: #ebe1cd;
  --color-addon-bg: #2c251c;
  --color-icon-btn: #ebe1cd;
  --color-icon-btn-ring: #ebe1cd;
  --color-btn-bg: #221c15;
  --color-btn-text: #ebe1cd;
  --color-btn-border: #ebe1cd;
  --color-toggle-off: #5a4e3e;
  --color-tile: #ebe1cd;
  --color-dash-panel: #221c15;
  --color-dash-track: #4a4033;
  --color-dash-fill: #ebe1cd;
  --color-dash-muted: #bcb19b;
  --color-tab-active-bg: #ebe1cd;
  --color-footer-text: #bcb19b;
  --color-state-seg-on: #bcb19b;
  --color-state-seg-off: #4a4033;
  --color-pictogram: #7e7262;
  --color-weekend: #2a231a;
  --color-dark-bg: #14110d;
  --color-dark-ink: #ebe1cd;
  --tile-blue: #ebe1cd;
  --pl-line-completed: #ebe1cd;

  --color-flash-info: #4a4033;
  --color-success-bg: #213226;
  --color-error-bg: #47201a;
  --color-info-bg: #54400f;
  --color-info-ink: #ebe1cd;
  --color-warn-bg: #432c17;
  --color-neutral-bg: #2c251c;
  --color-neutral-ink: #d3c8b2;
}
}

@media screen and (max-width: 1099px) {
  :root { --topbar-height: var(--mast-band); --gutter: 16px; }
}
