/* Inter 4.1 variable font, bundled locally under the SIL Open Font License. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-variable-v4.1.woff2) format('woff2');
}
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(/assets/fonts/material-symbols.woff2) format('woff2');
}

/* Semantic color roles: cool surfaces and a turquoise Ruuvi Hub accent. */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --md-sys-color-primary: #005f60;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #b2ece8;
  --md-sys-color-on-primary-container: #002020;
  --md-sys-color-secondary: #466463;
  --md-sys-color-secondary-container: #d1e8e5;
  --md-sys-color-on-secondary-container: #0b2020;
  --md-sys-color-tertiary: #4e607c;
  --md-sys-color-tertiary-container: #d7e3ff;
  --md-sys-color-on-tertiary-container: #0b1b34;
  --md-sys-color-surface: #f3faf8;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #edf5f3;
  --md-sys-color-surface-container: #e7efed;
  --md-sys-color-surface-container-high: #e1e9e7;
  --md-sys-color-surface-container-highest: #dbe3e1;
  --md-sys-color-on-surface: #17201f;
  --md-sys-color-on-surface-variant: #3f4947;
  --md-sys-color-outline: #6f7976;
  --md-sys-color-outline-variant: #bec9c5;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-success: #315b35;
  --md-sys-color-success-container: #d4edcf;
  --md-sys-color-warning: #614300;
  --md-sys-color-warning-container: #ffebba;
  --control-chevron: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%233f4947%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22%2F%3E%3C%2Fsvg%3E');
  --scrim: #00000066;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 999px;
  --md-sys-elevation-1: 0 1px 3px #17201f20, 0 1px 2px #17201f10;
  --md-sys-elevation-3: 0 6px 16px #17201f24, 0 2px 6px #17201f14;
  --md-sys-motion-standard: cubic-bezier(0.2, 0, 0, 1);
  --ink: var(--md-sys-color-on-surface);
  --muted: var(--md-sys-color-on-surface-variant);
  --line: var(--md-sys-color-outline-variant);
  --surface: var(--md-sys-color-surface-container-lowest);
  --bg: var(--md-sys-color-surface);
  /* Shared finishes derive from the semantic colors, including the no-JS theme. */
  --material-edge: color-mix(in srgb, var(--md-sys-color-outline) 34%, var(--surface));
  --material-highlight: inset 0 1px 0 #ffffff18;
  --material-shadow: var(--material-highlight), 0 4px 16px #001c2010;
  --material-raised: var(--material-highlight), 0 12px 32px #001c2026;
  --material-tint: linear-gradient(
    145deg,
    color-mix(in srgb, var(--surface) 95%, var(--md-sys-color-primary)),
    var(--surface) 65%
  );
  --accent-wash: linear-gradient(
    125deg,
    color-mix(in srgb, var(--md-sys-color-primary-container) 82%, var(--surface)),
    var(--md-sys-color-primary-container) 65%,
    color-mix(
      in srgb,
      var(--md-sys-color-primary-container) 82%,
      var(--md-sys-color-tertiary-container)
    )
  );
  --button-sheen: linear-gradient(
    115deg,
    #ffffff24,
    #ffffff08 28%,
    #ffffff00 40%,
    #ffffff1c 58%,
    #ffffff04 76%,
    #001c2018
  );
  --glass-sheen: linear-gradient(135deg, #ffffff1c, #ffffff00 42%, #ffffff07);
  --glass-rim: inset 0 1px 0 #ffffff30, inset 0 -1px 0 #ffffff08;
  --glass-shadow: var(--glass-rim), 0 4px 12px #001c2018;
  --control-transition:
    background-color 220ms var(--md-sys-motion-standard),
    border-color 220ms var(--md-sys-motion-standard),
    box-shadow 220ms var(--md-sys-motion-standard), color 180ms var(--md-sys-motion-standard),
    background-position 420ms var(--md-sys-motion-standard);
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-weight-body: 400;
  --font-weight-label: 500;
  --font-weight-heading: 600;
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-weight: var(--font-weight-body);
  font-size: 14px;
  color: var(--ink);
  color-scheme: light;
}
/* Explicit choice overrides the OS. The media rule also works without JavaScript. */
:root[data-theme='dark'] {
  --md-sys-color-primary: #7bd5cf;
  --md-sys-color-on-primary: #003735;
  --md-sys-color-primary-container: #004f50;
  --md-sys-color-on-primary-container: #a1f0e9;
  --md-sys-color-secondary: #adcac6;
  --md-sys-color-secondary-container: #2f4b49;
  --md-sys-color-on-secondary-container: #d1e8e5;
  --md-sys-color-tertiary: #aec6ec;
  --md-sys-color-tertiary-container: #354861;
  --md-sys-color-on-tertiary-container: #d7e3ff;
  --md-sys-color-surface: #0e1514;
  --md-sys-color-surface-container-lowest: #09100f;
  --md-sys-color-surface-container-low: #161d1c;
  --md-sys-color-surface-container: #1a2220;
  --md-sys-color-surface-container-high: #252d2b;
  --md-sys-color-surface-container-highest: #303836;
  --md-sys-color-on-surface: #dee4e1;
  --md-sys-color-on-surface-variant: #bdc9c5;
  --md-sys-color-outline: #89938f;
  --md-sys-color-outline-variant: #3f4947;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-success: #b8dcb3;
  --md-sys-color-success-container: #173b1d;
  --md-sys-color-warning: #f5d68a;
  --md-sys-color-warning-container: #493500;
  --control-chevron: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23bdc9c5%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22%2F%3E%3C%2Fsvg%3E');
  --scrim: #00000099;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --md-sys-color-primary: #7bd5cf;
    --md-sys-color-on-primary: #003735;
    --md-sys-color-primary-container: #004f50;
    --md-sys-color-on-primary-container: #a1f0e9;
    --md-sys-color-secondary: #adcac6;
    --md-sys-color-secondary-container: #2f4b49;
    --md-sys-color-on-secondary-container: #d1e8e5;
    --md-sys-color-tertiary: #aec6ec;
    --md-sys-color-tertiary-container: #354861;
    --md-sys-color-on-tertiary-container: #d7e3ff;
    --md-sys-color-surface: #0e1514;
    --md-sys-color-surface-container-lowest: #09100f;
    --md-sys-color-surface-container-low: #161d1c;
    --md-sys-color-surface-container: #1a2220;
    --md-sys-color-surface-container-high: #252d2b;
    --md-sys-color-surface-container-highest: #303836;
    --md-sys-color-on-surface: #dee4e1;
    --md-sys-color-on-surface-variant: #bdc9c5;
    --md-sys-color-outline: #89938f;
    --md-sys-color-outline-variant: #3f4947;
    --md-sys-color-error: #ffb4ab;
    --md-sys-color-error-container: #93000a;
    --md-sys-color-on-error-container: #ffdad6;
    --md-sys-color-success: #b8dcb3;
    --md-sys-color-success-container: #173b1d;
    --md-sys-color-warning: #f5d68a;
    --md-sys-color-warning-container: #493500;
    --control-chevron: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23bdc9c5%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22%2F%3E%3C%2Fsvg%3E');
    --scrim: #00000099;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  line-height: 1.5;
}
strong,
b,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-heading);
}
[hidden] {
  display: none !important;
}
a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 24px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--md-sys-color-primary);
  font-weight: var(--font-weight-label);
  line-height: 20px;
  letter-spacing: 0.1px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 160ms var(--md-sys-motion-standard),
    border-color 160ms var(--md-sys-motion-standard),
    box-shadow 160ms var(--md-sys-motion-standard);
}
button:hover,
.button:hover {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
  text-decoration: none;
}
button:active,
.button:active {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
}
button.primary,
.button.primary {
  background: var(--md-sys-color-primary);
  border-color: transparent;
  color: var(--md-sys-color-on-primary);
}
button.primary:hover,
.button.primary:hover {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 92%, white);
  box-shadow: var(--md-sys-elevation-1);
}
button.primary:active,
.button.primary:active {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 85%, white);
  box-shadow: none;
}
button.tonal,
.button.tonal {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}
button.danger {
  color: var(--md-sys-color-error);
  border-color: var(--md-sys-color-error);
}
button.danger:hover {
  background-color: var(--md-sys-color-error-container);
}
button:disabled,
.button[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.full {
  width: 100%;
}
.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  white-space: nowrap;
  overflow: hidden;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
button .icon,
.button .icon {
  font-size: 20px;
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}
.icon-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
}
.icon-button .icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  font-size: 24px;
}
input,
select,
textarea {
  width: 100%;
  /* Values are body text, even when nested inside a medium-weight label. */
  font-weight: var(--font-weight-body);
  min-width: 0;
  min-height: 56px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 4px;
  padding: 15px 16px;
  color: var(--ink);
  background: var(--surface);
  line-height: 24px;
  font-size: 16px;
}
/* Native date/month controls otherwise add their own intrinsic height. */
input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not(
    [type='color']
  ),
select:not([multiple]):not([size]),
select[size='1'] {
  height: 56px;
}
/* Vector chevrons stay crisp at browser zoom and reserve space for long values. */
select:not([multiple]):not([size]),
select[size='1'] {
  appearance: none;
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 24px 24px;
  padding-right: 48px;
  cursor: pointer;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[readonly] {
  background: var(--md-sys-color-surface-container);
  color: var(--muted);
  border-color: var(--line);
}
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
input[type='checkbox'],
input[type='radio'] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  flex: none;
  accent-color: var(--md-sys-color-primary);
}
label,
.shipping-instruction-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 16px;
  font-weight: var(--font-weight-label);
  color: var(--muted);
}
label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-body);
  line-height: 18px;
  padding: 0 16px;
}
label.field,
.shipping-instruction-field {
  padding-top: 0;
  gap: 4px;
}
.field > .field-label {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: calc(100% - 8px);
  max-width: calc(100% - 24px);
  overflow-wrap: anywhere;
  padding: 0 4px;
  background: var(--surface);
  line-height: 16px;
  font-weight: var(--font-weight-label);
}
.field:focus-within > .field-label {
  color: var(--md-sys-color-primary);
}
/* Rendered in the HTML, so markers never cause a late field-layout shift.
   Native required/disabled state also covers conditional and cloned fields. */
.required-marker {
  display: none;
  color: var(--md-sys-color-error);
  font-weight: var(--font-weight-heading);
  margin-inline-start: 0.25em;
}
.required-marker::before {
  content: '*';
}
label:has(:required:enabled:not([readonly])) > .required-marker,
label:has(:required:enabled:not([readonly])) > .field-label > .required-marker,
.required-column .required-marker,
.required-note > .required-marker,
[data-required='true'] > .field-label > .required-marker {
  display: inline;
}
.required-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}
:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 16px;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border-radius: 28px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}
.skip-link:focus {
  width: auto;
  height: auto;
  padding: 12px 24px;
  clip-path: none;
}
.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  height: 100dvh;
  position: sticky;
  top: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 12px 12px;
  background: var(--md-sys-color-surface-container-low);
}
.brand-row {
  display: flex;
  align-items: center;
  padding: 0 12px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: var(--font-weight-label);
  line-height: 28px;
  letter-spacing: -0.4px;
}
.brand:hover {
  text-decoration: none;
}
.brand-name {
  white-space: nowrap;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 16px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}
.brand-mark img {
  display: block;
  width: 44px;
  height: 44px;
}
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.nav-group {
  margin-bottom: 12px;
}
.nav-label {
  display: block;
  padding: 8px 16px 6px;
  font-size: 12px;
  line-height: 16px;
  font-weight: var(--font-weight-label);
  color: var(--muted);
}
.nav-group :is(a, summary) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 16px;
  margin: 2px 0;
  border-radius: 28px;
  color: var(--muted);
  font-weight: var(--font-weight-label);
  font-size: 14px;
  line-height: 20px;
}
.nav-group :is(a, summary) .icon {
  font-size: 22px;
}
.nav-group :is(a, summary):hover {
  background-color: color-mix(in srgb, var(--ink) 6%, transparent);
  text-decoration: none;
}
.nav-group a.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.nav-group a.active:hover {
  background-color: color-mix(
    in srgb,
    var(--md-sys-color-secondary-container) 90%,
    var(--md-sys-color-primary)
  );
}
.account {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding: 16px 8px 0;
}
.avatar {
  display: inline-flex;
  width: 36px;
  height: 36px;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-size: 16px;
  font-weight: var(--font-weight-label);
  overflow: hidden;
  vertical-align: middle;
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-large {
  width: 88px;
  height: 88px;
  font-size: 28px;
}
.account-profile {
  max-width: 1100px;
}
.account-profile .form-grid {
  margin-top: 28px;
}
.profile-photo-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-block: 32px 24px;
}
.profile-photo-control {
  flex: 1;
  min-width: 0;
  max-width: 520px;
}
.profile-photo-status {
  min-height: 18px;
}
.account-profile .checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: var(--font-weight-body);
}
.account-profile input[type='file']::file-selector-button {
  border: 0;
  border-radius: 16px;
  padding: 6px 12px;
  margin-right: 12px;
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font: inherit;
  cursor: pointer;
}
@media (max-width: 560px) {
  .profile-photo-row {
    flex-direction: column;
  }
  .profile-photo-control {
    width: 100%;
  }
}
.account strong {
  display: block;
  font-weight: var(--font-weight-label);
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-role {
  display: block;
  text-transform: capitalize;
  font-size: 12px;
}
.menu-toggle,
.drawer-close {
  display: none;
}
.nav-scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  border: 0;
  border-radius: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
}
.nav-scrim:hover {
  background: var(--scrim);
}
main {
  min-width: 0;
}
main:focus {
  outline: none;
}
.topline {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px;
}
.topline-title {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
}
.topline .menu-toggle {
  flex-shrink: 0;
}
.workspace-label,
.breadcrumb-separator {
  color: var(--muted);
}
.breadcrumbs .breadcrumb-separator {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  align-self: center;
}
.page-content {
  max-width: 1800px;
  margin: 0 auto;
  padding: 8px 32px 24px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 16px 0 32px;
}
.eyebrow {
  color: var(--md-sys-color-primary);
  font-size: 12px;
  line-height: 16px;
  font-weight: var(--font-weight-label);
  letter-spacing: 1px;
  margin: 0 0 8px;
}
h1 {
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
}
h2 {
  font-size: 20px;
  line-height: 28px;
  margin: 0 0 16px;
}
h3 {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  margin: 0 0 12px;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.page-heading p.muted {
  margin: 0;
  max-width: 760px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-6) var(--space-3);
}
.inline-form input {
  min-width: 172px;
}
.inline-form > label.field {
  /* Wrap the action onto another row before squeezing a field and its floating
     caption into the space left by a long button (e.g. cancel a purchase). */
  min-width: min(100%, 180px);
}
.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 24px 20px;
}
.source-filters {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}
.source-filters legend {
  font-size: 12px;
  line-height: 16px;
  font-weight: var(--font-weight-label);
  color: var(--muted);
  margin-bottom: 8px;
}
.source-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.source-option {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  font-weight: var(--font-weight-label);
  cursor: pointer;
}
.source-option:hover {
  background-color: var(--md-sys-color-surface-container);
}
.source-option:has(input:checked) {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}
.source-option:focus-within {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.source-options > a {
  padding: 8px;
  font-weight: var(--font-weight-label);
}
.status-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 0 8px;
}
.status-strip strong {
  color: var(--ink);
  font-weight: var(--font-weight-label);
}
.status-strip a {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--font-weight-label);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 16px;
  font-weight: var(--font-weight-label);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge .icon {
  font-size: 16px;
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}
.badge.good {
  background: var(--md-sys-color-success-container);
  color: var(--md-sys-color-success);
}
.badge.bad {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}
.badge.warm {
  background: var(--md-sys-color-warning-container);
  color: var(--md-sys-color-warning);
}
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 16px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading > span {
  font-size: 12px;
  color: var(--muted);
}
.customer-purchase-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.customer-purchase-summary h2 {
  margin: 0 0 8px;
}
.customer-purchase-summary p {
  margin: 0;
}
.customer-purchase-amount {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: var(--md-sys-color-primary);
}
.customer-order-value {
  white-space: nowrap;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--md-sys-color-surface-container-high);
  min-width: 0;
  container-type: inline-size;
}
.kpi:first-child {
  background: var(--md-sys-color-primary-container);
  border-color: transparent;
}
.kpi-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: var(--font-weight-label);
  color: var(--muted);
}
.kpi-heading .icon {
  color: var(--md-sys-color-primary);
}
.kpi strong {
  display: block;
  font-size: clamp(20px, 10cqi, 34px);
  line-height: 1.3;
  font-weight: var(--font-weight-body);
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: anywhere;
}
.kpi:first-child strong {
  color: var(--md-sys-color-on-primary-container);
}
.kpi-comparison {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.kpi-comparison > span {
  font-size: 12px;
  font-weight: var(--font-weight-label);
  background: var(--md-sys-color-surface-container);
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 8px;
}
.kpi:first-child .kpi-comparison > span {
  background: color-mix(in srgb, var(--md-sys-color-surface) 60%, transparent);
}
.kpi-comparison small {
  font-size: 12px;
  color: var(--muted);
}
.panel {
  min-width: 0;
  background: var(--surface);
  border-radius: 20px;
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 1px solid var(--md-sys-color-surface-container-high);
}
.panel > .section-heading {
  margin-top: 0;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.charts-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
}
.chart-wrap {
  position: relative;
  height: 280px;
}
.dimension-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--md-sys-color-surface-container-high);
  font-size: 14px;
}
.dimension-row:last-child {
  border: 0;
}
.dimension-row > span {
  overflow-wrap: anywhere;
}
.dimension-row strong,
.dimension-row b {
  font-weight: var(--font-weight-label);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.split-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.split-metrics .dimension-row {
  font-size: 12px;
  padding: 8px 0;
  gap: 8px;
}
.three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.two-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container);
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-label);
}
.table-scroll {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  font-variant-numeric: tabular-nums;
}
input[inputmode='decimal'],
input[inputmode='numeric'],
input[type='number'] {
  font-variant-numeric: tabular-nums;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 12px;
  font-weight: var(--font-weight-label);
  color: var(--muted);
  background: var(--md-sys-color-surface-container-low);
  padding: 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  height: 56px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-sys-color-surface-container-high);
  white-space: nowrap;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}
td.wrap {
  white-space: normal;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--md-sys-color-surface-container-low);
}
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.row-actions a {
  display: inline-block;
  padding: 6px 0;
  margin-right: 16px;
  font-weight: var(--font-weight-label);
}
.row-actions a:last-child {
  margin-right: 0;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-6) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--md-sys-color-surface-container-high);
  border-radius: 20px;
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.toolbar > input {
  flex: 2 1 220px;
  max-width: 360px;
}
.toolbar > select {
  flex: 1 1 140px;
  max-width: 200px;
}
.toolbar > label {
  min-width: 0;
  flex: 1 1 180px;
  max-width: 180px;
}
.toolbar > .search-field,
.toolbar > label:has(input[name='q']) {
  flex: 2 1 280px;
  max-width: 480px;
}
.toolbar > label:has(select[name='type']) {
  flex: 1.3 0 224px;
  max-width: 256px;
}
.toolbar > label:has(select[name='status']) {
  flex: 1 0 160px;
  max-width: 220px;
}
.toolbar > label:has(input[type='date']) {
  flex: 1 0 172px;
  max-width: 200px;
}
.toolbar input[type='date'] {
  padding-inline: 12px;
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-height: 56px;
  margin-left: auto;
}
/* Align actions to the input itself, independent of helper text below it. */
.inline-form:has(> .field) > button,
.inline-form:has(> .field) > a,
.toolbar:has(> .field) > button,
.toolbar:has(> .field) > a {
  margin-top: 7px;
}
.inline-form:has(> .field) > a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  margin-top: 0;
}
.filter-actions > a {
  padding: 10px 12px;
  border-radius: 24px;
  font-weight: var(--font-weight-label);
}
.filter-actions > a:hover {
  background-color: var(--md-sys-color-surface-container);
  text-decoration: none;
}
.toolbar > a,
.actions > a:not(.button) {
  font-weight: var(--font-weight-label);
  padding: 10px 12px;
  border-radius: 24px;
}
.toolbar > a:hover,
.actions > a:not(.button):hover {
  background-color: var(--md-sys-color-surface-container);
  text-decoration: none;
}
.sort-heading {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font: inherit;
  font-weight: var(--font-weight-label);
  color: inherit;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 0;
  min-height: 24px;
  text-align: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.sort-heading:hover,
.sort-heading:active {
  color: var(--md-sys-color-primary);
  background: transparent;
  text-decoration: none;
}
.sort-arrow {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  mask: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m8%203-4%204m4-4%204%204M8%203v18m8%200-4-4m4%204%204-4M16%2021V3%22%2F%3E%3C%2Fsvg%3E')
    center / contain no-repeat;
}
th[aria-sort='ascending'] .sort-arrow,
th[aria-sort='descending'] .sort-arrow {
  mask-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%2010%206-6%206%206M12%204v16%22%2F%3E%3C%2Fsvg%3E');
}
th[aria-sort='descending'] .sort-arrow {
  transform: rotate(180deg);
}
th[aria-sort='ascending'],
th[aria-sort='descending'] {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.actions:has(> .field) {
  align-items: flex-start;
  row-gap: var(--space-6);
}
.actions:has(> .field) > button {
  margin-top: 7px;
}
.job-actions {
  margin: 0 0 24px;
}
.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h2 {
  color: var(--ink);
  margin-bottom: 8px;
}
.empty.compact {
  padding: 32px 8px;
}
.empty .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  margin-bottom: 16px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.pagination > div {
  display: flex;
  gap: 8px;
}
.notice {
  background: var(--md-sys-color-warning-container);
  color: var(--md-sys-color-warning);
  border: 0;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.6;
  margin: 20px 0;
}
.notice a {
  color: inherit;
  text-decoration: underline;
  font-weight: var(--font-weight-label);
}
.notice.success {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--md-sys-color-success-container);
  color: var(--md-sys-color-success);
}
.notice[role='alert'] {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}
/* Native radios make the theme cards work with Tab, arrows and screen readers. */
.theme-picker {
  border: 0;
  padding: 0;
  margin: 24px 0 0;
  min-width: 0;
}
.theme-picker legend {
  font-weight: var(--font-weight-label);
  margin-bottom: 12px;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.theme-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  color: var(--ink);
}
.theme-option:hover {
  background-color: var(--md-sys-color-surface-container-low);
}
.theme-option:has(:checked) {
  border-color: var(--md-sys-color-primary);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.theme-option:focus-within {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 3px;
}
.theme-option input {
  grid-row: 2;
}
.theme-option-text {
  grid-row: 2;
  display: grid;
  gap: 4px;
  font-weight: var(--font-weight-body);
}
.theme-option strong {
  font-size: 16px;
  font-weight: var(--font-weight-label);
  line-height: 24px;
}
.theme-preview {
  grid-column: 1 / -1;
  height: 80px;
  border: 1px solid #6f7976;
  border-radius: 8px;
  background: #f3faf8;
  padding: 12px 12px 12px 32px;
  position: relative;
  overflow: hidden;
}
.theme-preview::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 20px;
  background: #d1e8e5;
}
.theme-preview span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #b2ece8;
  border-top: 8px solid #005f60;
}
.theme-preview-dark {
  background: #0e1514;
}
.theme-preview-dark::before {
  background: #2f4b49;
}
.theme-preview-dark span {
  background: #004f50;
  border-color: #7bd5cf;
}
.theme-preview-system {
  background: linear-gradient(90deg, #f3faf8 50%, #0e1514 50%);
}
.theme-preview-system span {
  background: linear-gradient(90deg, #b2ece8 50%, #004f50 50%);
  border-color: #466463;
}
.theme-status {
  min-height: 20px;
  margin: 20px 0 0;
}
.settings-description {
  margin-bottom: 28px;
}
@media (max-width: 600px) {
  .theme-options {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .theme-option {
    grid-template-columns: 20px 64px minmax(0, 1fr);
  }
  .theme-option input {
    grid-column: 1;
    grid-row: 1;
  }
  .theme-preview {
    grid-column: 2;
    grid-row: 1;
    height: 48px;
    padding: 8px 8px 8px 20px;
  }
  .theme-preview::before {
    width: 12px;
  }
  .theme-option-text {
    grid-column: 3;
    grid-row: 1;
  }
}
@media (scripting: none) {
  .theme-picker,
  .theme-status {
    display: none;
  }
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]),
  select[size='1'] {
    appearance: auto;
    background-image: none;
  }
  .sort-arrow,
  summary::before {
    background: CanvasText;
  }
  .theme-option:has(:checked) {
    border: 2px solid Highlight;
  }
}
.form-panel {
  max-width: 1056px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-8) var(--space-6);
  margin: var(--space-2) 0 var(--space-8);
}
.form-grid > button {
  align-self: start;
  justify-self: start;
  margin-top: 7px;
}
.form-grid > .checkbox {
  min-height: 56px;
}
.form-end,
.resolution {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}
.resolution {
  margin-bottom: 0;
}
.form-section,
[data-contents],
[data-labor-editor] {
  min-width: 0;
  margin: 24px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.form-section > legend,
[data-contents] legend,
[data-labor-editor] legend {
  padding: 0 8px;
  font-size: 20px;
  font-weight: var(--font-weight-heading);
}
[data-contents] > p {
  margin: 0 0 24px;
}
[data-contents] > label {
  max-width: 300px;
  margin-bottom: 24px;
}
[data-contents] .table-scroll {
  margin: 16px 0;
}
[data-contents-rows] input {
  min-width: 140px;
}
[data-contents-rows] input[type='number'] {
  max-width: 180px;
}
dialog {
  background: var(--md-sys-color-surface-container-high);
  color: var(--ink);
  max-width: 600px;
  width: calc(100% - 48px);
  max-height: calc(100dvh - 48px);
  border: 0;
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--md-sys-elevation-3);
}
dialog::backdrop {
  background: var(--scrim);
}
.buildable-dialog {
  max-width: 820px;
  overflow-y: auto;
}
.buildable-dialog-close {
  display: flex;
  justify-content: flex-end;
}
.buildable-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.buildable-metric {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow-wrap: anywhere;
}
.buildable-metric[aria-current='true'] {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container);
}
.buildable-metric > span:first-child {
  min-height: 3em;
}
.buildable-metric strong {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}
.buildable-reservations {
  list-style: none;
  padding: 0;
  margin: 0;
}
.buildable-reservations > li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.buildable-reservations p {
  margin: 6px 0;
}
.buildable-owners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.buildable-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.buildable-tree > li {
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.buildable-node-content > .buildable-tree {
  margin: 12px 0 0 6px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.buildable-branch > summary {
  padding: 4px 0;
}
.buildable-node-meta {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 12px;
}
.buildable-node-quantities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.buildable-node-quantities dt {
  color: var(--muted);
  font-size: 12px;
}
.buildable-node-quantities dd {
  font-weight: var(--font-weight-label);
}
.buildable-details th.numeric,
.buildable-details td.numeric {
  text-align: right;
  white-space: nowrap;
}
.buildable-details td:first-child {
  min-width: 180px;
  white-space: normal;
}
.buildable-details .table-scroll {
  max-width: 100%;
}
@media (max-width: 600px) {
  .buildable-details thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .buildable-details table,
  .buildable-details tbody {
    display: block;
  }
  .buildable-details tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  .buildable-node-content > .buildable-tree {
    margin-left: 2px;
    padding-left: 8px;
  }
  .buildable-node-quantities {
    gap: 6px;
  }
  .buildable-details td,
  .buildable-details td.numeric {
    display: block;
    height: auto;
    min-width: 0;
    padding: 8px 4px;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .buildable-details td:first-child {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .buildable-details td.numeric::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
  }
}
dialog h2 {
  font-size: 24px;
  line-height: 32px;
}
dialog label {
  margin: 28px 0;
}
dialog .field-label {
  background: var(--md-sys-color-surface-container-high);
}
dialog input {
  background: transparent;
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 28px;
  gap: 8px;
}
dialog .actions button {
  border: 0;
  padding: 10px 14px;
}
dialog .actions button[data-content-action='version'] {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}
dl {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
summary {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: var(--font-weight-label);
  overflow-wrap: anywhere;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: '';
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: currentColor;
  mask: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22%2F%3E%3C%2Fsvg%3E')
    center / contain no-repeat;
  transform: rotate(-90deg);
}
details[open] > summary::before {
  transform: none;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-layout {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}
.login-intro {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px;
  background: var(--md-sys-color-primary-container);
  border-radius: 32px;
}
.login-intro h1 {
  font-size: 40px;
  line-height: 48px;
  letter-spacing: -1px;
  color: var(--md-sys-color-on-primary-container);
}
.login-intro p:not(.eyebrow) {
  font-size: 16px;
  color: var(--muted);
  max-width: 370px;
}
.login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.login-features > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: color-mix(in srgb, var(--md-sys-color-surface) 60%, transparent);
  padding: 8px 12px;
  border-radius: 16px;
}
.login-features .icon {
  font-size: 20px;
  width: 20px;
}
.login-caption {
  color: var(--muted);
  font-size: 12px;
}
.login-card {
  width: 440px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--md-sys-color-surface-container-high);
  border-radius: 28px;
  padding: 40px;
}
.login-card h2 {
  font-size: 28px;
  line-height: 36px;
  margin: 20px 0 8px;
}
.login-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-primary);
}
.login-card form {
  margin-top: 32px;
}
.login-card label {
  margin-bottom: 28px;
}
.login-card .primary {
  min-height: 48px;
}
.login-card .primary .icon {
  margin-left: auto;
}
.login-card .primary {
  justify-content: space-between;
}
.login-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin: 24px 0 0;
}
.login-note .icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}
.error-panel {
  margin-top: 32px;
}
.login-card .error-panel {
  padding: 0;
  border: 0;
  background: none;
}
#email-lines input {
  min-width: 120px;
}
#email-lines td:first-child input {
  min-width: 200px;
}
#email-lines {
  margin-bottom: 16px;
}
@media (min-width: 1800px) {
  .kpi {
    padding: 20px;
  }
}
@media (max-width: 1250px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .three-grid {
    grid-template-columns: 1fr;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading > .actions {
    justify-content: flex-end;
  }
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 8px;
    padding-right: 8px;
  }
  .page-content {
    padding-left: 24px;
    padding-right: 24px;
  }
  .page-heading {
    flex-direction: column;
    gap: 16px;
  }
  .two-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .login-layout {
    gap: 32px;
  }
  .login-intro {
    padding: 28px;
  }
  .login-intro h1 {
    font-size: 32px;
    line-height: 40px;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 16px;
  }
  .js .sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, calc(100vw - 48px));
    height: 100dvh;
    border-radius: 0 28px 28px 0;
    transform: translateX(-105%);
    visibility: hidden;
    transition:
      transform 220ms var(--md-sys-motion-standard),
      visibility 220ms;
  }
  .js .nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    box-shadow: var(--md-sys-elevation-3);
  }
  .js .menu-toggle,
  .js .drawer-close {
    display: inline-flex;
  }
  .brand-row {
    padding: 8px 4px 20px;
    justify-content: space-between;
  }
  .nav-open {
    overflow: hidden;
  }
  .workspace-label,
  .breadcrumb-separator {
    display: none;
  }
  .page-content {
    padding: 8px 16px 24px;
  }
  .page-heading {
    margin-top: 8px;
    margin-bottom: 24px;
  }
  h1 {
    font-size: 28px;
    line-height: 36px;
  }
  .dashboard-filters {
    gap: 20px;
  }
  .status-strip a {
    margin-left: 0;
  }
  .login-page {
    padding: 24px;
  }
  .login-layout {
    max-width: 480px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .login-intro {
    min-height: 0;
    background: none;
    padding: 0;
  }
  .login-intro > div,
  .login-caption {
    display: none;
  }
  .login-card {
    width: 100%;
    padding: 32px;
  }
}
@media (max-width: 520px) {
  .panel {
    padding: 20px;
    border-radius: 16px;
  }
  .panel.flush {
    padding: 0;
  }
  .kpi-grid {
    gap: 12px;
  }
  .kpi {
    padding: 16px;
    border-radius: 16px;
  }
  .kpi-heading {
    gap: 4px;
  }
  .kpi-heading .icon {
    display: none;
  }
  .kpi-label {
    font-size: 12px;
  }
  .kpi strong {
    font-size: clamp(18px, 10cqi, 21px);
  }
  .kpi-comparison {
    margin-top: 12px;
  }
  .kpi-comparison small {
    font-size: 11px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    padding: 24px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar > label,
  .toolbar > .search-field,
  .toolbar > label:has(input[name='q']),
  .toolbar > input,
  .toolbar > select {
    max-width: none;
  }
  .toolbar > label {
    flex-basis: calc(50% - 12px);
  }
  .toolbar > .search-field {
    grid-column: 1 / -1;
  }
  .toolbar > label:has(select[name='status']) {
    grid-column: 1 / -1;
    max-width: none;
  }
  .toolbar > label:has(select[name='type']) {
    grid-column: 1 / -1;
    max-width: none;
  }
  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .inline-form {
    width: 100%;
  }
  .inline-form label {
    flex: 1;
  }
  .inline-form input {
    min-width: 0;
  }
  .split-metrics {
    gap: 16px;
  }
  .split-metrics .dimension-row {
    flex-wrap: wrap;
    gap: 4px;
  }
  [data-contents] {
    padding: 16px;
  }
  .actions {
    gap: 8px;
  }
  dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  dd {
    margin-bottom: 16px;
  }
  dialog {
    padding: 24px;
  }
  dialog .actions {
    flex-direction: column;
    align-items: stretch;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  :root,
  :root[data-theme] {
    --md-sys-color-primary: #005f60;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #b2ece8;
    --md-sys-color-on-primary-container: #002020;
    --md-sys-color-secondary: #466463;
    --md-sys-color-secondary-container: #d1e8e5;
    --md-sys-color-on-secondary-container: #0b2020;
    --md-sys-color-tertiary: #4e607c;
    --md-sys-color-tertiary-container: #d7e3ff;
    --md-sys-color-on-tertiary-container: #0b1b34;
    --md-sys-color-surface: #f3faf8;
    --md-sys-color-surface-container-lowest: #ffffff;
    --md-sys-color-surface-container-low: #edf5f3;
    --md-sys-color-surface-container: #e7efed;
    --md-sys-color-surface-container-high: #e1e9e7;
    --md-sys-color-surface-container-highest: #dbe3e1;
    --md-sys-color-on-surface: #17201f;
    --md-sys-color-on-surface-variant: #3f4947;
    --md-sys-color-outline: #6f7976;
    --md-sys-color-outline-variant: #bec9c5;
    --md-sys-color-error: #ba1a1a;
    --md-sys-color-error-container: #ffdad6;
    --md-sys-color-on-error-container: #410002;
    --md-sys-color-success: #315b35;
    --md-sys-color-success-container: #d4edcf;
    --md-sys-color-warning: #614300;
    --md-sys-color-warning-container: #ffebba;
    --control-chevron: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%233f4947%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22%2F%3E%3C%2Fsvg%3E');
    --scrim: #00000066;
    color-scheme: light;
  }
  .sidebar,
  .toolbar,
  .actions,
  .topline,
  .nav-scrim,
  .skip-link,
  .dashboard-filters {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .page-content {
    padding: 0;
  }
  .panel,
  .kpi {
    break-inside: avoid;
  }
  .chart-wrap {
    height: 220px;
  }
  body {
    background: white;
  }
}

.batch-entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  align-items: start;
}
.batch-remove {
  align-self: center;
  justify-self: start;
}
[data-incoming-batches] {
  margin-block: 1.5rem;
}
[data-incoming-batches] [data-add-batch] {
  margin-top: 1rem;
}
[hidden] {
  display: none !important;
}

.batch-entry .checkbox,
[data-cost-correction] .checkbox {
  flex-direction: row;
  align-items: center;
  align-self: start;
  gap: 0.6rem;
}
[data-item-cost] {
  padding: 0.5rem 0;
}
[data-item-cost] p {
  margin: 0.5rem 0;
}

/* A shared floating list stays visible outside horizontally scrolling tables. */
.item-picker-popup {
  position: fixed;
  z-index: 1200;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  background: var(--md-sys-color-surface-container);
  color: var(--ink);
  box-shadow: 0 8px 24px #0003;
}
.item-picker-option {
  padding: 12px;
  cursor: pointer;
  border-radius: 6px;
}
.item-picker-option strong,
.item-picker-option span {
  display: block;
  overflow-wrap: anywhere;
}
.item-picker-option span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.item-picker-option:hover,
.item-picker-option[aria-selected='true'] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.item-picker-option[aria-selected='true'] {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
}
.item-picker-status {
  margin: 8px;
  font-size: 12px;
  color: var(--muted);
}
.item-picker-selection {
  display: block;
  margin-top: 6px;
  white-space: normal;
  max-width: 32rem;
}
[data-contents-rows] td:first-child,
#email-lines td:first-child {
  min-width: 240px;
}
.recipe-summary {
  font-size: 13px;
  color: var(--muted);
}
@media print {
  .item-picker-popup {
    display: none !important;
  }
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.report-grid > *,
.item-details > * {
  min-width: 0;
}
.item-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.item-details dt {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.875rem;
}
.item-details dd {
  margin: 6px 0 0;
  font-weight: var(--font-weight-body);
  overflow-wrap: anywhere;
}
.metadata-hint {
  display: block;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 4px;
}
.report-links {
  margin-bottom: 24px;
}
.history-note {
  min-width: 180px;
  max-width: 400px;
  white-space: normal;
}
@media (max-width: 1000px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
  .item-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .item-details {
    grid-template-columns: 1fr;
  }
}

.topline-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* Task-oriented workspace: compact navigation, actionable summaries and print labels. */
.workspace-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.workspace-card {
  display: block;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
}
.workspace-card h2 {
  color: var(--md-sys-color-primary);
}
.workspace-card:hover {
  border-color: var(--md-sys-color-primary);
}
.actionable-kpi {
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
}
.actionable-kpi:hover {
  border-color: var(--md-sys-color-primary);
}
.actionable-kpi small {
  line-height: 1.5;
}
.shipment-summary > a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.shipment-summary > span {
  flex-shrink: 0;
  white-space: nowrap;
}
.attention-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.attention-row > div {
  flex: 1;
}
.attention-row p {
  margin: 6px 0;
}
.order-products {
  min-width: 180px;
  max-width: 400px;
}
.purchase-row-wide,
.purchase-order-type {
  grid-column: 1 / -1;
}
.purchase-order-type > p {
  margin: 12px 0 0;
}
.purchase-entry {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 16px;
  padding: 22px;
  margin: 18px 0;
}
.purchase-entry legend {
  padding: 0 8px;
  font-weight: var(--font-weight-heading);
}
.maintenance-action {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 18px 0;
}
.global-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.global-search:hover {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.batch-label {
  background: white;
  color: black;
  border: 2px solid black;
  border-radius: 6px;
  padding: 24px;
  width: 100%;
  max-width: 550px;
}
.batch-label h2 {
  font-size: 26px;
  overflow-wrap: anywhere;
}
.label-identifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 24px;
  border-block: 2px solid black;
  padding: 12px 0;
}
.batch-label p {
  margin: 10px 0;
}
@media (max-width: 800px) {
  .attention-row,
  .maintenance-action {
    flex-wrap: wrap;
  }
}
@media print {
  body:has(.batch-label) .sidebar,
  body:has(.batch-label) .topline,
  body:has(.batch-label) .page-heading,
  body:has(.batch-label) .skip-link {
    display: none !important;
  }
  body:has(.batch-label) .shell {
    display: block;
  }
  body:has(.batch-label) main,
  body:has(.batch-label) .page-content {
    margin: 0 !important;
    padding: 0 !important;
  }
  body:has(.batch-label) {
    background: white !important;
  }
  .batch-label {
    break-inside: avoid;
    width: 95mm;
    font-size: 10pt;
    max-width: none;
    padding: 4mm;
  }
  .batch-label h2 {
    font-size: 14pt;
  }
  .label-identifiers {
    font-size: 13pt;
  }
}

/* One navigation tree; status choices are controls belonging to their list. */
.nav-tree,
.nav-children,
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-tree .nav-group {
  margin-bottom: 2px;
}
.nav-group .nav-parent.section-active {
  color: var(--ink);
  font-weight: var(--font-weight-heading);
}
.nav-section {
  margin: 0;
}
.nav-submenu {
  display: flow-root;
  overflow: hidden;
  padding-inline: 3px;
}
.nav-parent::before {
  display: none;
}
.nav-group .nav-parent .nav-chevron {
  margin-left: auto;
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  transform: rotate(-90deg);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav-section[open] > .nav-parent .nav-chevron {
  transform: none;
}
.nav-section > .nav-parent[aria-expanded='false'] .nav-chevron {
  transform: rotate(-90deg);
}
.nav-group .nav-children {
  margin: 0 0 8px 26px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.nav-group .nav-children a {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 18px;
  border-radius: 12px;
}
.breadcrumbs {
  min-width: 0;
}
.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.breadcrumbs li > a,
.breadcrumbs li > span:not(.icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumbs li:last-child {
  color: var(--ink);
  font-weight: var(--font-weight-label);
}
.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-basis: 100%;
  border: 0;
  padding: 0;
  margin: 0 0 8px;
}
.status-filters legend {
  padding: 0;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.status-filters a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--ink);
  font-size: 13px;
}
.status-filters a.selected {
  background: var(--md-sys-color-secondary-container);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: var(--font-weight-heading);
}
.status-filters a.selected::before {
  content: '✓';
  margin-right: 6px;
}
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.recipe-version {
  margin-top: 16px;
}
@media (max-width: 560px) {
  .breadcrumbs li:not(:last-child),
  .breadcrumbs .breadcrumb-separator {
    display: none;
  }
  .breadcrumbs li:last-child {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Administration forms stay readable on wide desktops and wrap on small screens. */
.display-connect > p {
  max-width: 760px;
  margin: 0 0 28px;
}
.display-pairing-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(200px, 360px) auto;
  align-items: start;
  gap: 24px 16px;
  max-width: 800px;
}
.display-pairing-form button {
  margin-top: 6px;
  justify-self: start;
}
.display-pairing-form input[name='code'] {
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}
.account-form {
  max-width: 880px;
}
.account-form .role-guide {
  margin: 0 0 24px;
}
.account-password {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin: 0 0 24px;
}
.account-password > label {
  max-width: 440px;
  margin-top: 24px;
}
.role-descriptions {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px 16px;
  max-width: 760px;
  margin: 20px 0 0;
}
.role-descriptions dt,
.role-descriptions dd {
  margin: 0;
}
.role-descriptions dt {
  color: var(--ink);
  font-weight: var(--font-weight-label);
}
#displays .empty h3 {
  color: var(--ink);
  font-size: 16px;
  margin: 12px 0 4px;
}
#displays .empty p {
  margin: 0;
}
@media (max-width: 1100px) {
  .display-pairing-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .display-pairing-form button {
    margin-top: 0;
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .display-pairing-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Account security: QR setup stays local and usable with or without JavaScript. */
.account-link {
  display: block;
  white-space: nowrap;
}
.account-security h2 {
  overflow-wrap: anywhere;
}
.mfa-setup .actions {
  margin-top: 16px;
}
.account-security {
  max-width: 1100px;
}
.security-form {
  display: grid;
  gap: 24px;
  max-width: 480px;
  margin-top: 28px;
}
.security-form button {
  justify-self: start;
}
.security-action {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.security-action summary {
  cursor: pointer;
  font-weight: var(--font-weight-heading);
}
.mfa-setup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 32px;
}
.mfa-qr {
  display: block;
  width: 256px;
  max-width: 100%;
  height: auto;
  margin: 24px 0;
  border-radius: 12px;
  background: white;
}
.mfa-secret {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
  margin-block: 16px;
}
.recovery-panel {
  margin-top: 32px;
}
.recovery-codes {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
  margin-block: 24px;
}
.recovery-codes code {
  user-select: all;
  overflow-wrap: anywhere;
}
.verification-card {
  width: min(100%, 520px);
}
.verification-card h1 {
  font-size: 2rem;
}
@media (max-width: 760px) {
  .mfa-setup {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.queue-refresh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 56px;
  margin-block: 16px;
}
.queue-refresh:not([data-ready]) .actions {
  visibility: hidden;
}
.order-sync {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.sync-warning {
  color: var(--md-sys-color-error);
}

/* Help cues are rendered with the page so JavaScript does not move the layout. */
[data-help-hint]::after {
  /* Non-breaking inline space keeps the cue with the final word. An atomic
     inline-block could wrap onto an otherwise empty caption line on phones. */
  content: '\00a0';
  display: inline;
  padding-inline-end: 13px;
  /* Inherit the caption's font metrics so the fixed-size mask stays vertically
     centred beside headings as well as small labels. */
  font-size: inherit;
  letter-spacing: 0;
  vertical-align: baseline;
  background: var(--md-sys-color-on-surface-variant);
  mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"%3E%3Ccircle cx="10" cy="10" r="8" fill="none" stroke="black" stroke-width="1.5"/%3E%3Cpath d="M7.8 7.2a2.3 2.3 0 0 1 4.5.5c0 1.7-2.3 1.7-2.3 3.3" fill="none" stroke="black" stroke-width="1.5" stroke-linecap="round"/%3E%3Ccircle cx="10" cy="13.8" r=".85"/%3E%3C/svg%3E')
    right center / 13px 13px no-repeat;
}
[data-help-hint] {
  cursor: help;
}
[data-help][tabindex='0']:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 3px;
  border-radius: 3px;
}
.hub-tooltip {
  pointer-events: none;
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 10000;
  width: max-content;
  max-width: min(380px, calc(100vw - 24px));
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
  box-shadow: var(--md-sys-elevation-3);
  font: var(--font-weight-body) 14px/1.5 var(--font-body);
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow-y: auto;
  user-select: none;
}
.hub-tooltip::backdrop {
  pointer-events: none;
}
.hub-tooltip[hidden] {
  display: none;
}
@media print {
  .hub-tooltip,
  [data-help-hint]::after {
    display: none !important;
  }
}
@media (forced-colors: active) {
  .hub-tooltip {
    border-color: CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  [data-help-hint]::after {
    background: CanvasText;
    forced-color-adjust: none;
  }
}

/* Order workflows: forms, disclosures and summaries have explicit spacing. */
#email-form .form-grid + .form-grid {
  margin-top: 1.5rem;
}
#email-form .stack > .form-grid + .form-grid {
  margin-top: 0;
}
#email-form [data-shipping-address] {
  margin-top: 1.5rem;
}
#email-form [hidden] {
  display: none !important;
}
#email-form .check {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: flex-start;
  margin-block: 1rem;
}
#email-form .check input {
  flex: none;
  margin-top: 0.15rem;
}
#email-form #email-lines input {
  min-width: 7rem;
}
#email-form #email-lines td:first-child {
  min-width: 16rem;
}
#email-form #email-lines td {
  vertical-align: top;
}
#email-form #email-lines td input {
  margin: 0;
}
#email-form #email-lines td:nth-child(2) {
  min-width: 9rem;
}
#email-form #email-lines td .icon-button {
  margin-top: 8px;
}
#email-form #email-lines td small {
  display: block;
  margin-top: 0.4rem;
}
#email-form #email-lines output {
  display: block;
  min-width: 9rem;
  padding-block: 16px;
  font-variant-numeric: tabular-nums;
}
#email-form [data-line-total] {
  white-space: nowrap;
}
#email-form .order-pricing-summary {
  margin-top: 32px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 1fr);
}
@media (max-width: 1100px) {
  #email-form .order-pricing-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}
.order-totals {
  align-self: start;
  padding: 1rem 1.5rem;
  background: var(--md-sys-color-surface-container);
  border-radius: 16px;
}
.order-totals dl {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.order-totals dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  padding: 0.5rem 0;
}
.order-totals dd {
  margin: 0;
  white-space: nowrap;
  overflow-wrap: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.order-totals dl div:last-child {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-weight: var(--font-weight-heading);
}
.order-addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.order-addresses address {
  font-style: normal;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* Direct assembly entry keeps the common fields and confirmation in one place. */
.assembly-recent {
  margin-bottom: 1.5rem;
}
.assembly-recent h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}
.assembly-recent .button {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}
.assembly-fields {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(10rem, 1fr) minmax(12rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.assembly-fields > *,
.assembly-totals > * {
  min-width: 0;
}
.assembly-notes {
  margin: 1.25rem 0;
}
.assembly-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.assembly-preview-status {
  min-height: 1.5em;
  margin: 0.75rem 0;
}
.assembly-summary {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding-top: 1.5rem;
}
.assembly-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1.25rem 0;
}
.assembly-totals dt {
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
}
.assembly-totals dd {
  margin: 0.4rem 0 0;
  font-size: 1.5rem;
  font-weight: var(--font-weight-heading);
  overflow-wrap: anywhere;
}
.assembly-batches {
  margin-top: 1.5rem;
}
.assembly-confirm {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.assembly-confirm .primary {
  min-height: 48px;
  white-space: normal;
}
.assembly-confirm [aria-disabled='true'] {
  opacity: 0.65;
  pointer-events: none;
}
@media (max-width: 1000px) {
  .assembly-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .assembly-fields > :first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 550px) {
  .assembly-fields,
  .assembly-totals {
    grid-template-columns: minmax(0, 1fr);
  }
}

.partner-external-invoice {
  margin-top: 1.5rem;
}

/* Shipping settings and order pricing share the existing field rhythm. */
.shipping-price-options {
  margin-block: 0.75rem 1.25rem;
}
.shipping-price-options button[aria-pressed='true'] {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}
.shipping-price-field {
  max-width: 28rem;
}
[data-shipping-settings] .checkbox {
  margin-block: 1rem;
}
[data-shipping-settings] td {
  vertical-align: top;
}
[data-shipping-settings] td .checkbox {
  margin: 0.75rem 0;
}
#email-form .order-pricing-summary {
  display: flex;
  justify-content: flex-end;
}
#email-form .order-pricing-summary .order-totals {
  width: min(100%, 34rem);
}

/* Customer forms keep row controls and suggestions separate from field help. */
.customer-row {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.customer-row + .customer-row {
  margin-top: 1rem;
}
[data-customer-picker] {
  margin-bottom: 2rem;
}
[data-customer-picker] > .actions {
  margin: 1rem 0;
}
.customer-results {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.25rem;
}
.customer-results:empty,
.customer-results[hidden] {
  display: none;
}
.customer-results [aria-selected='true'] {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
}
.customer-results button {
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
}

.customer-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 600px) {
  .customer-details {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Account capability editor */
.permissions-editor {
  margin-block: 2rem;
}
.permission-presets {
  margin-block: 1.5rem 1rem;
}
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
  margin-block: 1.5rem;
}
.permission-group {
  min-width: 0;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 1rem;
  padding: 1.5rem;
}
.permission-group legend {
  font-weight: var(--font-weight-heading);
  padding-inline: 0.5rem;
}
.permission-group .checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-block: 1rem;
}
.permission-group input[type='checkbox'] {
  flex-shrink: 0;
}
.permission-change-summary {
  line-height: 1.6;
  margin-top: 1rem;
}

/* Time tracking keeps the active timer distinct from completed totals. */
.time-counter {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 20px 0;
  letter-spacing: 0.02em;
}
.time-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}
.time-total {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}
.time-header {
  position: relative;
}
.time-header .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.time-header-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding-right: 2px;
}
.time-header-controls form {
  margin: 0;
}
.time-header-controls form[hidden] {
  display: none;
}
.time-header-message,
.time-header-connection {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 16px #0003;
  font-size: 13px;
}
.time-header:has([data-time-header-message]:not([hidden])) .time-header-connection {
  display: none;
}
.time-running-link {
  display: inline-grid;
  grid-template-columns: 44px auto;
  align-items: center;
  min-height: 44px;
  padding: 0 8px 0 2px;
  border-radius: 24px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 20px;
}
.time-running-link [data-time-elapsed] {
  grid-column: 2;
}
.time-running-link:has(.time-recording-dot[hidden]) {
  grid-template-columns: auto;
  padding-left: 16px;
}
.time-running-link:has(.time-recording-dot[hidden]) [data-time-elapsed] {
  grid-column: 1;
}
.time-running-link:has(.time-header-description:not([hidden])) {
  grid-template-columns: 44px auto minmax(0, auto);
}
.time-running-link .time-recording-dot {
  justify-self: center;
}
.time-header-description {
  grid-column: 3;
  margin-left: 8px;
  min-width: 0;
  /* Keep room for all three truncation dots, even on the narrowest screen. */
  max-width: clamp(1.25em, calc(100vw - 350px), 32ch);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: normal;
}
.time-running-link[hidden] {
  display: none;
}
.time-description-editor {
  position: fixed;
  inset: 72px 16px auto auto;
  margin: 0;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 88px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow-y: auto;
}
.time-description-editor textarea {
  width: 100%;
  resize: vertical;
}
.time-description-editor .actions {
  flex-wrap: wrap;
}
.time-description-editor [data-time-description-error] {
  margin-block: 16px;
}
.time-timer .section-heading h2 {
  overflow-wrap: anywhere;
}
.time-tag-list {
  overflow-wrap: anywhere;
}
.time-connection {
  margin: 24px 0 0;
}
.time-tags-field {
  position: relative;
}
.time-tag-suggestions {
  position: absolute;
  top: 60px;
  left: 0;
  z-index: 20;
  min-width: 240px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px #0003;
}
.time-tag-suggestions button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  text-align: left;
  overflow-wrap: anywhere;
}
.time-tag-suggestions [aria-selected='true'] {
  background: var(--md-sys-color-primary-container);
}
.time-history {
  display: grid;
  gap: 16px;
}
.time-history article {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  overflow-wrap: anywhere;
}
.time-history article h3 {
  margin-bottom: 8px;
}
.time-scope-editor {
  margin-block: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.time-employee-options {
  max-height: 300px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.time-employee-options .checkbox[hidden] {
  display: none;
}
.time-stamp {
  white-space: nowrap;
}
[data-time-report] .wrap {
  max-width: 450px;
  overflow-wrap: anywhere;
  white-space: normal;
}
@media (max-width: 600px) {
  .time-stats {
    grid-template-columns: 1fr;
  }
  .time-timer .actions {
    align-items: stretch;
    flex-direction: column;
  }
}
[data-time-filters] > .field {
  flex: 1 1 160px;
  min-width: 150px;
}
@media (max-width: 600px) {
  [data-time-filters].inline-form {
    display: grid;
    grid-template-columns: 1fr;
  }
  [data-time-filters] > .field {
    width: 100%;
    min-width: 0;
  }
  [data-time-filters] input,
  [data-time-filters] select {
    width: 100%;
    min-width: 0;
  }
  [data-time-filters] > button {
    justify-self: start;
  }
}
.time-recording-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #ef4444;
}
.time-entry-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.time-entry-actions form {
  margin: 0;
}
.time-repeat {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
}

[data-supplier-picker] {
  min-width: 0;
  position: relative;
}
[data-supplier-picker] > .field {
  margin-bottom: 0;
}
[data-supplier-picker] [role='status'] {
  margin: 0.5rem 1rem 0;
}
.supplier-results {
  position: absolute;
  inset-inline: 0;
  z-index: 40;
  margin: 0;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px #0003;
}
.supplier-notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assembly-draft-actions {
  margin-bottom: 24px;
}

[data-repeat-dialog] {
  max-width: 640px;
  width: calc(100% - 32px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
}
[data-repeat-dialog]::backdrop {
  background: rgb(0 0 0 / 45%);
}
[data-repeat-dialog] .form-grid {
  margin-top: 32px;
}
.purchase-schedule-table th {
  white-space: normal;
}
.purchase-schedule-table th,
.purchase-schedule-table td {
  padding-left: 12px;
  padding-right: 12px;
}
.purchase-schedule-table td:nth-child(3),
.purchase-schedule-table td:last-child {
  white-space: normal;
  min-width: 100px;
}
.purchase-delivery-note {
  display: block;
  margin-top: 4px;
  white-space: normal;
  font-size: 0.75rem;
}

/* Composition owns the space between blocks; see docs/ui-layout.md.
   Use this explicitly on vertical containers, never on a grid, action row,
   native details or dialog. Keep their display and visibility semantics. */
.stack,
.stacked-form {
  --stack-space: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--stack-space);
  min-width: 0;
  white-space: normal;
}
.stack--compact {
  --stack-space: var(--space-4);
}
.stack--form {
  --stack-space: var(--space-8);
}
/* Native dialogs use automatic margins to center in the top layer. */
.stack > :not([hidden], dialog),
.stacked-form > :not([hidden], dialog) {
  min-width: 0;
  margin-block: 0;
}
/* Dynamic row lists with no content must not introduce a second gap. */
.stack > div:empty,
.stacked-form > div:empty {
  display: none;
}
.stack > button,
.stack > a.button,
.stacked-form > button,
.stacked-form > a.button {
  align-self: flex-start;
  max-width: 100%;
}
.disclosure > .disclosure-content {
  margin-block-start: var(--space-4);
}
/* Floating field captions extend above their control, sometimes over two lines.
   Give expanded forms room without changing compact tree/menu disclosures. */
.disclosure > .disclosure-content:has(.field) {
  margin-block-start: var(--space-8);
}
.disclosure > summary {
  margin-block: 0;
}
.item-supplier-field {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.item-catalog-tabs {
  margin-block: var(--space-6);
}
.package-create {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sales-destinations,
.sales-inline-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.sales-package-row {
  padding-block: var(--space-6);
  border-top: 1px solid var(--line);
}
.sales-package-row h3 small {
  font-size: 0.8em;
  font-weight: normal;
}
[data-sales-editor] button {
  white-space: normal;
  max-width: 100%;
}
[data-copy-difference]:empty,
[data-existing-contents]:empty {
  display: none;
}

/* Native legends sit outside the fieldset flex layout. */
.sales-destinations:has(> legend),
.sales-inline-fields:has(> legend) {
  padding-block-start: var(--space-6);
}
[data-content-editor] td {
  vertical-align: top;
}
[data-content-editor] td > button {
  margin-block-start: 7px;
}

@media (max-width: 600px) {
  [data-content-editor] table,
  [data-content-editor] tbody {
    display: block;
  }
  [data-content-editor] thead {
    display: none;
  }
  [data-content-editor] tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4);
    padding-block: var(--space-4);
    border-bottom: 1px solid var(--line);
  }
  [data-content-editor] td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
    max-width: none;
    height: auto;
    overflow: visible;
    white-space: normal;
  }
  [data-content-editor] td:first-child {
    grid-column: 1 / -1;
  }
  [data-content-editor] td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.85rem;
    margin-bottom: var(--space-2);
  }
  [data-content-editor] td:last-child {
    align-self: end;
    padding-bottom: 7px;
  }
  [data-content-editor] input {
    width: 100%;
  }
}

/* Shared finishing components: compact task summaries, disclosure actions and
   labelled cards preserve one DOM and one route for each operation. */
.issue-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4, 16px);
}
.issue-areas .kpi {
  min-height: 120px;
}
.issue-areas .selected {
  outline: 2px solid var(--md-sys-color-primary);
}
.item-action-bar {
  align-items: start;
  margin-block: 24px;
}
.other-actions {
  flex: 0 1 420px;
}
.other-actions > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
}
.other-actions .disclosure-content {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.item-purpose-short {
  margin-block: 0 24px;
}
.form-reconnect-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 28px;
}
.form-reconnect-dialog::backdrop {
  background: rgb(0 0 0 / 0.55);
}
/* A nested filter group owns its columns; toolbar sizing only applies to
   direct children, never to fields inside a grid or disclosure. */
.filter-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  flex-basis: 100%;
  grid-column: 1 / -1;
  min-width: 0;
}
.filter-search-row > .filter-actions {
  grid-column: auto;
}
.form-grid.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
@media (max-width: 640px) {
  .filter-search-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .filter-search-row > .filter-actions {
    margin-top: 0;
  }
}
.responsive-filters {
  grid-column: 1/-1;
  flex-basis: 100%;
  min-width: 0;
}
[data-order-filters] .status-filters {
  display: block;
  min-width: 0;
}
.status-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.responsive-filters > summary,
.queue-update-controls > summary {
  display: none;
}
.responsive-filters > .disclosure-content,
.queue-update-controls > .disclosure-content {
  margin: 0;
  padding: 0;
}
@media (max-width: 640px) {
  [data-order-filters] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px 12px;
    padding: 16px;
  }
  [data-order-filters] .status-filters {
    grid-column: 1/-1;
    width: 100%;
    max-width: 100%;
  }
  .status-filter-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 8px;
  }
  [data-order-filters] .status-filters legend {
    margin-bottom: 8px;
  }
  [data-order-filters] .status-filters a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  [data-order-filters] > a {
    grid-column: 2;
  }
  .responsive-filters > summary,
  .queue-update-controls > summary {
    display: list-item;
  }
  .responsive-filters > .disclosure-content,
  .queue-update-controls > .disclosure-content {
    margin-top: 20px;
  }
  .queue-refresh {
    align-items: start;
    gap: 12px;
  }
  .queue-refresh [data-refresh-status] {
    font-size: 12px;
  }
  .order-sync {
    font-size: 11px;
  }
  table.mobile-cards,
  table.mobile-cards > tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }
  table.mobile-cards > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  table.mobile-cards > tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--line);
  }
  table.mobile-cards > tbody > tr > td {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 4px;
    padding: 0;
    border: 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }
  table.mobile-cards > tbody > tr > td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: var(--font-weight-heading);
    opacity: 0.75;
  }
  table.mobile-cards > tbody > tr > td:empty {
    display: none;
  }
  table.mobile-cards > tbody > tr > td[colspan] {
    grid-column: 1/-1;
  }
  .other-actions {
    flex-basis: 100%;
  }
  .batch-entry,
  .purchase-entry {
    padding: 20px 16px;
  }
  .batch-entry.form-grid,
  .purchase-entry .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .issue-areas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Shared surface finishes. Glass belongs to controls and overlays; business data
   stays on opaque surfaces. Screen-only effects leave print layouts unchanged. */
@media screen {
  body {
    background-image:
      radial-gradient(
        ellipse 85vw 620px at 65% -180px,
        color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent),
        transparent
      ),
      radial-gradient(
        ellipse 60vw 700px at 100% 40%,
        color-mix(in srgb, var(--md-sys-color-tertiary) 4%, transparent),
        transparent
      );
  }
  .sidebar {
    background: var(--md-sys-color-surface-container-low);
    box-shadow: inset -1px 0 0 var(--material-edge);
  }
  .topline {
    background: var(--bg);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 45%, transparent);
  }
  .brand-mark {
    box-shadow: 0 2px 8px #001c2020;
  }
  .nav-group :is(a, summary) {
    box-shadow: inset 0 0 0 1px transparent;
    transition: var(--control-transition);
  }
  .nav-group :is(a, summary):is(:hover, :focus-visible) {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md-sys-color-primary) 16%, transparent);
    color: var(--md-sys-color-primary);
  }
  .nav-group .nav-parent.section-active {
    background: color-mix(in srgb, var(--md-sys-color-primary) 9%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
    color: var(--md-sys-color-primary);
  }
  .nav-group a.active {
    background-image: var(--button-sheen);
    box-shadow: var(--material-highlight);
  }
  /* Sorting and listbox options are inline controls, not raised action buttons.
     Keep native button and link sorting visually identical. */
  :is(button, .button):not(.icon-button, .nav-scrim, .sort-heading, [role='option']) {
    background-color: var(--surface);
    background-image: var(--button-sheen);
    border-color: color-mix(in srgb, var(--md-sys-color-outline) 65%, var(--surface));
    box-shadow: var(--material-shadow);
    background-size: 200% 100%;
    background-position: 0% 50%;
    transition: var(--control-transition);
  }
  :is(button, .button):not(.icon-button, .nav-scrim, .sort-heading, [role='option']):hover {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 7%, var(--surface));
    border-color: var(--md-sys-color-primary);
  }
  :is(button, .button).primary {
    background-color: var(--md-sys-color-primary);
    border-color: color-mix(in srgb, var(--md-sys-color-primary) 70%, white);
    box-shadow:
      inset 0 1px 0 #ffffff30,
      0 3px 10px #001c2020;
  }
  :is(button, .button).primary:hover {
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    box-shadow:
      inset 0 1px 0 #ffffff40,
      0 4px 16px #001c2030;
  }
  :is(button, .button).tonal {
    background-color: var(--md-sys-color-secondary-container);
    border-color: var(--material-edge);
  }
  :is(button, .button).danger {
    background-image: none;
    color: var(--md-sys-color-error);
    border-color: var(--md-sys-color-error);
  }
  :is(button, .button).danger:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
  }
  :is(button, .button):not(.icon-button, .nav-scrim, .sort-heading, [role='option']):active {
    box-shadow: inset 0 1px 3px #001c2026;
  }
  :is(button, .button):is(:disabled, [aria-disabled='true']) {
    box-shadow: none;
    background-image: none;
  }
  /* Move the reflection, not the target: no layout shift or perpetual shimmer. */
  @media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    :is(button, .button):not(
        .icon-button,
        .nav-scrim,
        .sort-heading,
        [role='option'],
        :disabled,
        [aria-disabled='true']
      ):is(:hover, :focus-visible) {
      background-position: 100% 50%;
    }
  }
  .icon-button,
  .time-running-link,
  .filter-actions > a,
  .toolbar > a,
  .actions > a:not(.button),
  .sort-heading,
  .breadcrumbs a,
  .account-link {
    transition: var(--control-transition);
  }
  .icon-button:not(:disabled):is(:hover, :focus-visible),
  .time-running-link:is(:hover, :focus-visible) {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 9%, var(--surface));
    box-shadow: var(--glass-rim);
    color: var(--md-sys-color-primary);
    text-decoration: none;
  }
  .time-header-controls,
  .global-search {
    background-color: var(--surface);
    background-image: var(--glass-sheen);
    box-shadow: var(--glass-shadow);
  }
  .time-header-controls {
    border-color: var(--material-edge);
  }
  .global-search {
    box-shadow:
      inset 0 0 0 1px var(--material-edge),
      var(--glass-shadow);
  }
  .panel,
  .kpi,
  .toolbar,
  .login-card {
    background-color: var(--surface);
    background-image: var(--material-tint);
    border-color: var(--material-edge);
    box-shadow: var(--material-shadow);
  }
  .form-section,
  [data-contents],
  [data-labor-editor],
  .purchase-entry,
  .permission-group,
  .other-actions .disclosure-content {
    background-color: var(--surface);
    background-image: var(--material-tint);
    border-color: var(--material-edge);
    box-shadow: var(--glass-rim);
    transition: var(--control-transition);
  }
  .batch-entry {
    background-color: var(--surface);
    background-image: var(--material-tint);
    border-radius: 12px;
    box-shadow: var(--glass-rim);
    transition: var(--control-transition);
  }
  .form-section:focus-within,
  [data-contents]:focus-within,
  [data-labor-editor]:focus-within,
  .purchase-entry:focus-within,
  .permission-group:focus-within,
  .batch-entry:focus-within {
    border-color: color-mix(in srgb, var(--md-sys-color-primary) 55%, var(--line));
  }
  .kpi:first-child {
    background-color: var(--md-sys-color-primary-container);
    background-image: var(--accent-wash);
    border-color: color-mix(
      in srgb,
      var(--md-sys-color-primary) 25%,
      var(--md-sys-color-primary-container)
    );
  }
  .actionable-kpi,
  .workspace-card {
    transition: var(--control-transition);
  }
  .actionable-kpi:is(:hover, :focus-visible),
  .workspace-card:is(:hover, :focus-visible) {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--material-raised);
    text-decoration: none;
  }
  .status-filters a,
  .source-option {
    background-color: var(--surface);
    background-image: var(--glass-sheen);
    border-color: var(--material-edge);
    border-radius: var(--md-sys-shape-corner-full);
    box-shadow: var(--glass-rim);
    transition: var(--control-transition);
  }
  .status-filters a:is(:hover, :focus-visible),
  .source-option:is(:hover, :focus-within) {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--glass-shadow);
    text-decoration: none;
  }
  .status-filters a.selected,
  .source-option:has(input:checked) {
    background-color: var(--md-sys-color-secondary-container);
    background-image: var(--glass-sheen);
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--glass-shadow);
  }
  .item-catalog-tabs {
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    padding: 6px;
    background-color: var(--md-sys-color-surface-container-low);
    background-image: var(--glass-sheen);
    border: 1px solid var(--material-edge);
    border-radius: 28px;
    box-shadow: var(--glass-rim);
  }
  .item-catalog-tabs .button {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--muted);
  }
  .item-catalog-tabs .button:is(:hover, :focus-visible) {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 7%, var(--surface));
    color: var(--md-sys-color-primary);
  }
  .item-catalog-tabs .button[aria-current] {
    background-color: var(--surface);
    background-image: var(--glass-sheen);
    border-color: var(--material-edge);
    box-shadow: var(--glass-shadow);
    color: var(--md-sys-color-primary);
  }
  th {
    background-image: linear-gradient(
      180deg,
      color-mix(
        in srgb,
        var(--md-sys-color-surface-container-low) 95%,
        var(--md-sys-color-primary)
      ),
      var(--md-sys-color-surface-container-low)
    );
  }
  .pagination {
    background-color: var(--md-sys-color-surface-container-lowest);
    background-image: var(--material-tint);
  }
  tbody > tr,
  .dimension-row,
  .attention-row {
    transition: background-color 180ms var(--md-sys-motion-standard);
  }
  tbody > tr:focus-within,
  .dimension-row:has(a):is(:hover, :focus-within),
  .attention-row:is(:hover, :focus-within) {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 5%, var(--surface));
  }
  .rank,
  .kpi-comparison > span,
  .login-features > span,
  .avatar {
    background-image: var(--glass-sheen);
    box-shadow: var(--glass-rim);
  }
  .badge {
    background-image: var(--glass-sheen);
    border-radius: var(--md-sys-shape-corner-full);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent),
      var(--glass-rim);
  }
  .notice,
  .notice.success,
  .notice[role='alert'] {
    background-image: var(--glass-sheen);
    border-radius: 16px;
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent),
      var(--glass-rim);
  }
  .disclosure > summary {
    border-radius: 12px;
    transition: var(--control-transition);
  }
  .disclosure > summary:is(:hover, :focus-visible) {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent);
  }
  .disclosure[open] > summary {
    color: var(--md-sys-color-primary);
  }
  summary::before {
    transition: transform 240ms var(--md-sys-motion-standard);
  }
  .theme-option {
    background-color: var(--surface);
    background-image: var(--glass-sheen);
    box-shadow: var(--material-shadow);
    transition: var(--control-transition);
  }
  .theme-option:is(:hover, :focus-within) {
    border-color: var(--md-sys-color-primary);
    box-shadow: var(--glass-shadow);
  }
  .theme-option:has(:checked) {
    background-color: var(--md-sys-color-primary-container);
    background-image: var(--accent-wash);
    box-shadow:
      inset 0 0 0 1px var(--md-sys-color-primary),
      var(--glass-shadow);
  }
  .empty .empty-icon,
  .login-symbol {
    background-image: var(--glass-sheen);
    box-shadow: var(--glass-rim);
  }
  input:not([type='checkbox'], [type='radio'], [type='range'], [type='color']),
  select,
  textarea {
    border-radius: var(--md-sys-shape-corner-medium);
    transition:
      border-color 160ms var(--md-sys-motion-standard),
      box-shadow 160ms var(--md-sys-motion-standard);
  }
  input:focus,
  select:focus,
  textarea:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
  }
  input[type='checkbox'],
  input[type='radio'] {
    transition: box-shadow 180ms var(--md-sys-motion-standard);
  }
  input:is([type='checkbox'], [type='radio']):enabled:hover {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent);
  }
  /* Native file controls share the same finish on imports and profile uploads. */
  input[type='file']::file-selector-button {
    font: inherit;
    color: var(--md-sys-color-on-secondary-container);
    background-color: var(--md-sys-color-secondary-container);
    background-image: var(--button-sheen);
    border: 0;
    border-radius: 16px;
    padding: 6px 12px;
    margin-right: 12px;
    box-shadow: var(--glass-rim);
    cursor: pointer;
    transition: var(--control-transition);
  }
  input[type='file']:enabled::file-selector-button:hover {
    background-color: color-mix(
      in srgb,
      var(--md-sys-color-secondary-container) 88%,
      var(--md-sys-color-primary)
    );
    box-shadow: var(--glass-shadow);
  }
  dialog,
  .item-picker-popup,
  .supplier-results,
  .time-tag-suggestions,
  .hub-tooltip,
  .time-header-message,
  .time-header-connection {
    background-color: var(--surface);
    background-image: var(--glass-sheen);
    border-color: var(--material-edge);
    box-shadow:
      var(--glass-rim),
      0 16px 48px #001c2038,
      0 0 0 1px var(--material-edge);
  }
  dialog .field-label {
    background: var(--surface);
  }
  .customer-results [role='option'],
  .time-tag-suggestions [role='option'] {
    background: transparent;
    box-shadow: none;
    border: 0;
    border-radius: 10px;
    color: var(--ink);
  }
  .customer-results [role='option'],
  .time-tag-suggestions [role='option'],
  .item-picker-option {
    transition: background-color 160ms var(--md-sys-motion-standard);
  }
  .customer-results [role='option']:hover,
  .customer-results [role='option'][aria-selected='true'],
  .time-tag-suggestions [role='option']:hover,
  .time-tag-suggestions [role='option'][aria-selected='true'],
  .item-picker-option:hover,
  .item-picker-option[aria-selected='true'] {
    background-color: var(--md-sys-color-secondary-container);
    background-image: var(--glass-sheen);
    color: var(--md-sys-color-on-secondary-container);
  }
  .login-intro {
    background-image: var(--accent-wash);
    box-shadow: var(--material-highlight);
  }
  @media (max-width: 800px) {
    .login-intro {
      background-image: none;
      box-shadow: none;
    }
  }
  /* Blur only the navigation and temporary overlays, never repeating cards,
     table cells or individual buttons. Solid fallbacks work without filters. */
  @supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    .sidebar,
    .topline {
      -webkit-backdrop-filter: blur(24px) saturate(140%);
      backdrop-filter: blur(24px) saturate(140%);
    }
    .sidebar {
      background-color: color-mix(
        in srgb,
        var(--md-sys-color-surface-container-low) 85%,
        transparent
      );
      background-image: var(--glass-sheen);
    }
    .topline {
      background-color: color-mix(in srgb, var(--bg) 84%, transparent);
      background-image: var(--glass-sheen);
    }
    .item-picker-popup,
    .supplier-results,
    .time-tag-suggestions,
    .hub-tooltip {
      background-color: color-mix(in srgb, var(--surface) 94%, transparent);
      -webkit-backdrop-filter: blur(16px) saturate(130%);
      backdrop-filter: blur(16px) saturate(130%);
    }
    dialog::backdrop {
      -webkit-backdrop-filter: blur(3px);
      backdrop-filter: blur(3px);
    }
  }
  @media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
    :root {
      --material-tint: none;
      --accent-wash: none;
      --button-sheen: none;
      --glass-sheen: none;
      --glass-rim: inset 0 0 0 transparent;
      --glass-shadow: none;
    }
    .sidebar,
    .topline,
    dialog,
    dialog::backdrop,
    .item-picker-popup,
    .supplier-results,
    .time-tag-suggestions,
    .hub-tooltip {
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
    .sidebar {
      background: var(--md-sys-color-surface-container-low);
    }
    .topline {
      background: var(--bg);
    }
    dialog,
    .item-picker-popup,
    .supplier-results,
    .time-tag-suggestions,
    .hub-tooltip {
      background-color: var(--surface);
    }
    body,
    .panel,
    .kpi,
    .toolbar,
    .form-section,
    [data-contents],
    [data-labor-editor],
    .purchase-entry,
    .permission-group,
    .batch-entry,
    .other-actions .disclosure-content,
    .login-card,
    .login-intro,
    .time-header-controls,
    .global-search,
    .nav-group :is(a, summary),
    .status-filters a,
    .source-option,
    th,
    input[type='file']::file-selector-button,
    :is(button, .button):not(.icon-button, .nav-scrim, .sort-heading, [role='option']) {
      background-image: none;
      box-shadow: none;
    }
    .panel,
    .kpi,
    .toolbar,
    .form-section,
    [data-contents],
    [data-labor-editor],
    .purchase-entry,
    .permission-group,
    .login-card,
    .time-header-controls {
      border-color: var(--md-sys-color-outline);
    }
  }
}

/* Independent sales explorer: keep filter widths useful at every viewport. */
.trend-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
}
.trend-filter-grid--dates {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.trend-filter-grid .field,
.trend-picker {
  min-width: 0;
  width: 100%;
}
.trend-picker {
  position: relative;
}
.trend-picker .item-picker-popup {
  z-index: 12;
}
.trend-picker .item-picker-option {
  overflow-wrap: anywhere;
}
.trend-actions {
  justify-content: space-between;
}
.trend-summary {
  display: flex;
  align-items: center;
  gap: 24px;
}
.trend-summary > div {
  flex: 0 0 auto;
}
.trend-summary strong {
  display: block;
  font-size: clamp(26px, 3vw, 38px);
  font-variant-numeric: tabular-nums;
}
.trend-summary p {
  overflow-wrap: anywhere;
}
.sales-history-chart {
  height: 400px;
}
.order-size-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
}
.order-size-summary > div {
  display: grid;
  gap: 0.5rem;
}
.order-size-summary strong {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}
.order-size-chart {
  height: 340px;
  min-width: 0;
}
[data-order-sizes] table th {
  white-space: normal;
}
@media (max-width: 640px) {
  [data-order-sizes] table th,
  [data-order-sizes] table td {
    padding: 12px 8px;
    font-size: 12px;
  }
}
.trend-table {
  max-height: 440px;
}
@media (max-width: 1100px) {
  .trend-filter-grid--dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .trend-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .trend-filter-grid--dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }
  .trend-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .sales-history-chart {
    height: 280px;
  }
}
@media print {
  [data-trend-form] {
    display: none;
  }
}
.trend-picker .item-picker-popup {
  position: absolute;
  inset: calc(100% + 4px) 0 auto;
  max-height: 320px;
}

/* Product photography: compact in working lists, full detail only on the item page. */
.product-image {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  vertical-align: middle;
  border: 1px solid var(--line);
  background: #fff;
  color: #637772;
  border-radius: 10px;
}
.product-image--thumb {
  width: 44px;
  height: 44px;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-image--thumb img {
  padding: 3px;
}
.product-image--detail {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  border-radius: 24px;
}
.product-image--detail img {
  padding: clamp(12px, 2vw, 24px);
}
.part-image-figure {
  margin: 0;
  min-width: 0;
}
.part-image-figure figcaption {
  margin-top: 12px;
  max-width: 480px;
}
.product-image > .icon {
  /* The bundled symbol font has no image glyph. Share one SVG fallback across
     server-rendered images, client-side choices and failed image requests. */
  font-size: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8' cy='8' r='1.5'/%3E%3Cpath d='m3 17 5-5 4 4 4-6 5 7'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.product-image--detail > .icon {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
}
.product-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  vertical-align: middle;
}
.product-label > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.product-hero {
  display: grid;
  grid-template-columns: minmax(260px, 480px) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  margin-block: 24px;
}
.product-hero > div {
  min-width: 0;
}
.product-image-editor-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
[data-item-image] {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
[data-image-preview] {
  display: inline-flex;
  flex-shrink: 0;
}
.product-image-editor-row .product-image {
  width: 112px;
  height: 112px;
}
.product-image-editor-row p {
  margin: 0;
}
.product-image-editor input[type='file'] {
  max-width: 100%;
}
.item-picker-selection:has(.product-image) {
  display: flex;
  align-items: center;
  gap: 10px;
}
.item-picker-option.item-picker-option--image {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
}
.item-picker-option--image > .product-image {
  grid-row: 1 / span 2;
}
.item-picker-option--image > strong,
.item-picker-option--image > span:not(.product-image) {
  grid-column: 2;
}
.order-products-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metadata-hint > .product-label {
  margin-block: 4px;
  margin-inline-end: 12px;
}
@media (max-width: 1200px) {
  .product-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .product-image--detail {
    max-width: 400px;
    justify-self: center;
  }
}
/* Raw NFC payloads must wrap safely on small screens. */
.nfc-code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  padding: 1rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  font-size: 0.85rem;
}
.nfc-details {
  margin: 0;
}
.nfc-details > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.nfc-details dt {
  font-weight: 600;
}
.nfc-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.account-setup {
  width: min(100% - 32px, 800px);
  margin: 32px auto;
  overflow-wrap: anywhere;
}
.setup-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 0;
  list-style: none;
  color: var(--md-sys-color-on-surface-variant);
}
.setup-progress [aria-current='step'] {
  font-weight: 700;
  color: var(--md-sys-color-primary);
}
@media (max-width: 600px) {
  .nfc-details > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

/* SKU registry: identifiers and read-only shop correspondence. */
.sku-reference {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 9rem;
}
.sku-reference strong {
  overflow-wrap: anywhere;
}
button.sku-copy {
  padding: 0.35rem 0.65rem;
  min-height: 2rem;
  font-size: 0.75rem;
}
.sku-shop-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
.sku-shop-checks p {
  margin: 0.3rem 0 0;
}

.sku-check-summary .section-heading {
  flex-wrap: wrap;
  gap: 1rem;
}
.sku-check-summary .actions,
.sku-check-summary form {
  max-width: 100%;
}
.sku-check-summary button,
.sku-check-summary .button {
  white-space: normal;
  text-align: center;
}

/* Attachment actions must fit narrow item cards without widening the page. */
#attachments > .section-heading {
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .attachment-table.mobile-cards td:last-child {
    grid-column: 1 / -1;
  }
}

/* Cost comparisons retain independent horizontal table scrolling on narrow screens. */
.cost-comparison > div,
.acquisition-entry {
  min-width: 0;
}
.cost-breakdown td:first-child {
  white-space: normal;
}
.acquisition-entry {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: var(--space-6);
}
.acquisition-entry legend {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* One responsive PDF viewport for purchase documents, proformas and customer POs.
   Keep sizing in this stylesheet: the CSP intentionally blocks inline styles. */
.document-pdf-preview {
  display: block;
  width: 100%;
  height: min(75vh, 800px);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.customer-po-field input[type='file'] {
  max-width: 100%;
}
#email-form .customer-po-field {
  margin-block-start: var(--space-6);
}
.customer-po-field p,
#customer-po > p {
  overflow-wrap: anywhere;
}

/* Order queue: keep the order, its contents and next action on one calm row. */
.order-cards {
  table-layout: fixed;
}
.order-cards > thead > tr > th:nth-child(1) {
  width: 22%;
}
.order-cards > thead > tr > th:nth-child(2) {
  width: 28%;
}
.order-cards > thead > tr > th:nth-child(3) {
  width: 28%;
}
.order-cards > thead > tr > th:nth-child(4) {
  width: 22%;
}
.order-cards.queue-without-invoice > thead > tr > th:nth-child(1) {
  width: 30%;
}
.order-cards.queue-without-invoice > thead > tr > th:nth-child(2) {
  width: 35%;
}
.order-cards.queue-without-invoice > thead > tr > th:nth-child(3) {
  width: 35%;
}
.order-cards > tbody > tr > td {
  vertical-align: top;
  padding: 18px 20px;
  height: auto;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.order-cards > thead > tr > th {
  padding-inline: 20px;
}
.queue-order-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.queue-order-number {
  font-size: 16px;
  font-weight: var(--font-weight-heading);
}
.order-customer {
  margin: 7px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.queue-source {
  margin-top: 8px;
}
.queue-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.queue-order-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 8px;
}
.queue-country {
  font-size: 11px;
  font-weight: var(--font-weight-label);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.order-cards .queue-country {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding: 0;
  border: 0;
}
.queue-country-flag {
  flex: 0 0 auto;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 16px;
  line-height: 1;
}
.queue-product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.queue-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.queue-product .product-label {
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  gap: 9px;
}
.queue-product .product-label small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}
.queue-product .product-label > span:last-child {
  overflow-wrap: anywhere;
  min-width: 0;
}
.queue-product .product-image {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.queue-product .product-image:not(:has(img)) {
  background: var(--md-sys-color-surface-container);
  color: var(--muted);
  border-color: transparent;
}
.queue-product .product-image > .icon {
  width: 16px;
  height: 16px;
}
.queue-product-qty {
  flex: 0 0 auto;
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  font-weight: var(--font-weight-label);
  font-variant-numeric: tabular-nums;
}
.queue-units {
  margin-top: 10px;
}
.queue-more {
  margin-top: 8px;
}
.queue-more > summary {
  font-size: 12px;
  font-weight: var(--font-weight-label);
  color: var(--md-sys-color-primary);
  width: fit-content;
  min-height: 32px;
  padding: 4px 0;
}
.queue-more > summary::before {
  width: 16px;
  flex-basis: 16px;
}
.queue-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.order-cards .queue-cell-stack > * {
  margin: 0;
}
.queue-schedule {
  display: block;
  font-size: 12px;
  margin-block: 6px;
}
.queue-picking {
  display: inline-block;
  font-size: 12px;
  padding-block: 7px;
}
.queue-attention {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--md-sys-color-error);
}
.queue-invoice-actions {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}
.queue-invoice-actions > .button {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
}
.queue-external-invoice {
  font-size: 12px;
  padding-block: 6px;
}
.queue-invoice-number {
  display: inline-block;
  font-weight: var(--font-weight-label);
  margin-bottom: 5px;
}
.queue-reference {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
#order-picking {
  scroll-margin-top: 90px;
}
@media (max-width: 1200px) {
  table.order-cards,
  table.order-cards > tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }
  table.order-cards > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  table.order-cards > tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    padding: 22px 18px;
    border-bottom: 1px solid var(--line);
  }
  table.order-cards > tbody > tr > td {
    display: block;
    min-width: 0;
    width: auto;
    padding: 0;
    border: 0;
  }
  table.order-cards > tbody > tr > td::before {
    display: block;
    content: attr(data-label);
    font-size: 11px;
    font-weight: var(--font-weight-label);
    color: var(--muted);
    margin-bottom: 10px;
  }
  table.order-cards > tbody > tr > .queue-order {
    grid-column: 1 / -1;
  }
  table.order-cards > tbody > tr > .queue-order::before {
    display: none;
  }
  .queue-order-heading {
    margin: 0 0 4px;
  }
  .queue-order-meta {
    margin-top: 4px;
  }
  table.order-cards > tbody > tr > .queue-products {
    grid-column: 1 / -1;
    border-block: 1px solid var(--md-sys-color-surface-container-high);
    padding-block: 14px;
  }
  table.order-cards > tbody > tr > .queue-products::before {
    display: none;
  }
  .queue-product .product-image {
    width: 32px;
    height: 32px;
  }
  .queue-product .product-label {
    font-size: 14px;
  }
  .queue-more > summary,
  .queue-picking,
  .queue-external-invoice {
    min-height: 36px;
  }
  .queue-invoice-actions > .button {
    min-height: 42px;
    padding-inline: 12px;
  }
}
@media (max-width: 370px) {
  table.order-cards > tbody > tr > .queue-invoice {
    grid-column: 1 / -1;
  }
}
.queue-product-list--compact {
  gap: 6px;
  max-width: 360px;
}
.queue-product-list--compact .queue-product {
  gap: 6px;
}
.queue-product-list--compact .queue-product::after {
  /* Actual periods share the text baseline; the empty alternative is decorative. */
  content: '................................................................................................................................................................' /
    '';
  order: 1;
  flex: 1 1 0;
  min-width: 12px;
  overflow: hidden;
  white-space: nowrap;
  color: color-mix(in srgb, var(--muted) 35%, transparent);
  font-size: 13px;
  line-height: 1.4;
}
.queue-product-list--compact .queue-product-qty {
  order: 2;
  min-width: 0;
}
.queue-product-list--compact .product-label {
  font-size: 13px;
  line-height: 1.4;
  gap: 8px;
}
.queue-product-list--compact .product-image {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
}
.queue-product-list--compact .product-image > .icon {
  width: 14px;
  height: 14px;
}

/* Mixed manual sale rows keep the selected product and its pricing together. */
#email-form #email-lines {
  width: 100%;
  table-layout: fixed;
}
#email-form #email-lines th:first-child {
  width: 40%;
}
#email-form #email-lines th:nth-child(2) {
  width: 14%;
}
#email-form #email-lines th:nth-child(3) {
  width: 23%;
}
#email-form #email-lines th:nth-child(4) {
  width: 17%;
}
#email-form #email-lines th:last-child {
  width: 6%;
}
#email-form #email-lines td,
#email-form #email-lines td input,
#email-form #email-lines td select,
#email-form #email-lines td textarea {
  min-width: 0;
}
#email-form #email-lines td {
  white-space: normal;
  overflow-wrap: anywhere;
}
#email-form #email-lines .email-line-choice > .field {
  margin-bottom: 12px;
}
#email-form #email-lines output {
  min-width: 0;
  padding-block: 8px;
}
#email-form #email-lines [data-counterpart] {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 1050px) {
  #email-form #email-lines,
  #email-form #email-lines tbody {
    display: block;
  }
  #email-form #email-lines thead {
    display: none;
  }
  #email-form #email-lines tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-block: 16px;
    border-bottom: 1px solid var(--line);
  }
  #email-form #email-lines td {
    display: block;
    height: auto;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  #email-form #email-lines td:first-child {
    grid-column: 1 / -1;
  }
  #email-form #email-lines td:nth-child(2)::before {
    content: 'Quantity';
  }
  #email-form #email-lines td:nth-child(3)::before {
    content: 'Unit price (€)';
  }
  #email-form #email-lines td:nth-child(4)::before {
    content: 'Line total incl. VAT';
  }
  #email-form #email-lines td::before {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
  }
  #email-form #email-lines td:last-child {
    text-align: right;
  }
}

/* Home keeps action counts separate from the quieter supporting work. */
.home-refresh,
.home-waiting,
.home-sync,
.home-replenish-heading,
.home-order-heading,
.home-order-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.home-refresh {
  margin: 0 0 18px;
  min-height: 42px;
}
.home-refresh .actions[hidden] {
  display: none;
}
.home-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}
.home-kpi {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.home-kpi-link {
  display: block;
  padding: 22px 24px;
  flex: 1;
  color: inherit;
  transition: var(--control-transition);
}
.home-kpi-link:is(:hover, :focus-visible) {
  text-decoration: none;
  background: color-mix(in srgb, var(--md-sys-color-primary) 7%, transparent);
}
.home-kpi .kpi-heading {
  margin-bottom: 10px;
}
.home-kpi-link > strong {
  font-size: 38px;
  font-weight: 600;
}
.home-kpi-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.home-kpi-amount {
  display: block;
  margin-top: 8px;
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.home-sales {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.home-kpi-link > .home-sales-value {
  display: block;
  font-size: clamp(24px, 2.5vw, 34px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.home-kpi-period,
.home-kpi-warning {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.home-kpi-warning {
  font-weight: 600;
}
.home-kpi-zero .home-kpi-link > strong {
  color: var(--muted);
}
.home-kpi-invoicing {
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 36%, var(--line));
}
.home-invoice-split {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.home-invoice-split strong {
  display: inline;
  font-size: 14px;
  letter-spacing: 0;
}
.home-waiting {
  justify-content: flex-start;
  gap: 12px 24px;
  padding: 18px 2px 24px;
  font-size: 13px;
}
.home-waiting a {
  color: var(--text);
}
.home-waiting a strong {
  color: var(--md-sys-color-primary);
  margin-left: 6px;
}
.home-overlap-note {
  margin-left: auto;
}
.home-worklists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.home-worklists-single {
  grid-template-columns: 1fr;
}
.home-orders .section-heading {
  align-items: start;
  gap: 16px;
}
.home-orders .section-heading p {
  margin: 6px 0 0;
}
.home-orders .section-heading > a {
  font-size: 13px;
  white-space: nowrap;
}
.home-count {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.home-order {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.home-order:first-child {
  padding-top: 10px;
  border-top: 0;
}
.home-order:last-child {
  padding-bottom: 0;
}
.home-order-heading > a {
  font-size: 16px;
}
.home-order-age {
  font-size: 12px;
  color: var(--muted);
}
.home-order-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 14px;
}
.home-orders .queue-product-list {
  gap: 7px;
}
.home-orders .queue-product {
  font-size: 13px;
}
.home-orders .product-image {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}
.home-more-products {
  display: inline-block;
  margin: 8px 0 0;
  font-size: 12px;
}
.home-order-status {
  justify-content: flex-start;
  margin-top: 14px;
  gap: 8px;
}
.home-order-status > a {
  margin-left: auto;
  font-size: 12px;
}
.home-empty {
  color: var(--muted);
  padding: 24px 0;
  text-align: center;
}
.home-empty > .icon {
  color: var(--md-sys-color-primary);
  font-size: 28px;
}
.home-stock .section-heading h2 {
  margin: 4px 0 0;
}
.home-stock .section-heading .eyebrow {
  margin: 0;
}
.home-stock-tasks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin: 20px 0 28px;
}
.home-stock-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  background: var(--material-tint), var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  transition: var(--control-transition);
}
.home-stock-task:is(:hover, :focus-visible) {
  text-decoration: none;
  border-color: var(--md-sys-color-primary);
}
.home-stock-task > strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--md-sys-color-primary);
}
.home-replenish-heading h3 {
  margin: 0;
}
.home-replenish-heading > a {
  font-size: 13px;
}
.home-replenish-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
}
.home-replenish-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 14px;
}
.home-replenish-item > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.home-replenish-item > span:last-child {
  text-align: right;
  flex-shrink: 0;
}
.home-replenish-item small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}
.home-sync {
  justify-content: flex-start;
  gap: 14px 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 24px;
}
.home-sync small {
  display: block;
  margin-top: 4px;
}
.home-sync > a {
  margin-left: auto;
  font-size: 13px;
}
.home-sync-warning {
  border-color: var(--md-sys-color-error);
  background: color-mix(in srgb, var(--md-sys-color-error) 6%, var(--surface));
}
@media (max-width: 1050px) {
  .home-worklists {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .home-overlap-note {
    width: 100%;
    margin: 0;
  }
}
@media (max-width: 600px) {
  .home-sales {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .home-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .home-kpi-link {
    padding: 16px;
  }
  .home-kpi .kpi-heading {
    align-items: start;
    gap: 6px;
  }
  .home-kpi .kpi-label {
    font-size: 12px;
  }
  .home-kpi .kpi-heading .icon {
    font-size: 18px;
  }
  .home-kpi-link > strong {
    font-size: 30px;
  }
  .home-kpi-hint {
    font-size: 11px;
  }
  .home-invoice-split {
    padding: 10px 16px;
    gap: 6px;
  }
  .home-refresh {
    align-items: start;
  }
  .home-refresh .actions {
    gap: 8px;
  }
  .home-refresh button {
    font-size: 12px;
    min-height: 36px;
    padding: 6px 12px;
  }
  .home-replenish-list {
    grid-template-columns: 1fr;
  }
  .home-order-status > a {
    width: 100%;
    margin: 4px 0 0;
  }
  .home-sync {
    align-items: start;
    flex-direction: column;
  }
  .home-sync > a {
    margin: 0;
  }
}
.home-icon {
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .home-kpi .home-icon {
    width: 18px;
    height: 18px;
  }
}

/* Country selectors keep the native select as a no-JavaScript fallback. */
.country-field {
  position: relative;
}
.country-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  max-height: min(18rem, 40vh);
  padding: 0.5rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 1rem;
  background: var(--md-sys-color-surface-container-high);
  box-shadow: 0 8px 28px #0003;
}
.country-options button {
  min-height: 2.5rem;
}
[data-customer-editor] [hidden] {
  display: none !important;
}
.customer-internal-notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Production work queue */
.aq-item {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 220px;
}
.aq-item img {
  object-fit: contain;
  background: white;
  border-radius: 10px;
  flex: none;
}
.aq-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.aq-totals strong {
  display: block;
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}
.aq-note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.aq-completion {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
@media (max-width: 640px) {
  .aq-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
