/*
 * BaseApp (SynclyLink) — design tokens and components.
 * Ported from the SynclyLink BaseApp frontend (frontend/src/index.css, DESIGN.md) and reviewed with the
 * apple-design skill. Rule: tokens only — no new colours, radii or font sizes outside :root.
 */

@font-face {
  font-family: 'DM Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url('fonts/dm-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url('fonts/dm-sans-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  font-family: 'DM Sans Variable', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-ground);
  color-scheme: light dark;
  --color-text: #111827;
  --color-muted: #626b78;
  --color-surface: #fff;
  --color-ground: #f3f4f6;
  --color-border: #e5e7eb;
  --color-control-border: #8994a3;
  --color-surface-hover: #f9fafb;
  --color-accent: #0078d4;
  --color-accent-hover: #106ebe;
  --color-accent-active: #005a9e;
  --color-accent-soft: #edf6fc;
  --color-accent-soft-hover: #e0effb;
  --color-link: #106ebe;
  --color-link-hover: #005a9e;
  --color-danger: #dc2626;
  --color-danger-fill: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-active: #991b1b;
  --color-success: #15803d;
  --color-selection: #d6eafb;
  --color-scrollbar: #b7bdc6;
  --color-skeleton: #e5e7eb;
  --color-backdrop: rgb(20 32 50 / 42%);
  --shadow-modal: 0 18px 48px rgb(20 32 50 / 22%);
  --shadow-toast: 0 6px 28px rgb(20 32 50 / 20%);
  --shadow-panel: 0 1px 2px rgb(20 32 50 / 6%), 0 1px 3px rgb(20 32 50 / 4%);
  --radius-control: 8px;
  --radius-panel: 12px;
  --radius-navigation: 7px;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --color-brand-deep: #0b2f52;
  --color-brand-deeper: #061a30;
  --color-on-brand: #eaf4fd;
  --color-on-brand-muted: #a9c7e4;
  --color-paper: #fff;
  --color-paper-ink: #111827;
  --color-paper-muted: #626b78;
  --color-paper-line: #e5e7eb;
  --color-paper-ok: #15803d;
  --shadow-sheet: 0 24px 60px rgb(3 14 28 / 45%);
  --radius-pill: 999px;
  /* Single-series chart bars (validated: contrast >= 3:1 on the surface, dataviz). */
  --chart-bar: #0078d4;
  --chart-grid: #e5e7eb;
  /* Zone types on the warehouse map (validated categorical set, dataviz): always shown with the type's name. */
  --zone-receiving: #2a78d6;
  --zone-storage: #1b9e77;
  --zone-shipping: #c9730a;
  --zone-transit: #7c5ce0;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-text: #e6edf5;
    --color-muted: #a7b4c4;
    --color-surface: #182230;
    --color-ground: #0f1722;
    --color-border: #303d4f;
    --color-control-border: #708097;
    --color-surface-hover: #202e40;
    --color-accent-soft: #173c5b;
    --color-accent-soft-hover: #214d70;
    --chart-bar: #3b9be6;
    --chart-grid: #303d4f;
    --zone-receiving: #4c9be8;
    --zone-storage: #26a882;
    --zone-shipping: #cf7d14;
    --zone-transit: #9a80f0;
    --color-link: #7cc4ff;
    --color-link-hover: #b1deff;
    --color-danger: #ff9b9b;
    --color-danger-fill: #b91c1c;
    --color-danger-hover: #991b1b;
    --color-danger-active: #7f1d1d;
    --color-success: #6ed7a0;
    --color-selection: #27547a;
    --color-scrollbar: #52647b;
    --color-skeleton: #303d4f;
    --color-backdrop: rgb(2 6 12 / 72%);
    --shadow-modal: 0 18px 48px rgb(0 0 0 / 45%);
    --shadow-toast: 0 6px 28px rgb(0 0 0 / 40%);
    --shadow-panel: 0 1px 2px rgb(0 0 0 / 28%);
  }
}

@media (prefers-contrast: more) {
  :root {
    --color-muted: #4b5361;
    --color-border: #8994a3;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --color-muted: #c9d3df;
    --color-border: #708097;
  }
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  font-size: 0.875rem;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--color-scrollbar) transparent;
  scrollbar-width: thin;
}

button, input, select, textarea { font: inherit; color: inherit; }
button, select { touch-action: manipulation; }
input, textarea { caret-color: var(--color-accent); }

::selection { color: var(--color-text); background: var(--color-selection); }

a { color: var(--color-link); text-underline-offset: 0.2em; }
a:hover { color: var(--color-link-hover); }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
h2, h3 { font-size: 1rem; }

svg { flex-shrink: 0; }

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

/* Blazor moves focus to the page heading after navigation (screen readers); no ring there. */
h1:focus { outline: none; }

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  color: #fff;
  background: var(--color-accent);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); color: #fff; }

.mono { font-family: var(--font-mono); font-size: 0.8125rem; }

/* ---------- Shell ---------- */

.app-shell {
  min-height: 100dvh;
  --sidebar-width: 220px;
  --chrome-offset: 100px;
}

.app-shell--compact { --sidebar-width: 64px; }
.app-shell--bare { --sidebar-width: 0px; }

.chrome { position: sticky; top: 0; z-index: 20; }

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.topbar-start { min-width: 0; flex-shrink: 0; display: flex; align-items: center; gap: 10px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
}

.brand-picture { display: flex; align-items: center; min-width: 0; max-width: 100%; }
.brand-logo { display: block; width: 132px; height: auto; max-width: 100%; min-width: 0; }

.topbar-title {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.8125rem;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 0; }

.company-switcher { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 0.75rem; }
.company-switcher select { width: auto; max-width: 220px; font-size: 0.8125rem; }

.account-actions { display: flex; align-items: center; gap: 12px; min-width: 0; position: relative; }

/* EN | PL: the current language is solid text, the other one a quiet link. */
.language-switcher { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-muted);
  text-decoration: none;
}
.language-switcher a:hover { background: var(--color-surface-hover); color: var(--color-text); }
.language-switcher a[aria-current='true'] { color: var(--color-text); background: var(--color-accent-soft); }
.account-actions form { margin: 0; }

.account-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.module-bar {
  height: 44px;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.module-bar-list {
  display: flex;
  align-items: stretch;
  height: 100%;
  margin: 0;
  padding: 0 24px;
  list-style: none;
  white-space: nowrap;
}

.module-link {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.8125rem;
}

.module-link:hover { background: var(--color-surface-hover); color: var(--color-text); }

.module-link.is-active {
  border-bottom-color: var(--color-accent);
  color: var(--color-link);
  font-weight: 600;
}

.module-link:focus-visible { outline-offset: -2px; }

.app-body { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky;
  top: 100px;
  flex-shrink: 0;
  width: var(--sidebar-width);
  height: calc(100dvh - 100px);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.navigation {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px;
}

.navigation-heading {
  padding: 6px 10px;
  color: var(--color-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { margin-top: 10px; }

.nav-group-heading {
  padding: 6px 10px 4px;
  color: var(--color-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: var(--radius-navigation);
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.nav-link:hover { color: var(--color-text); background: var(--color-surface-hover); }

.nav-link.active {
  color: var(--color-link);
  background: var(--color-accent-soft);
  font-weight: 600;
}

.nav-link.active:hover { color: var(--color-link-hover); background: var(--color-accent-soft-hover); }
.nav-link:active:not(.active) { background: var(--color-ground); }
.nav-label { white-space: nowrap; }

.sidebar-footer { flex-shrink: 0; padding: 8px 8px 12px; }

.sidebar-toggle {
  width: 100%;
  justify-content: flex-start;
  gap: 9px;
  padding-inline: 10px;
  font-weight: 400;
  border-radius: var(--radius-navigation);
}

.sidebar--collapsed .nav-link,
.sidebar--collapsed .sidebar-toggle { justify-content: center; padding-inline: 0; }
.sidebar--collapsed .nav-link { min-height: 44px; }

.sidebar--collapsed .nav-group + .nav-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--color-border);
}

.workspace { flex: 1; min-width: 0; }

.page-content {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: 32px 32px 48px;
}

.page-content:focus { outline: none; }

.menu-trigger { display: none !important; }

/* ---------- Tell Me ---------- */

.tell-me-trigger {
  flex: 1 1 240px;
  min-width: 44px;
  max-width: 480px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-muted);
  text-align: left;
  cursor: pointer;
  container-type: inline-size;
}

.tell-me-trigger:hover { background: var(--color-surface-hover); }

.tell-me-placeholder {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tell-me-shortcut {
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-navigation);
  font: inherit;
  font-size: 0.75rem;
}

@container (max-width: 190px) { .tell-me-shortcut { display: none; } }
@container (max-width: 100px) { .tell-me-placeholder { display: none; } }

.search-dialog {
  position: fixed;
  z-index: 50;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
}

.search-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search-input { width: 100%; }
.search-results, .search-results ul { margin: 0; padding: 0; list-style: none; }

.search-group-heading {
  padding: 8px 10px 4px;
  color: var(--color-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--radius-navigation);
  cursor: pointer;
}

.search-option[aria-selected='true'] {
  background: var(--color-accent-soft);
  color: var(--color-link);
  font-weight: 600;
}

.search-option-label { flex: 1; min-width: 0; }
.search-option-kind { color: var(--color-muted); font-size: 0.75rem; font-weight: 400; }
.search-status, .search-footer { margin: 0; color: var(--color-muted); font-size: 0.8125rem; }

/* ---------- Buttons ---------- */

.button {
  min-height: 40px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: #fff;
  background: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.button--primary:hover:not(:disabled) { color: #fff; background: var(--color-accent-hover); }
.button--primary:active:not(:disabled) { background: var(--color-accent-active); }

.button--secondary {
  color: var(--color-text);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.button--secondary:hover:not(:disabled) {
  color: var(--color-text);
  background: var(--color-ground);
  border-color: var(--color-control-border);
}

.button--ghost { color: var(--color-muted); background: transparent; }
.button--ghost:hover:not(:disabled) { color: var(--color-text); background: var(--color-ground); }

.button--danger { background: var(--color-danger-fill); }
.button--danger:hover:not(:disabled) { background: var(--color-danger-hover); }
.button--danger:active:not(:disabled) { background: var(--color-danger-active); }

.button--secondary:active:not(:disabled),
.button--ghost:active:not(:disabled) { background: var(--color-border); }

.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button[aria-busy='true'] { cursor: wait; }

.icon-button { flex-shrink: 0; width: 40px; padding: 8px; }

/* ---------- Fields ---------- */

.field { display: grid; align-content: start; gap: 5px; min-width: 0; }

.field > label,
.field-label {
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

input:not([type='checkbox'], [type='radio']),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

input::placeholder, textarea::placeholder { color: var(--color-muted); opacity: 1; }

input:not([type='checkbox'], [type='radio']):hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) { border-color: var(--color-muted); }

input:not([type='checkbox'], [type='radio']):focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft-hover);
}

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

input:disabled, select:disabled, textarea:disabled {
  color: var(--color-muted);
  background: var(--color-ground);
  cursor: not-allowed;
}

.field-hint, .field-error, .validation-message { font-size: 0.75rem; line-height: 1.5; }
.field-hint { color: var(--color-muted); }
.field-hint--warning { color: var(--color-danger); }
.field-error, .validation-message { color: var(--color-danger); }

.checkbox-label { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }

input[type='checkbox'], input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
.form-wide { grid-column: 1 / -1; }

.field--xs > input, .field--xs > select { max-width: 8rem; }
.field--sm > input, .field--sm > select { max-width: 14rem; }
.field--md > input, .field--md > select { max-width: 22rem; }

.field:has(> [required]) > label::after,
.field--required > label::after {
  content: '*';
  content: '*' / '';
  margin-left: 3px;
  color: var(--color-muted);
}

/* ---------- Page header, panels, alerts ---------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.page-header p { max-width: 70ch; margin-top: 4px; color: var(--color-muted); font-size: 0.875rem; }

.count-chip {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  vertical-align: 0.25em;
}

/* A list's view from a home page tile (?view=): what the list is narrowed to, removable. */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 600;
}

.filter-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.filter-chip-remove:hover,
.filter-chip-remove:focus-visible { background: var(--color-border); color: var(--color-text); }

.panel {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.info-note {
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-accent-soft);
  font-size: 0.8125rem;
}

.form-alert {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-control);
  color: var(--color-danger);
  font-weight: 500;
}

.form-alert ul { margin: 0; padding-left: 1.1rem; font-weight: 400; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-hover);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--enabled,
.badge--danger {
  border-color: color-mix(in srgb, currentColor 28%, transparent);
  background: color-mix(in srgb, currentColor 10%, transparent);
}

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

.badge--enabled { color: var(--color-success); }
.badge--disabled { color: var(--color-muted); background: transparent; }
.badge--danger { color: var(--color-danger); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--color-muted); }

/* A drill-down on a value (BC: click an amount to see the entries behind it). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { text-decoration-color: currentColor; }
.link-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- Lists ---------- */

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
  align-items: start;
  gap: 16px;
}

.filter-bar.filter-bar--short { grid-template-columns: minmax(220px, 420px) auto; align-items: end; justify-content: start; }

/* A list page is one surface: the filters are the header of the table below. */
.filter-bar:has(+ .table-panel) {
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-bottom: 0;
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  background: var(--color-surface);
}

.filter-bar + .table-panel { border-radius: 0 0 var(--radius-panel) var(--radius-panel); }

.search-field { position: relative; }
.search-field > svg { position: absolute; top: 50%; left: 12px; color: var(--color-muted); transform: translateY(-50%); pointer-events: none; }
.search-field > input { padding-left: 36px; }

.table-panel {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.table-scroll { position: relative; max-width: 100%; overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

th, td { padding: 11px 16px; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 20px; }

th {
  padding-block: 9px;
  background: var(--color-surface-hover);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

td { border-top: 1px solid var(--color-border); }
td .badge, td .button { overflow-wrap: normal; white-space: nowrap; }
tbody tr { transition: background-color 120ms ease-out; }
tbody tr:hover { background: var(--color-surface-hover); }

/* The first column holds the record's No.: the link into its card (28 px hit area, same row height). */
td:first-child > a { position: relative; font-weight: 600; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
td:first-child > a::after { content: ''; position: absolute; inset: -6px 0; min-height: 28px; }
td:first-child > a:hover { text-decoration-color: currentColor; }

th.num, td.num { text-align: right; }

/*
 * QuickGrid ships its own cell padding and a black SVG sort triangle with higher specificity;
 * these rules restore the table tokens (padding, colours that follow light/dark).
 */
.table-panel table > thead > tr > th,
.table-panel table > tbody > tr > td { padding: 11px 16px; }

.table-panel table > thead > tr > th { padding-block: 9px; font-family: inherit; font-size: 0.75rem; }

.table-panel table > thead > tr > th:first-child,
.table-panel table > tbody > tr > td:first-child { padding-left: 20px; }

.table-panel table > thead > tr > th:has(button.col-title) { padding-block: 4px; }

.table-panel th .col-header-content { display: flex; align-items: center; gap: 6px; }

.table-panel th button.col-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.table-panel th button.col-title:hover { color: var(--color-text); }

.table-panel th[aria-sort='ascending'] button.col-title,
.table-panel th[aria-sort='descending'] button.col-title { color: var(--color-link); }

.table-panel th .sort-indicator {
  display: inline-flex;
  justify-content: center;
  width: 12px;
  background-image: none !important;
  transform: none !important;
}

.table-panel th[aria-sort='ascending'] .sort-indicator::before { content: '↑'; }
.table-panel th[aria-sort='descending'] .sort-indicator::before { content: '↓'; }
.table-panel th .col-options-button { display: none; }

/* The No. link's 28 px hit area may reach past the last row; it must not add a vertical scrollbar. */
.table-scroll { overflow-y: hidden; }

/* QuickGrid pads a short last page with empty rows; the table ends with the data. */
.table-panel table > tbody > tr:not(:has(> td:not(:empty))) { display: none; }

.table-status { padding: 16px 20px; color: var(--color-muted); font-size: 0.875rem; border-top: 1px solid var(--color-border); }

.skeleton {
  display: block;
  width: 75%;
  height: 16px;
  border-radius: 4px;
  background: var(--color-skeleton);
  animation: skeleton-pulse 1.6s ease-in-out infinite alternate;
}

.empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.empty-state > svg { color: var(--color-muted); }
.panel > .empty-state { border-top: 0; }
.error-state > svg { color: var(--color-danger); }
.empty-state p, .error-state p { max-width: 60ch; color: var(--color-muted); }
.empty-state .button, .error-state .button { margin-top: 8px; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 12px; }
.pagination-summary { color: var(--color-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.pagination-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pagination-buttons .icon-button { width: 36px; min-height: 36px; padding: 0; }

.pagination-page {
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.pagination-page[aria-current='page'] {
  border-color: var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.pagination-gap { min-width: 24px; color: var(--color-muted); text-align: center; }

/* ---------- Cards (record sheets) ---------- */

.record-header { margin-bottom: 20px; }

.record-identity { display: flex; align-items: center; gap: 16px; }
.record-heading { min-width: 0; }

.record-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid color-mix(in srgb, var(--color-accent) 22%, transparent);
  border-radius: var(--radius-panel);
  background: var(--color-accent-soft);
  color: var(--color-link);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.8125rem;
}

.record-eyebrow {
  margin-bottom: 4px;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.record-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

.record-no {
  display: inline-block;
  margin-right: 10px;
  padding: 1px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-navigation);
  background: var(--color-surface);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: 0.2em;
}

.record-subtitle { margin-top: 4px; color: var(--color-muted); font-size: 0.875rem; }

/* One prominent action per card; the bar stays below the chrome while scrolling. */
.card-actions {
  position: sticky;
  top: calc(var(--chrome-offset) + 12px);
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.card-actions .button--danger {
  color: var(--color-danger);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.card-actions .button--danger:hover:not(:disabled) {
  color: #fff;
  border-color: var(--color-danger-fill);
  background: var(--color-danger-fill);
}

.card-actions-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--color-danger); font-weight: 600; }

/* FastTabs stack into a single sheet with full-width heading rows. */
.card-section { position: relative; margin-bottom: 16px; padding: 20px; }

.card-section > h2 {
  display: flex;
  align-items: center;
  min-height: 52px;
  margin: -20px -20px 20px;
  padding: 6px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-section > h2 .button {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  padding-inline: 14px;
  border-radius: calc(var(--radius-panel) - 6px);
  color: var(--color-text);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.card-section > h2 .button > svg { color: var(--color-muted); }
.card-section-title { flex: 1; min-width: 0; text-align: left; }
.card-section-chevron { transition: transform 160ms ease-out; }
.card-section > h2 .button[aria-expanded='false'] .card-section-chevron { transform: rotate(-90deg); }
.card-section > h2:has(~ [hidden]) { margin-bottom: -20px; border-bottom-color: transparent; }


.fasttab-summary {
  position: absolute;
  top: 6px;
  right: 52px;
  left: 45%;
  margin: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 40px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.section-description { margin: -4px 0 16px; color: var(--color-muted); font-size: 0.8125rem; max-width: 75ch; }

/* A card the user may only read shows its values as text, not as dimmed fields. */
.card-section input:read-only:not([type='checkbox'], [type='radio'], :disabled),
.card-section textarea:read-only:not(:disabled) {
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
}

.field-value { display: block; padding: 9px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- Description editor (paragraphs, headings, bullet lists) ---------- */

.description-editor {
  display: grid;
  min-width: 0;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

.description-editor:hover { border-color: var(--color-muted); }

.description-editor:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft-hover);
}

.description-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-bottom: 1px solid var(--color-border);
}

.description-editor__tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius-navigation);
  color: var(--color-muted);
  background: transparent;
  font-size: 0.8125rem;
  cursor: pointer;
}

.description-editor__tool:hover { color: var(--color-text); background: var(--color-ground); }
.description-editor__tool:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }

.description-editor__tool[aria-pressed='true'] {
  color: var(--color-text);
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.description-editor__area {
  min-height: 16rem;
  max-height: 36rem;
  overflow-y: auto;
  padding: 9px 12px;
  outline: none;
  overflow-wrap: anywhere;
  caret-color: var(--color-accent);
}

.description-editor__area:empty::before {
  content: attr(data-placeholder);
  color: var(--color-muted);
  pointer-events: none;
}

.description-editor__count {
  padding: 0 12px 6px;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.description-editor__count.is-over { color: var(--color-danger); font-weight: 600; }

.description-view { padding: 9px 0; overflow-wrap: anywhere; }
.description-view > .field-value { padding: 0; }

.description-editor__area > :first-child,
.description-view > :first-child { margin-top: 0; }

.description-editor__area > :last-child,
.description-view > :last-child { margin-bottom: 0; }

.description-editor__area p,
.description-view p { margin: 0 0 0.75em; line-height: 1.55; }

.description-editor__area :is(h1, h2, h3, h4, h5, h6),
.description-view h2 { margin: 1.1em 0 0.45em; font-size: 1rem; font-weight: 650; line-height: 1.35; }

.description-editor__area :is(ul, ol),
.description-view ul { margin: 0 0 0.75em; padding-left: 1.5em; line-height: 1.55; }

.description-editor__area li + li,
.description-view li + li { margin-top: 0.2em; }

@media (max-width: 599px) {
  .description-editor__tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .description-editor__tool { min-width: 40px; min-height: 40px; justify-content: center; }
}

@media (min-width: 900px) {
  /* Label beside the value, as on a Business Central card. */
  .card-section .form-grid { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }

  .card-section .form-grid .field:not(:has(> .checkbox-label)) {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 4px;
  }

  .card-section .form-grid .field:not(:has(> .checkbox-label)) > label {
    align-self: start;
    padding-top: 10px;
    font-weight: 500;
    color: var(--color-muted);
  }

  .card-section .form-grid .field:not(:has(> .checkbox-label)) > :not(label) { grid-column: 2; }
}

@media (min-width: 1200px) {
  .card-section .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
}

/* Parts inside a card (lines, assignments). */
.part-table { min-width: 0; }
.part-table th:first-child, .part-table td:first-child { padding-left: 16px; }
.part-table td { vertical-align: middle; }
.part-table th.flag, .part-table td.flag { width: 44px; text-align: center; padding-inline: 8px; }
/* Code pickers on document lines (unit of measure, VAT): wide enough to show the chosen code. */
.part-table select.line-input { min-width: 7.5rem; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; width: 100%; }

.part-add {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-top: 16px;
}

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }

.inline-form { display: flex; gap: 12px; align-items: start; }
.inline-form input { flex: 1; }

/* ---------- Home (launcher) ---------- */

.welcome-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  align-items: start;
  gap: 16px;
}

.module-group { min-width: 0; padding: 16px; }
.module-group:has(.module-card:nth-child(3)) { grid-column: 1 / -1; }

.module-group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding-inline: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.module-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-ground);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.module-card:hover, .module-card:focus-visible {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.module-card-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-accent);
}

.module-card-text { flex: 1; min-width: 0; display: grid; gap: 2px; }

.module-card-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-link);
}

.module-card-description { color: var(--color-muted); font-size: 0.8125rem; }
.module-card-arrow { color: var(--color-muted); transition: transform 160ms ease-out, color 160ms ease-out; }
.module-card:hover .module-card-arrow { color: var(--color-link); transform: translateX(2px); }

/* ---------- Dialogs, drawer, toast ---------- */

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--color-backdrop);
  animation: overlay-in 180ms ease-out;
}

.modal {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
}

.modal-heading { padding: 24px 24px 0; }
.modal-body { padding: 16px 24px 24px; }
.modal-body p { color: var(--color-muted); }

.modal--error .modal-heading h2 { display: flex; align-items: center; gap: 10px; color: var(--color-danger); }
.modal--error .error-dialog-message { color: var(--color-text); }
.modal--error .error-dialog-list { margin: 8px 0 0; padding-left: 1.1rem; color: var(--color-muted); }

/* OptionDialog: which variant of an action to run (BC "StrMenu"). */
.option-list { display: grid; gap: 8px; }
.modal-body p + .option-list { margin-top: 16px; }
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.option-item:hover { background: var(--color-surface-hover); }
.option-item--selected,
.option-item--selected:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.option-item input[type='radio'] { margin-top: 2px; }
.option-item-text { display: grid; gap: 2px; }
.option-item-label { font-weight: 600; color: var(--color-text); }
.option-item-description { color: var(--color-muted); }

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

.mobile-sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: min(260px, calc(100% - 32px));
  background: var(--color-surface);
  overflow-y: auto;
  animation: sidebar-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-sidebar-heading {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid var(--color-border);
}

.mobile-section + .mobile-section { border-top: 1px solid var(--color-border); }

.mobile-section-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-navigation);
  background: transparent;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
}

.mobile-section-toggle > svg:last-child { margin-left: auto; color: var(--color-muted); }

.toast-viewport {
  position: fixed;
  z-index: 60;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(400px, calc(100% - 32px));
  margin: 0;
  padding: 0;
  list-style: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: var(--shadow-toast);
  overflow-wrap: anywhere;
}

.toast > svg { margin-top: 2px; color: var(--color-success); }
.toast > div { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; }
.toast .icon-button { width: 44px; margin: -8px -8px -8px 0; }

/* ---------- Sign-in ---------- */

/*
 * Split screen (21st.dev "Split Sign In Form"): the form on the ground colour, beside it the showcase in deep brand
 * blue with the company's own documents drawn on it. Below 1024 px only the form.
 */
.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }

.auth-form-side { display: flex; flex-direction: column; min-height: 100dvh; min-width: 0; }

.auth-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
}

.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px clamp(48px, 10vh, 112px);
}

.auth-panel { width: min(100%, 380px); }

.auth-panel h1 { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.03em; }
.auth-description { margin: 8px 0 28px; color: var(--color-muted); font-size: 0.875rem; }
.auth-form { display: grid; gap: 16px; }
.auth-form .button { width: 100%; margin-top: 4px; }

.auth-form [role='alert'] {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--color-danger) 40%, transparent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
  color: var(--color-danger);
}

/* Password with the show / hide button inside the field (js/password-toggle.js). */
.password-input { position: relative; }
.password-input > input { padding-right: 44px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius-control) - 2px);
  background: transparent;
  color: var(--color-muted);
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle:hover { color: var(--color-text); background: var(--color-ground); }
.password-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.password-toggle .password-toggle-hide,
.password-toggle[aria-pressed='true'] .password-toggle-show { display: none; }
.password-toggle[aria-pressed='true'] .password-toggle-hide { display: block; }

.auth-remember { align-items: flex-start; min-height: 0; padding-top: 2px; }
.auth-remember input { margin-top: 2px; }
.auth-remember .field-hint { display: block; }

.auth-showcase { display: none; }

@media (min-width: 1024px) {
  .auth-layout { grid-template-columns: minmax(440px, 1fr) minmax(0, 1.15fr); }

  .auth-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    min-height: 100dvh;
    padding: clamp(40px, 6vw, 72px);
    overflow: hidden;
    color: var(--color-on-brand);
    /* A ledger grid fading from the top-right corner: the squared paper accounts are kept on. */
    background:
      radial-gradient(120% 90% at 100% 0%, transparent 35%, var(--color-brand-deeper) 100%),
      repeating-linear-gradient(0deg, color-mix(in srgb, var(--color-on-brand) 7%, transparent) 0 1px, transparent 1px 32px),
      repeating-linear-gradient(90deg, color-mix(in srgb, var(--color-on-brand) 7%, transparent) 0 1px, transparent 1px 32px),
      var(--color-brand-deep);
  }
}

.auth-showcase-copy { position: relative; max-width: 30rem; }

.auth-showcase-eyebrow {
  margin-bottom: 16px;
  color: var(--color-on-brand-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-showcase-title {
  max-width: 21ch;
  font-size: clamp(1.875rem, 2.8vw, 2.625rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.auth-showcase-facts { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.auth-showcase-facts li { display: flex; align-items: flex-start; gap: 10px; color: var(--color-on-brand-muted); font-size: 0.9375rem; }
.auth-showcase-facts svg { flex: none; margin-top: 3px; color: var(--color-on-brand); }

/*
 * The signature: an order, its shipment and the KSeF invoice, fanned out like papers on a desk.
 * They slide apart once on load (not with reduced motion).
 */
.doc-stack { position: relative; align-self: center; width: min(100%, 440px); height: 320px; }

.doc-sheet {
  position: absolute;
  inset: auto 0 0 auto;
  display: grid;
  align-content: start;
  gap: 10px;
  width: 300px;
  padding: 18px 20px;
  border-radius: var(--radius-panel);
  background: var(--color-paper);
  color: var(--color-paper-ink);
  box-shadow: var(--shadow-sheet);
  font-size: 0.8125rem;
  transform-origin: bottom right;
  animation: doc-fan 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.doc-sheet--back,
.doc-sheet--middle { height: 140px; background: color-mix(in srgb, var(--color-paper) 82%, var(--color-brand-deep)); }
.doc-sheet--back { --doc-to: translate(-140px, -170px) rotate(-6deg); animation-delay: 80ms; }
.doc-sheet--middle { --doc-to: translate(-70px, -88px) rotate(-2.5deg); animation-delay: 160ms; }
.doc-sheet--front { --doc-to: translate(0, 0) rotate(1.5deg); width: 320px; animation-delay: 240ms; }

@keyframes doc-fan {
  from { opacity: 0; transform: translate(0, 24px) rotate(0); }
  to { transform: var(--doc-to); }
}

.doc-sheet--back, .doc-sheet--middle, .doc-sheet--front { transform: var(--doc-to); }

.doc-head { display: flex; align-items: center; gap: 10px; }

.doc-type {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--color-brand-deep);
  color: var(--color-on-brand);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  justify-self: start;
}

.doc-no { font-family: var(--font-mono); font-weight: 600; }

.doc-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-paper-ok) 12%, transparent);
  color: var(--color-paper-ok);
  font-size: 0.6875rem;
  font-weight: 700;
}

.doc-line { display: block; height: 8px; border-radius: 4px; background: var(--color-paper-line); }
.doc-line--short { width: 60%; }

.doc-rows { display: grid; gap: 6px; margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--color-paper-line); }
.doc-rows div { display: flex; justify-content: space-between; gap: 12px; }
.doc-rows dt { color: var(--color-paper-muted); }
.doc-rows dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.doc-total {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--color-paper-line);
  font-variant-numeric: tabular-nums;
}

.doc-total strong { font-family: var(--font-mono); font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  .doc-sheet { animation: none; }
}

/* ---------- Blazor runtime ---------- */

#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-danger);
  box-shadow: var(--shadow-toast);
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }

.blazor-error-boundary {
  padding: 12px 16px;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-control);
  color: var(--color-danger);
}

.blazor-error-boundary::after { content: 'Nie udało się wyświetlić tej części strony.'; }

/* ---------- Motion ---------- */

@keyframes skeleton-pulse { to { opacity: 0.45; } }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sidebar-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */

@media (min-width: 600px) and (max-width: 1023px) {
  .company-switcher label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .topbar-actions, .account-actions { gap: 8px; }
  .company-switcher select { max-width: 150px; }
}

@media (max-width: 899px) {
  .button, .nav-link, input:not([type='checkbox'], [type='radio']), select { min-height: 44px; }
  .icon-button { width: 44px; }
  .sidebar, .module-bar, .topbar .brand { display: none; }
  .menu-trigger { display: inline-flex !important; }
  .topbar { height: 60px; padding-inline: 16px; }
  .topbar-start { flex: 1 1 0; min-width: 44px; }
  .topbar-title { display: block; }
  .tell-me-trigger { flex: 0 1 240px; min-height: 44px; }
  .page-content { padding: 24px 24px 40px; }
  .app-shell { --chrome-offset: 60px; }
  .account-name { display: none; }
  .language-switcher a { min-height: 44px; min-width: 40px; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  .topbar { gap: 8px; padding-inline: 12px; }
  .tell-me-trigger { flex: 0 0 44px; width: 44px; justify-content: center; padding: 0; }
  .tell-me-placeholder, .tell-me-shortcut { display: none; }

  .search-dialog {
    inset: 0;
    top: 0;
    transform: none;
    width: 100%;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
  }

  .search-footer { display: none; }
  .company-switcher label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .topbar-actions { flex-shrink: 1; gap: 4px; }
  .company-switcher { flex: 0 1 auto; min-width: 0; }
  .company-switcher select { width: 100%; min-width: 0; max-width: 120px; padding-inline: 8px; }
  .account-actions { flex-shrink: 0; gap: 4px; }
  .page-content { padding: 20px 16px 32px; }
  h1 { font-size: 1.25rem; }
  .page-header { flex-direction: column; }
  .module-group { padding: 12px; }
  .form-grid, .filter-bar, .part-add { grid-template-columns: 1fr; }
  .empty-state, .error-state { padding: 32px 16px; }
  .pagination { justify-content: space-between; flex-wrap: wrap; }
  .fasttab-summary { left: 55%; }
  .toast-viewport { right: 16px; bottom: 16px; }
}

/* Amounts, rates and counts: right-aligned with tabular figures, in tables and inputs. */
.numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* Way back to the record above a related list (e.g. item ledger entries). */
.back-row { margin: 0 0 8px; }

/* Stocktake sheet: counted quantity typed straight into the line. */
.counted-input { width: 8rem; }

/* Dialogs with a table inside (e.g. import errors). */
.modal.modal--wide { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto; }

/* ---------- Lookup (BC field lookup: type a code or pick it from a table) ---------- */

.lookup { position: relative; min-width: 0; }
.lookup-control { position: relative; display: flex; }
.lookup-control input { width: 100%; padding-right: 36px; }
.lookup-toggle {
  position: absolute;
  inset: 1px 1px 1px auto;
  display: grid;
  place-items: center;
  width: 32px;
  border: 0;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}
.lookup-toggle:hover:not(:disabled) { color: var(--color-text); background: var(--color-surface-hover); }

/* Fixed and placed by lookup.js beside the input, so a scrolling table cannot clip it. */
.lookup-panel {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: max-content;
  max-width: min(44rem, calc(100vw - 32px));
  max-height: 20rem;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
  animation: overlay-in 120ms ease-out;
}
.lookup-panel table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.lookup-panel th {
  position: sticky;
  top: 0;
  padding: 8px 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.lookup-panel td { padding: 7px 12px; white-space: nowrap; cursor: pointer; }
.lookup-panel th.numeric, .lookup-panel td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.lookup-panel tr.is-current td { font-weight: 600; }
.lookup-panel tr.is-active td { background: var(--color-selection); }
.lookup-panel:not([data-placed]) { visibility: hidden; }
.lookup-empty { margin: 0; padding: 10px 12px; color: var(--color-muted); font-size: 0.8125rem; }

/* Lookups inside a lines table: room for a code next to the list button. */
.part-table td .lookup { min-width: 9rem; }
.part-table tr.new-line input.line-input, .part-table tr.new-line select.line-input { min-width: 6rem; }
.part-table td.line-description { min-width: 12rem; }

/* Lines edit in place (BC grid): cells read as text; a field shows its border on row hover and when focused. */
.part-table td input:not([type='checkbox'], [type='radio']),
.part-table td select {
  min-height: 34px;
  padding: 6px 8px;
  border-color: transparent;
  background-color: transparent;
}
.part-table td select { appearance: none; }
.part-table tr:hover td input:not([type='checkbox'], [type='radio']),
.part-table tr:hover td select { border-color: var(--color-border); background-color: var(--color-surface); }
.part-table tr:hover td select, .part-table td select:focus-visible { appearance: auto; }
.part-table td input:not([type='checkbox'], [type='radio']):focus-visible,
.part-table td select:focus-visible { border-color: var(--color-accent); background-color: var(--color-surface); }
.part-table td input[type='number'] { -moz-appearance: textfield; }
.part-table td input[type='number']::-webkit-inner-spin-button,
.part-table td input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.part-table tr:not(:hover) .lookup:not(:focus-within) .lookup-toggle { opacity: 0; }
.part-table tr.new-line td { background: transparent; }
.part-table tr.new-line input::placeholder { color: var(--color-muted); font-style: italic; }

/* Document totals under the lines (BC: Total Excl. VAT / Total VAT / Total Incl. VAT). */
.document-totals {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 6px 32px;
  margin: 16px 0 0;
  font-variant-numeric: tabular-nums;
}
.document-totals dt { color: var(--color-muted); }
.document-totals dd { margin: 0; text-align: right; }
.document-totals .is-grand { padding-top: 6px; border-top: 1px solid var(--color-border); font-weight: 600; color: var(--color-text); }
.part-table td.line-description input { min-width: 12rem; }

/* Payment journal: the vendor with the account it is paid to on its own line, never broken. */
.part-table td.payee { min-width: 16rem; }
.payee-account { display: block; white-space: nowrap; font-size: 0.85em; }

/* Sales credit memo configurator: each invoice line as two rows, "before" (muted, read-only) above "after" (editable). */
.cm-help { margin: 0 0 12px; }
.cm-table tbody.cm-line + tbody.cm-line tr:first-child > * { border-top: 2px solid var(--color-border); }
.cm-table .cm-before td, .cm-table .cm-before th { color: var(--color-muted); border-bottom: 0; }
.cm-table .cm-before td[rowspan] { color: var(--color-text); vertical-align: top; }
.cm-table th.cm-state {
  width: 4.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--color-muted);
}
.cm-table .cm-line--changed .cm-after > *, .cm-table .cm-line--changed td.cm-difference { background: var(--color-accent-soft); }
.cm-table .cm-line--changed .cm-after th.cm-state { color: var(--color-link); }
.cm-table td.cm-difference { vertical-align: middle; white-space: nowrap; }
.cm-table .cm-quantity { display: block; }
.cm-table input.cm-input--changed { border-color: var(--color-accent); font-weight: 600; }
.cm-rates { margin-top: 12px; }
.cm-rates caption { text-align: left; padding: 8px 16px; }
tr.cm-total th, tr.cm-total td { font-weight: 600; }

/* Report layouts: one section per report, with Word instructions above. */
.layout-help { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); }
.layout-help summary { cursor: pointer; font-weight: 600; }
.layout-help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }
.layout-report { margin-bottom: 16px; }
.layout-report-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.layout-report-header h2 { margin: 0; font-size: 1rem; }
.layout-report-header p { margin: 2px 0 0; }

/* Integration catalog (BC Extension Management): one card per integration, installed or not. */
.integration-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.integration-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.integration-card-header { display: flex; align-items: center; gap: 12px; }
.integration-card-title { flex: 1; min-width: 0; }
.integration-card-title h2 { margin: 0; font-size: 1rem; }
.integration-card-description { margin: 0; color: var(--color-muted); font-size: 0.875rem; flex: 1; }
.integration-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The catalog's search: filters the cards as the user types. */
.filter-bar.filter-bar--catalog {
  grid-template-columns: minmax(220px, 420px) minmax(160px, 220px) auto;
  align-items: end;
  justify-content: start;
  margin-bottom: 8px;
}

.catalog-count { margin: 0 0 12px; color: var(--color-muted); font-size: 0.8125rem; }

@media (max-width: 640px) {
  .filter-bar.filter-bar--catalog { grid-template-columns: 1fr; }
}

/*
 * Mobile warehouse view (/m): one column for a phone or a scanner terminal. Touch targets are at least
 * 48 px (gloves, one hand); the scan field and the main action stay within thumb reach.
 */
.mobile-shell {
  min-height: 100dvh;
  background: var(--color-ground);
}

.mobile-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 12px calc(96px + env(safe-area-inset-bottom));
}

.mobile-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.mobile-bar-back {
  display: inline-flex;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-control);
  color: var(--color-text);
}

.mobile-bar-back:hover { background: var(--color-surface-hover); }
.mobile-bar-title { flex: 1; min-width: 0; }
.mobile-bar-title h1 { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.mobile-bar-title p { margin: 0; overflow: hidden; color: var(--color-muted); font-size: 0.8125rem; text-overflow: ellipsis; white-space: nowrap; }
.mobile-bar-actions { display: flex; gap: 4px; }

.mobile-section-title { margin: 8px 4px 0; color: var(--color-muted); font-size: 0.8125rem; font-weight: 600; }
.mobile-empty { margin: 16px 4px; color: var(--color-muted); font-size: 0.875rem; }

.mobile-icon-button { min-width: 48px; min-height: 48px; padding: 0 12px; }
.mobile-wide-button { width: 100%; min-height: 52px; font-size: 1rem; }

/* Scan field: large, always first on the page. */
.scan-form { display: flex; gap: 8px; }

.scan-field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 12px;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  color: var(--color-muted);
  background: var(--color-surface);
}

.scan-field:focus-within { border-color: var(--color-accent); outline: 2px solid var(--color-accent); outline-offset: -1px; }
.scan-field input:not([type='checkbox'], [type='radio']) {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
}

/* Tiles on the warehouse home. */
.mobile-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.mobile-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mobile-tile svg { color: var(--color-accent); }
.mobile-tile:hover { background: var(--color-surface-hover); }
.mobile-tile:active { background: var(--color-accent-soft); }
.mobile-tile-title { font-size: 1rem; font-weight: 700; }
.mobile-tile-text { color: var(--color-muted); font-size: 0.8125rem; line-height: 1.35; }
.mobile-tile.is-unavailable { opacity: 0.6; }
.mobile-tile.is-unavailable svg { color: var(--color-muted); }

/* Lists: one row per item, order or line; the whole row is tappable. */
.mobile-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  list-style: none;
}

.mobile-list > li + li { border-top: 1px solid var(--color-border); }

.mobile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border: 0;
  color: var(--color-text);
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

a.mobile-row:hover, button.mobile-row:hover { background: var(--color-surface-hover); }
button.mobile-row { cursor: pointer; }
.mobile-row > svg { flex: none; color: var(--color-muted); }
.mobile-row.is-current { background: var(--color-accent-soft); }
.mobile-row-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.mobile-row-title { overflow: hidden; font-size: 0.875rem; font-weight: 600; text-overflow: ellipsis; }
.mobile-row-sub { color: var(--color-muted); font-size: 0.75rem; }
.mobile-row-figure { flex: none; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mobile-row-figure small, .mobile-figure small { color: var(--color-muted); font-size: 0.75rem; font-weight: 400; }

/* An order line being counted: green when complete, red when more than ordered. */
.mobile-pick.is-done .mobile-row-figure { color: var(--color-success); }
.mobile-pick.is-over .mobile-row-figure { color: var(--color-danger); }
.mobile-pick.is-open { background: var(--color-surface-hover); }
.mobile-pick-editor { display: grid; gap: 8px; padding: 0 14px 14px; }

.quantity-input { display: flex; gap: 8px; }
.quantity-input input:not([type='checkbox'], [type='radio']) {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.mobile-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
}

.mobile-card .mobile-section-title { margin: 0; }
.mobile-current { border-color: var(--color-accent); }
.mobile-current-title { margin: 0; font-size: 1rem; font-weight: 700; }
.mobile-current .mobile-row-sub { margin: -10px 0 0; }
.mobile-two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mobile-done { justify-items: center; text-align: center; }
.mobile-done > svg { color: var(--color-success); }
.mobile-done p { margin: 0; font-size: 1rem; }

.mobile-facts { display: grid; gap: 10px; margin: 0; }
.mobile-facts div { display: flex; justify-content: space-between; gap: 12px; }
.mobile-facts dt { color: var(--color-muted); font-size: 0.875rem; }
.mobile-facts dd { margin: 0; font-size: 0.875rem; text-align: right; }
.mobile-figure { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.mobile-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

/* RW / PW choice as a two-part switch. */
.mobile-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
}

.mobile-segmented legend { margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; }
.mobile-segmented label {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.mobile-segmented label + label { border-left: 1px solid var(--color-control-border); }
.mobile-segmented label.is-selected { color: #fff; background: var(--color-accent); }
.mobile-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.mobile-segmented label:focus-within { outline: 2px solid var(--color-accent); outline-offset: -3px; }

/* The main action sits at the bottom of the screen, above the home indicator. */
.mobile-footer-actions {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.mobile-footer-actions > * { display: flex; max-width: 616px; margin: 0 auto; }

.mobile-account {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 4px;
  border-top: 1px solid var(--color-border);
}

.mobile-account-user { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--color-muted); font-size: 0.875rem; }

/* Camera scanning (BarcodeDetector). */
.camera-overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #000;
}

.camera-video { width: 100%; height: 100%; object-fit: cover; }

.camera-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(80vw, 360px);
  height: 160px;
  border: 3px solid #fff;
  border-radius: var(--radius-panel);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 45%);
}

.camera-hint { position: absolute; top: calc(24px + env(safe-area-inset-top)); margin: 0; color: #fff; font-size: 1rem; }
.camera-close { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); min-height: 52px; }

/* Toasts sit above the bottom action bar. */
.mobile-shell .toast-viewport { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; }

@media (max-width: 360px) {
  .mobile-tiles { grid-template-columns: 1fr; }
  .mobile-two-fields { grid-template-columns: 1fr; }
}

/* Licence: trial notice above every page, module list on the licence page */
.license-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.license-note a { font-weight: 600; }
.license-note.is-expired { border-color: var(--color-danger); color: var(--color-danger); background: transparent; }
.license-modules { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0 0 12px; padding: 0; }
.license-modules li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-control); }
.license-modules li.is-licensed { color: var(--color-success); }
.license-modules li.is-licensed span { color: var(--color-text, inherit); }
.license-modules li.is-missing { color: var(--color-muted); border-style: dashed; }

/* Item photos on the item card (product content): thumbnails in their order, the first is the main photo. */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.photo-tile { margin: 0; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); overflow: hidden; display: flex; flex-direction: column; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--color-ground); display: block; }
.photo-tile__meta { padding: 6px 8px 0; font-size: 0.8125rem; color: var(--color-muted); overflow-wrap: anywhere; }
.photo-tile__actions { display: flex; gap: 2px; padding: 4px; justify-content: flex-end; }
.inline-fields { display: flex; gap: 8px; }
.inline-fields input { min-width: 0; flex: 1; max-width: 120px; }

/* ===== Packing station view (/p): a dark bar, then one wide working area with large type and buttons ===== */
.packing-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-ground); }
.packing-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 24px;
  background: #111827; color: #f9fafb;
}
.packing-bar .button--ghost { color: #f9fafb; }
.packing-bar .button--ghost:hover { background: rgb(255 255 255 / 0.1); }
.packing-bar-title { display: inline-flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.01em; }
.packing-bar-station { opacity: 0.85; }
.packing-bar-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.packing-bar-actions form { margin: 0; }
.packing-main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px; display: grid; gap: 20px; align-content: start; }
.packing-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.packing-head .field { min-width: min(360px, 100%); margin: 0; }
.packing-title { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.packing-muted { color: var(--color-muted); font-size: 0.95rem; }
.packing-empty { padding: 32px; text-align: center; color: var(--color-muted); background: var(--color-surface); border: 1px dashed var(--color-border); border-radius: 12px; }
.packing-back { margin: 0; }
.packing-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.packing-order {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; min-height: 64px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
  color: inherit; text-decoration: none;
}
.packing-order:hover { background: var(--color-surface-hover); border-color: var(--color-control-border); }
.packing-order-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.packing-order-title { font-weight: 600; font-size: 1.1rem; }
.packing-shipping { font-weight: 600; color: var(--color-accent); }
.packing-facts { display: grid; grid-template-columns: repeat(2, minmax(160px, auto)); gap: 8px 24px; margin: 0; }
.packing-facts dt { color: var(--color-muted); font-size: 0.85rem; }
.packing-facts dd { margin: 0; font-size: 1.05rem; }
.packing-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.packing-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 20px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 6px solid var(--color-border); border-radius: 12px;
}
.packing-line.is-last { box-shadow: 0 0 0 2px var(--color-accent-soft-hover); }
.packing-line.is-done { border-left-color: #16a34a; }
.packing-line-main { display: grid; gap: 2px; min-width: 0; }
.packing-line-figure { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.packing-line-figure small { font-size: 0.9rem; font-weight: 400; color: var(--color-muted); }
.packing-line-actions { display: flex; gap: 8px; }
.packing-big-button { min-height: 56px; padding-inline: 28px; font-size: 1.1rem; display: inline-flex; align-items: center; gap: 10px; }
.packing-done {
  display: grid; justify-items: center; gap: 16px; padding: 40px 24px; text-align: center;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
}
.packing-done h1 { margin: 0; font-size: 1.6rem; }
.packing-done .packing-facts { text-align: left; }
@media (max-width: 700px) {
  .packing-main { padding: 16px; }
.packing-line { grid-template-columns: minmax(0, 1fr) auto; }
  .packing-line-actions { grid-column: 1 / -1; }
  .packing-big-button { flex: 1; justify-content: center; }
}

/* Packing: baskets as tiles; an order as details on the left, items on the right. */
.packing-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.packing-tile {
  display: grid; align-content: start; gap: 12px; padding: 16px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-top: 6px solid var(--color-accent); border-radius: 14px;
}
.packing-tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.packing-tile-code { font-size: 2rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1; }
.packing-tile-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.packing-tile-order {
  display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 10px;
  color: inherit; text-decoration: none; background: var(--color-ground);
}
.packing-tile-order:hover { border-color: var(--color-control-border); background: var(--color-surface-hover); }
.packing-workspace { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.packing-details {
  position: sticky; top: 16px; display: grid; gap: 12px; padding: 20px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px;
}
.packing-details p { margin: 0; }
.packing-shipping--large { font-size: 1.2rem; padding: 10px 12px; border-radius: 10px; background: var(--color-accent-soft); }
.packing-facts--stacked { grid-template-columns: 1fr; gap: 10px; }
.packing-progress { display: grid; gap: 6px; font-weight: 600; }
.packing-progress progress { width: 100%; height: 10px; accent-color: #16a34a; }
.packing-details-actions { display: grid; gap: 10px; }
.packing-details-actions .packing-big-button { justify-content: center; width: 100%; }
.packing-items { display: grid; gap: 12px; align-content: start; min-width: 0; }
.packing-items .field { margin: 0; }
@media (max-width: 900px) {
  .packing-workspace { grid-template-columns: 1fr; }
  .packing-details { position: static; }
}

/* Settings → E-mail: one block per e-mail template (subject, message, restore). */
.email-template {
  display: grid;
  gap: 12px;
  padding-block: 16px;
  border-top: 1px solid var(--color-border);
}

.email-template:first-child {
  border-top: 0;
  padding-top: 0;
}

.email-template h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.email-template textarea {
  width: 100%;
}

/* Bar chart (BarChart): thin bars from one baseline, rounded data end, hairline grid, tooltip per bar. */
.bar-chart-empty { color: var(--color-muted); font-size: 0.875rem; }

.bar-chart--columns { display: grid; gap: 6px; }

.bar-chart-plot { position: relative; height: 180px; margin-left: 44px; }

.bar-chart-gridline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--chart-grid);
}

.bar-chart-gridline--zero { border-top-color: var(--color-control-border); }

.bar-chart-gridline span {
  position: absolute;
  right: calc(100% + 8px);
  transform: translateY(-50%);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar-chart-columns { position: absolute; inset: 0; display: grid; }

.bar-chart-slot { position: relative; }

.bar-chart-slot .bar-chart-bar {
  position: absolute;
  left: 50%;
  width: min(24px, calc(100% - 4px));
  transform: translateX(-50%);
  border-radius: 4px 4px 0 0;
  background: var(--chart-bar);
}

.bar-chart-slot .bar-chart-bar--negative { border-radius: 0 0 4px 4px; }

.bar-chart-slot:hover .bar-chart-bar { filter: brightness(1.1); }

.bar-chart-tooltip {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 4px);
  left: 50%;
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
  color: var(--color-text);
  font-size: 0.8125rem;
  white-space: nowrap;
  pointer-events: none;
}

.bar-chart-tooltip span { color: var(--color-muted); }
.bar-chart-tooltip strong { font-variant-numeric: tabular-nums; }
.bar-chart-tooltip--left { left: auto; right: 50%; }

.bar-chart-labels {
  display: grid;
  margin-left: 44px;
  color: var(--color-muted);
  font-size: 0.75rem;
  text-align: center;
}

.bar-chart--horizontal { display: grid; gap: 10px; }

.bar-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
}

.bar-chart-row-label { overflow: hidden; color: var(--color-text); text-overflow: ellipsis; white-space: nowrap; }

.bar-chart-track { display: block; height: 16px; }

.bar-chart-row .bar-chart-bar {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--chart-bar);
}

.bar-chart-row-value { color: var(--color-text); font-variant-numeric: tabular-nums; text-align: right; }

/* Home page (Role Center): quick actions, tiles with counts, charts, recent cards; the areas below. */
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.home-actions .button { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }

.home-section { margin-bottom: 16px; }

.home-section-heading {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.home-cues {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-cue {
  display: grid;
  align-content: start;
  gap: 4px;
  height: 100%;
  min-height: 108px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-ground);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.home-cue:hover, .home-cue:focus-visible { background: var(--color-accent-soft); border-color: var(--color-accent); }

.home-cue-count { font-size: 1.75rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.home-cue-title { font-size: 0.875rem; font-weight: 600; }
.home-cue-module { display: inline-flex; align-items: center; gap: 4px; color: var(--color-muted); font-size: 0.75rem; }

/* Needs attention: a red edge, the count in red, and the words with an icon (never colour alone). */
.home-cue--warn { border-left: 4px solid var(--color-danger); }
.home-cue--warn .home-cue-count,
.home-cue--warn .home-cue-module { color: var(--color-danger); }

.home-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.home-chart { display: grid; align-content: start; gap: 8px; }
.home-chart-skeleton { display: block; height: 200px; }
.home-chart-unit { margin: 0; color: var(--color-muted); font-size: 0.75rem; }

.home-recent { display: grid; margin: 0; padding: 0; list-style: none; }
.home-recent li + li { border-top: 1px solid var(--color-border); }

.home-recent a {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 4px;
  color: var(--color-text);
  text-decoration: none;
}

.home-recent a:hover, .home-recent a:focus-visible { background: var(--color-surface-hover); }
.home-recent-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.home-recent-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-recent-kind { color: var(--color-muted); font-size: 0.8125rem; }

.home-areas-heading {
  margin: 8px 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

@media (max-width: 640px) {
  .home-recent a { grid-template-columns: 1fr; gap: 2px; }
}

/* Warehouse map: zones on a grid (SVG in cell units), a side panel with the selected zone. */
.segmented { display: inline-flex; border: 1px solid var(--color-control-border); border-radius: var(--radius-control); overflow: hidden; }

.segmented-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.segmented-option + .segmented-option { border-left: 1px solid var(--color-control-border); }
.segmented-option[aria-pressed="true"] { background: var(--color-accent-soft); color: var(--color-text); font-weight: 600; }
.segmented-option:disabled { color: var(--color-muted); cursor: not-allowed; }

.warehouse-map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: start;
}

.warehouse-map-main { display: grid; gap: 12px; }

.warehouse-map-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; }
.warehouse-map-find { min-width: 260px; margin: 0; }
.warehouse-map-found { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.875rem; }

.zone-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 0 auto; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--color-muted); }
.zone-legend li { display: inline-flex; align-items: center; }

.zone-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
  background: var(--zone-color);
  vertical-align: -1px;
}

.zone--receiving { --zone-color: var(--zone-receiving); }
.zone--storage { --zone-color: var(--zone-storage); }
.zone--shipping { --zone-color: var(--zone-shipping); }
.zone--transit { --zone-color: var(--zone-transit); }

.warehouse-map { width: 100%; height: auto; max-height: 70vh; touch-action: none; user-select: none; }
.warehouse-map-floor { fill: var(--color-ground); }
.warehouse-map-gridline { fill: none; stroke: var(--chart-grid); stroke-width: 0.03; }

.zone { cursor: pointer; outline: none; }
.warehouse-map--layout .zone { cursor: move; }

.zone .zone-body {
  fill: color-mix(in srgb, var(--zone-color) 14%, var(--color-surface));
  stroke: var(--zone-color);
  stroke-width: 0.08;
}

.zone:hover .zone-body { fill: color-mix(in srgb, var(--zone-color) 22%, var(--color-surface)); }
.zone:focus-visible .zone-body { stroke: var(--color-text); stroke-width: 0.14; }
.zone--selected .zone-body { stroke-width: 0.18; fill: color-mix(in srgb, var(--zone-color) 26%, var(--color-surface)); }
.zone--found .zone-body { stroke-width: 0.2; fill: color-mix(in srgb, var(--zone-color) 34%, var(--color-surface)); }
.zone--dim { opacity: 0.4; }
.zone--blocked .zone-body { stroke-dasharray: 0.25 0.15; }
.zone--drop .zone-body { stroke: var(--color-text); stroke-width: 0.22; fill: color-mix(in srgb, var(--zone-color) 40%, var(--color-surface)); }
.zone--dragging { opacity: 0.85; }

.zone .zone-fill { fill: var(--zone-color); }
.zone .zone-handle { fill: var(--zone-color); cursor: nwse-resize; }

.zone text { fill: var(--color-text); pointer-events: none; }
.zone .zone-code { font-size: 0.6px; font-weight: 700; font-family: var(--font-mono, ui-monospace, monospace); }
.zone .zone-name { font-size: 0.5px; }
.zone .zone-count { font-size: 0.45px; fill: var(--color-muted); }

.warehouse-map-panel { display: grid; align-content: start; gap: 12px; position: sticky; top: 16px; }
.warehouse-map-panel .field { margin: 0; }
.warehouse-map-zone-title { display: flex; align-items: center; gap: 4px; margin: 0; }
.warehouse-map-panel-actions { display: flex; gap: 8px; }
.warehouse-map-entries-link { margin: 4px 0 0; font-size: 0.875rem; }

.zone-meter { height: 8px; border-radius: var(--radius-pill); background: var(--color-ground); overflow: hidden; }
.zone-meter span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--color-accent); }

.zone-goods { display: grid; margin: 0; padding: 0; list-style: none; }
.zone-goods li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 0; }
.zone-goods li + li { border-top: 1px solid var(--color-border); }
.zone-goods-text { display: grid; min-width: 0; font-size: 0.875rem; }
.zone-goods-text span { overflow: hidden; color: var(--color-muted); text-overflow: ellipsis; white-space: nowrap; }
.zone-goods-qty { font-variant-numeric: tabular-nums; font-size: 0.875rem; white-space: nowrap; }

.goods-handle { padding: 4px 2px; color: var(--color-muted); cursor: grab; touch-action: none; user-select: none; }
.goods-handle:hover { color: var(--color-text); }

.goods-ghost {
  position: fixed;
  z-index: 50;
  padding: 6px 10px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: 0 6px 16px rgb(0 0 0 / 18%);
  color: var(--color-text);
  font-size: 0.8125rem;
  pointer-events: none;
}

.zone-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; gap: 12px; margin-top: 16px; }

@media (max-width: 960px) {
  .warehouse-map-wrap { grid-template-columns: 1fr; }
  .warehouse-map-panel { position: static; }
}

/* Nested zones: a zone with sub-zones is a lighter frame; goods lie in its sub-zones, drawn on top of it. */
.zone--container .zone-body { fill: color-mix(in srgb, var(--zone-color) 6%, var(--color-surface)); stroke-dasharray: none; }
.zone--container:hover .zone-body { fill: color-mix(in srgb, var(--zone-color) 10%, var(--color-surface)); }
.zone-indent { padding-left: calc(var(--depth, 0) * 16px); }
.zone-panel-subheading { margin: 4px 0 0; font-size: 0.8125rem; font-weight: 600; }
.zone-children { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.zone-children li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Mobile picking: where to take the goods from (zones). */
.mobile-row-hint { display: block; margin-top: 2px; color: var(--color-accent-active); font-size: 0.8125rem; font-weight: 600; }

/* Isometric (3D) warehouse map: a zone is a box (top lighter, sides darker), its height its fill level. */
.warehouse-map-view { display: flex; align-items: center; gap: 8px; }
.warehouse-map--iso { max-height: 75vh; }
.iso-floor { fill: var(--color-ground); stroke: var(--chart-grid); stroke-width: 0.04; }
.iso-gridline { stroke: var(--chart-grid); stroke-width: 0.02; }
.iso-box { cursor: pointer; }
.iso-face { stroke: color-mix(in srgb, var(--zone-color) 70%, var(--color-text)); stroke-width: 0.03; stroke-linejoin: round; }
.iso-face--top { fill: color-mix(in srgb, var(--zone-color) 30%, var(--color-surface)); }
.iso-face--east { fill: color-mix(in srgb, var(--zone-color) 62%, var(--color-text) 8%); }
.iso-face--south { fill: color-mix(in srgb, var(--zone-color) 78%, var(--color-text) 14%); }
.iso-box:hover .iso-face--top, .iso-box:focus-visible .iso-face--top { fill: color-mix(in srgb, var(--zone-color) 45%, var(--color-surface)); }
.iso-box.zone--selected .iso-face { stroke: var(--color-text); stroke-width: 0.07; }
.iso-box.zone--found .iso-face--top { fill: color-mix(in srgb, var(--zone-color) 60%, var(--color-surface)); }
.iso-box.zone--blocked .iso-face--top { fill: var(--color-ground); }
.iso-label { fill: var(--color-text); font-size: 0.42px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.iso-label--count { font-weight: 600; fill: var(--color-text); }

/* Zone labels: a sheet of labels (about 70 × 37 mm, three across on A4) with the zone code as a bar code. */
.zone-labels-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.zone-labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

.zone-label {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-left: 8px solid var(--zone-color);
  border-radius: var(--radius-control);
  background: #fff;
  color: #111827;
  break-inside: avoid;
}

.zone-label-head { display: flex; justify-content: space-between; font-size: 0.75rem; color: #4b5563; }
.zone-label-code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.zone-label-name { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-label .barcode { width: 100%; height: 48px; }

@media print {
  body * { visibility: hidden; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet { position: absolute; inset: 0 auto auto 0; width: 100%; }
  .zone-labels { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .zone-label { height: 37mm; border-color: #9ca3af; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Where a sales line's price came from (a price list, by hand): under the price, small and muted. */
.price-source { display: block; margin-top: 2px; color: var(--color-muted); font-size: 0.75rem; white-space: nowrap; }

/* A list of links without bullets (e.g. the credit memos of a return order). */
.plain-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.plain-list .field-hint {
    margin-left: 0.5rem;
}
