@font-face {
  font-family: "ProximaSoft";
  src: url("./assets/fonts/proximasoft/ProximaSoft-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ProximaSoft";
  src: url("./assets/fonts/proximasoft/ProximaSoft-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Martian Mono";
  src: url("./assets/fonts/martian-mono/MartianMonoCondensed-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-stretch: condensed;
  font-display: swap;
}

:root {
  --color-brand-red: #c23b4d;
  --color-danger: #963440;
  --color-surface-light: #eeeeee;
  --color-bg: #272727;
  --color-text: var(--color-surface-light);
  --color-muted: #1f1d1d;
  --color-surface-dark: #303030;
  --color-line-dark: #424242;
  --color-success: #25724f;
  --color-warning: #a56714;
  --color-status-success-bg: #dff0e6;
  --color-status-warning-bg: var(--color-surface-light);
  --color-status-danger-bg: #f1dada;
  --color-notice-border: var(--color-warning);
  --color-notice-bg: var(--color-surface-light);
  --color-notice-text: var(--color-muted);
  --color-error-border: #e0a0a0;
  --color-error-bg: #fff0f0;
  --color-success-border: #9fd3b6;
  --color-success-bg: #effaf3;
  --color-shadow: rgba(0, 0, 0, 0.26);
  --color-accent-tint: rgba(194, 59, 77, 0.24);
  --color-focus-ring: rgba(194, 59, 77, 0.34);
  --color-on-dark-subtle: rgba(238, 238, 238, 0.08);
  --color-on-dark-line: rgba(238, 238, 238, 0.18);
  --color-on-dark-border: rgba(238, 238, 238, 0.24);
  --color-on-dark-dim: rgba(238, 238, 238, 0.62);
  --color-on-dark-muted: rgba(238, 238, 238, 0.68);
  --color-on-dark-strong: rgba(238, 238, 238, 0.78);
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--color-bg);
  --surface: var(--color-muted);
  --surface-2: var(--color-surface-dark);
  --ink: var(--color-text);
  --muted: var(--color-on-dark-muted);
  --line: var(--color-line-dark);
  --sidebar-bg: var(--color-muted);
  --sidebar-ink: var(--color-text);
  --sidebar-muted: var(--color-on-dark-dim);
  --sidebar-line: var(--color-on-dark-line);
  --sidebar-control-bg: var(--color-on-dark-subtle);
  --sidebar-control-line: var(--color-on-dark-border);
  --nav-ink: var(--color-on-dark-strong);
  --nav-active-ink: var(--color-text);
  --accent: var(--color-brand-red);
  --accent-strong: var(--color-brand-red);
  --accent-soft: var(--color-brand-red);
  --action-contrast: var(--color-text);
  --ok: var(--color-success);
  --warn: var(--color-warning);
  --bad: var(--color-danger);
  --focus: var(--color-brand-red);
  --shadow: 0 16px 40px var(--color-shadow);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: var(--color-surface-light);
  --surface: #ffffff;
  --surface-2: var(--color-surface-light);
  --ink: var(--color-muted);
  --muted: var(--color-line-dark);
  --line: rgba(31, 29, 29, 0.24);
  --sidebar-bg: var(--color-muted);
  --sidebar-ink: var(--color-text);
  --sidebar-muted: var(--color-on-dark-dim);
  --sidebar-line: var(--color-on-dark-line);
  --sidebar-control-bg: var(--color-on-dark-subtle);
  --sidebar-control-line: var(--color-on-dark-border);
  --nav-ink: var(--color-on-dark-strong);
  --nav-active-ink: var(--color-text);
  --accent: var(--color-brand-red);
  --accent-strong: var(--color-brand-red);
  --accent-soft: var(--color-brand-red);
  --action-contrast: var(--color-text);
  --ok: var(--color-success);
  --warn: var(--color-warning);
  --bad: var(--color-danger);
  --focus: var(--color-brand-red);
  --shadow: 0 16px 40px var(--color-shadow);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "ProximaSoft", Arial, sans-serif;
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0 0 0 0);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  min-height: 36px;
  max-width: 100%;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.technical-code {
  font-family: "Martian Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 600;
  font-stretch: condensed;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.technical-code--small {
  font-size: 13px;
}

.technical-code--large {
  font-size: 21px;
}

.technical-code--uppercase {
  text-transform: uppercase;
}

.copyable-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  vertical-align: middle;
  line-height: 1.25;
}

.copyable-code__value {
  min-width: 0;
  max-width: 100%;
}

.copy-code-button {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  opacity: 0.52;
}

.copyable-code:hover .copy-code-button,
.copy-code-button:focus-visible {
  opacity: 1;
}

.copy-code-icon {
  position: relative;
  width: 15px;
  height: 15px;
  display: block;
}

.copy-code-icon::before,
.copy-code-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.copy-code-icon::before {
  top: 1px;
  left: 5px;
}

.copy-code-icon::after {
  top: 5px;
  left: 1px;
  background: var(--surface);
}

.copy-code-button.is-copied {
  color: var(--ok);
  border-color: var(--ok);
  opacity: 1;
}

.copy-code-button.is-copied .copy-code-icon::before {
  top: 0;
  left: 5px;
  width: 6px;
  height: 11px;
  border: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0;
  transform: rotate(45deg);
}

.copy-code-button.is-copied .copy-code-icon::after {
  display: none;
}

.copy-code-button.is-error {
  color: var(--bad);
  border-color: var(--bad);
  opacity: 1;
}

.sr-only {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--action-contrast);
}

.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.danger {
  border-color: var(--color-danger);
  color: var(--bad);
}

.boot,
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  color-scheme: dark;
  --bg: var(--color-bg);
  --surface: var(--color-muted);
  --surface-2: var(--color-surface-dark);
  --ink: var(--color-text);
  --muted: var(--color-on-dark-muted);
  --line: var(--color-line-dark);
  --accent: var(--color-brand-red);
  --accent-strong: var(--color-brand-red);
  --action-contrast: var(--color-text);
  background: var(--color-brand-red);
  color: var(--color-text);
  animation: login-brand-background 20s ease-in-out infinite;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-bg);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-mark {
  position: relative;
  width: clamp(41px, 5.4vw, 53px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.boot-frame,
.boot-logo {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.boot-frame {
  inset: 0;
  width: 100%;
  height: 100%;
  animation: boot-frame-spin 2s infinite;
  animation-timing-function: cubic-bezier(0.72, 0, 0.28, 1);
  transform-origin: 50% 50%;
}

.boot-logo {
  width: 58%;
  height: auto;
}

.app,
.login-shell,
.public-shell {
  animation: app-enter 260ms ease both;
}

.login-shell {
  animation: app-enter 260ms ease both, login-brand-background 20s ease-in-out infinite;
}

@keyframes boot-frame-spin {
  0% {
    transform: rotate(0deg);
  }
  18% {
    transform: rotate(18deg);
  }
  46% {
    transform: rotate(210deg);
  }
  68% {
    transform: rotate(252deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes app-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes login-brand-background {
  0%,
  100% {
    background: var(--color-brand-red);
  }

  33.333% {
    background: var(--color-bg);
  }

  66.666% {
    background: rgb(225, 225, 225);
  }
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-panel-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
  padding-block: clamp(42px, 6vh, 66px);
}

.maestro-login-mark {
  display: grid;
  width: 100%;
  place-items: center;
}

.maestro-login-word {
  display: inline-grid;
  grid-template-columns: repeat(7, 1ch);
  justify-content: center;
  width: min(52%, 220px);
  min-width: min(100%, 176px);
  color: var(--color-text);
  font-family: "Martian Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(30px, 9vw, 44px);
  font-weight: 700;
  font-stretch: condensed;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
}

.maestro-char {
  display: inline-grid;
  width: 1ch;
  place-items: center;
  transition: transform 180ms ease, opacity 180ms ease;
}

.maestro-char.is-changing-out {
  opacity: 0;
  transform: translateY(-0.45em);
}

.maestro-char.is-digit {
  animation: maestro-digit-in 180ms ease both;
}

@keyframes maestro-digit-in {
  from {
    opacity: 0;
    transform: translateY(0.45em);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-panel p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.333px;
}

.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app.sidebar-collapsed {
  grid-template-columns: 76px 1fr;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  transition: padding 180ms ease;
}

.sidebar-head {
  display: block;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.brand {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand-logo {
  display: block;
  width: fit-content;
  max-width: 100%;
}

.brand-logo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 12px;
  max-height: 12px;
}

.brand-logo-sidebar {
  width: fit-content;
  margin-left: 13px;
}

.brand-wordmark {
  display: inline-block;
  color: var(--sidebar-ink);
  font-family: "Martian Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

.brand-logo-login {
  --login-logo-height: 20.4px;
  width: fit-content;
  padding: var(--login-logo-height);
  margin: calc(-1 * var(--login-logo-height)) 0 0 calc(-1 * var(--login-logo-height));
}

.brand-logo-login img {
  height: var(--login-logo-height);
  max-height: var(--login-logo-height);
}

.login-panel .field input {
  border-radius: 9px;
}

.login-submit {
  margin: 20px auto 0;
  min-width: 115px;
  font-size: 10.667px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 0;
  border-color: var(--sidebar-control-line);
  background: var(--sidebar-control-bg);
  border-radius: 8px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--sidebar-ink);
}

.sidebar-collapse-toggle {
  width: 38px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: var(--sidebar-control-line);
  background: var(--sidebar-control-bg);
  color: var(--sidebar-ink);
  border-radius: 8px;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  min-height: 44px;
  border-radius: 8px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--action-contrast);
  font-weight: 600;
}

.theme-toggle:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.theme-toggle-icon {
  display: inline-grid;
  width: 20px;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.menu-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  text-align: left;
  justify-content: flex-start;
  gap: 10px;
  border-color: transparent;
  background: transparent;
  color: var(--nav-ink);
}

.nav-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  line-height: 1;
}

.nav-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-collapsed .sidebar {
  padding-inline: 14px;
}

.sidebar-collapsed .brand-logo-sidebar,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .session small,
.sidebar-collapsed .session .nav-label {
  display: none;
}

.sidebar-collapsed .brand {
  min-height: 27px;
}

.sidebar-collapsed .nav button,
.sidebar-collapsed .session button {
  justify-content: center;
}

.nav button.active,
.nav button:hover {
  background: var(--color-accent-tint);
  color: var(--nav-active-ink);
}

.session {
  margin-top: auto;
  display: grid;
  justify-items: start;
  gap: 8px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-line);
}

.session .theme-toggle {
  justify-self: end;
}

.session small {
  color: var(--sidebar-muted);
  overflow-wrap: anywhere;
}

.menu-backdrop {
  display: none;
}

.nav-lock {
  overflow: hidden;
}

.context-lock {
  overflow: hidden;
}

.main {
  min-width: 0;
  padding: 22px;
}

.context-overlay {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: block;
  width: auto;
  min-height: 0;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.25);
  border: 0;
  border-radius: 0;
  backdrop-filter: blur(4px);
  transition: opacity 180ms ease, backdrop-filter 180ms ease;
}

.context-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
}

.context-panel {
  position: fixed;
  top: 82px;
  right: 22px;
  z-index: 8;
  display: none;
  width: min(360px, calc(100vw - 44px));
  max-height: calc(100vh - 104px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.context-panel.is-open {
  display: block;
}

.context-panel-inner {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.context-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.context-panel-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.context-panel-head button {
  width: 36px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.context-trigger {
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.context-trigger {
  width: auto;
  min-width: 42px;
  padding-inline: 12px;
  border-radius: 999px;
  font-family: "Martian Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.object-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.object-cell-main {
  min-width: 0;
}

.object-cell .copyable-code,
.object-cell > .technical-code {
  min-width: 0;
}

.context-actions,
.context-form {
  display: grid;
  gap: 8px;
}

.context-actions button,
.context-form button {
  justify-content: flex-start;
}

.context-row {
  cursor: default;
}

.context-row:hover {
  background: var(--color-accent-tint);
}

.card-actions {
  margin-top: 8px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.section {
  margin-bottom: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid > button {
  justify-self: start;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
  font-family: "Martian Mono", "JetBrains Mono", ui-monospace, monospace;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.dashboard-counter,
.metric-hidden,
.metric-divider {
  display: inline-block;
  color: var(--accent);
}

.metric-divider {
  margin-inline: 3px;
  color: var(--muted);
}

.maturity-countdown-urgent {
  color: var(--bad);
  animation: maturity-countdown-pulse 1.35s ease-in-out infinite;
}

@keyframes maturity-countdown-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.38;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell {
    animation: none;
    background: var(--color-brand-red);
  }

  .context-overlay {
    transition: none;
    backdrop-filter: none;
  }

  .maestro-char {
    transition: none;
    animation: none;
  }

  .maturity-countdown-urgent {
    animation: none;
  }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--surface-2);
  color: var(--ink);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
}

.field input:read-only,
.field textarea:read-only,
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: var(--bg);
  color: var(--muted);
}

.field input[type="checkbox"],
.field input[type="radio"] {
  accent-color: var(--accent);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading h2,
.panel-heading p {
  margin: 0;
}

.panel-heading p {
  margin-top: 4px;
}

.raw-product-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.raw-product-field legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.raw-product-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.raw-product-option {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}

.raw-product-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.raw-product-option input[type="radio"] {
  flex: 0 0 auto;
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0;
}

option {
  background: var(--surface);
  color: var(--ink);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
button:focus {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}

button:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: var(--surface-2);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: var(--surface-2);
}

.linkish {
  border: 0;
  padding: 0;
  min-height: 0;
  width: auto;
  color: var(--accent);
  background: transparent;
  text-align: left;
  border-radius: 0;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.status.ok {
  background: var(--color-status-success-bg);
  color: var(--ok);
}

.status.warn {
  background: var(--color-status-warning-bg);
  color: var(--warn);
}

.status.bad {
  background: var(--color-status-danger-bg);
  color: var(--bad);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.card h3 {
  margin: 0;
  font-size: 18px;
}

.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 12px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.detail > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.detail > strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.notice {
  border: 1px solid var(--color-notice-border);
  background: var(--color-notice-bg);
  color: var(--color-notice-text);
  border-radius: 8px;
  padding: 12px;
}

.error {
  border: 1px solid var(--color-error-border);
  background: var(--color-error-bg);
  color: var(--bad);
  border-radius: 8px;
  padding: 12px;
}

.success {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--ok);
  border-radius: 8px;
  padding: 12px;
}

.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}

.scan-box {
  max-width: 620px;
}

.scan-input {
  font-size: 28px;
  min-height: 64px !important;
  font-weight: 700;
}

.dm-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.dm-queue {
  display: grid;
  gap: 6px;
}

.dm-queue__row {
  display: grid;
  grid-template-columns: 28px minmax(110px, 1fr) minmax(100px, 1fr) auto 112px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.dm-queue__row.is-current {
  border-color: var(--accent);
}

.dm-capture-zone {
  display: grid;
  gap: 6px;
  min-height: 112px;
  align-content: center;
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  outline: none;
}

.dm-capture-zone span {
  color: var(--muted);
}

.dm-capture-zone.is-armed {
  border-color: var(--ok);
  box-shadow: 0 0 0 3px var(--color-success-bg);
}

.dm-diagnostics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.technical-code-input::placeholder {
  font-family: "ProximaSoft", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.quick-layout {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions button {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  justify-content: center;
  text-align: center;
}

.quick-form {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.matrix-table table {
  min-width: 1120px;
}

.product-search-field {
  flex: 1 1 320px;
}

.warehouse-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 0;
}

.warehouse-search-field {
  min-width: 0;
}

.warehouse-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.warehouse-table table,
table.warehouse-table {
  min-width: 1240px;
}

.warehouse-table tbody tr[data-route] {
  cursor: pointer;
}

.products-table table {
  min-width: 900px;
  table-layout: fixed;
}

.products-col-name {
  width: 40%;
}

.products-col-article {
  width: 18%;
}

.products-col-stock {
  width: 14%;
}

.products-col-gtin {
  width: 18%;
}

.products-col-unit {
  width: 10%;
}

.product-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-name strong,
.product-name small {
  display: block;
}

.product-name small {
  margin-top: 3px;
  color: var(--muted);
}

.code-cell {
  max-width: 280px;
  min-width: 150px;
}

.code-cell .copyable-code {
  align-items: center;
}

.code-cell .copyable-code__value {
  overflow-x: auto;
  white-space: nowrap;
}

.code-cell .copy-code-button,
.object-cell .copy-code-button {
  align-self: center;
}

.batch-legs-toggle {
  width: 30px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border-color: var(--color-brand-red);
  border-radius: 9px;
  background: var(--color-brand-red);
  color: #fff;
}

.batch-legs-toggle:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.batch-legs-toggle span {
  display: block;
  font-size: 24px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.batch-legs-toggle.is-open span {
  animation: batch-legs-open 240ms ease-out forwards;
}

@keyframes batch-legs-open {
  0% { transform: rotate(0deg); }
  68% { transform: rotate(-60deg); }
  100% { transform: rotate(-45deg); }
}

.batch-legs-row > td {
  padding: 0 12px 14px;
  background: var(--surface-2);
}

.batch-expanded-table {
  margin: 0;
}

.confirm-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.confirm-dialog__body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.confirm-dialog__body h2,
.confirm-dialog__body p {
  margin: 0;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.output-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
}

.public-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.public-panel {
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.order-heading-actions,
.order-actions,
.order-blockers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.order-heading-actions {
  justify-content: space-between;
}

.order-create-form .field {
  min-width: min(620px, 100%);
}

.candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.candidate-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.candidate-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.order-scan-diagnostics {
  margin-top: 4px;
}

.cdek-dialog {
  width: min(920px, calc(100vw - 32px));
}

.cdek-check-button {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
}

.orders-list-table table {
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
}

.orders-list-table th,
.orders-list-table td {
  border-bottom: 0;
}

.orders-list-table thead th {
  border-bottom: 1px solid var(--line);
}

.orders-list-table tbody tr + tr td {
  border-top: 1px solid var(--line);
}

.order-items-table table {
  min-width: 880px;
  table-layout: fixed;
}

.order-item-col-name {
  width: 40%;
}

.order-item-col-quantity {
  width: 10%;
}

.order-item-col-stock,
.order-item-col-check {
  width: 15%;
}

.order-item-col-datamatrix {
  width: 20%;
}

.order-item-name {
  overflow-wrap: anywhere;
}

.order-items-table .status {
  gap: 6px;
  white-space: normal;
}

@media (max-width: 920px) {
  .warehouse-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-search-field,
  .warehouse-filter-actions {
    grid-column: 1 / -1;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px 14px;
    gap: 0;
    overflow: visible;
  }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
  }

  .brand {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .brand-logo-sidebar {
    margin-left: 0;
    margin-right: auto;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .sidebar-collapsed .brand-logo-sidebar,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .session small,
  .sidebar-collapsed .session .nav-label {
    display: inline;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    flex: 0 0 auto;
  }

  .menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 7;
    display: flex;
    width: min(340px, calc(100vw - 42px));
    height: 100vh;
    padding: 18px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--sidebar-line);
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 180ms ease;
  }

  .sidebar.open .menu-panel {
    transform: translateX(0);
  }

  .sidebar.open + .menu-backdrop {
    display: block;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6;
    background: rgba(0, 0, 0, 0.48);
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .sidebar.open .menu-panel {
    gap: 12px;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .nav button {
    width: 100%;
  }

  .session {
    margin-top: 0;
  }

  .context-panel {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: min(72vh, 520px);
    border-radius: 8px;
  }

  .split,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .details {
    grid-template-columns: 1fr;
  }

  .output-row {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .dm-workspace,
  .dm-diagnostics,
  .dm-queue__row {
    grid-template-columns: 1fr;
  }

  .raw-product-options {
    grid-template-columns: 1fr;
  }

  .candidate-row {
    grid-template-columns: 1fr;
  }

  .candidate-row button {
    width: fit-content;
  }
}

@media (hover: none), (pointer: coarse) {
  .copy-code-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 14px;
  }

  .topbar {
    display: grid;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
  }

  .warehouse-toolbar {
    grid-template-columns: 1fr;
  }

  .login-panel-head {
    align-items: center;
    padding-block: clamp(30px, 5vh, 48px);
  }

  .copyable-code {
    align-items: flex-start;
  }

  .confirm-dialog__actions {
    display: grid;
  }

  .confirm-dialog__actions button {
    width: 100%;
  }

}
