:root {
  --norms-ink: #172033;
  --norms-muted: #6e7a8f;
  --norms-subtle: #98a3b5;
  --norms-line: #e6eaf0;
  --norms-panel: #ffffff;
  --norms-canvas: #f4f6f9;
  --norms-primary: #2864d7;
  --norms-primary-soft: #eef4ff;
  --norms-success: #1c9b67;
  --norms-shadow: 0 12px 36px rgba(26, 43, 74, 0.08);
}

html.norms-standalone,
body.norms-standalone {
  min-height: 100%;
  overflow: hidden;
  background: var(--norms-canvas);
}

body.norms-standalone {
  margin: 0;
  overflow: hidden;
  color: var(--norms-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.norms-page {
  box-sizing: border-box;
  display: flex;
  height: 100vh;
  height: 100dvh;
  height: var(--norms-visual-height, 100dvh);
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 30px 34px 34px;
  color: var(--norms-ink);
  background: var(--norms-canvas);
}

.norms-page *,
.norms-page *::before,
.norms-page *::after {
  box-sizing: border-box;
}

.norms-page button,
.norms-page input,
.norms-page select {
  font: inherit;
}

.norms-page button {
  color: inherit;
}

.norms-categories,
.norms-work-list {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.norms-categories *,
.norms-work-list * {
  -webkit-user-drag: none;
}

.norms-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex: 0 0 auto;
  width: 100%;
  max-width: 1840px;
  max-height: 100px;
  margin: 0 auto 22px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 260ms ease,
    margin-bottom 260ms ease,
    opacity 180ms ease,
    transform 260ms ease;
}

.norms-page.is-started .norms-topbar {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

.norms-topbar h1,
.norms-list-header h2,
.norms-panel-heading h2,
.norms-calculator-header h2 {
  margin: 0;
  color: var(--norms-ink);
  letter-spacing: -0.03em;
}

.norms-topbar h1 {
  font-size: clamp(28px, 2vw, 36px);
  line-height: 1.1;
}

.norms-topbar p {
  margin: 8px 0 0;
  color: var(--norms-muted);
  font-size: 15px;
}

.norms-vehicle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: 0 0 auto;
  width: 100%;
  max-width: 1840px;
  min-height: 92px;
  margin: 0 auto 20px;
  padding: 18px 20px;
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: linear-gradient(112deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: var(--norms-shadow);
}

.norms-vehicle-summary {
  display: flex;
  align-items: center;
  min-width: 260px;
}

.norms-vehicle-summary strong {
  display: block;
  max-width: 400px;
  overflow-wrap: anywhere;
  color: var(--norms-ink);
  font-size: 15px;
  hyphens: auto;
  line-height: 1.35;
  white-space: normal;
}

.norms-field-caption,
.norms-car-selector {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  max-width: 760px;
}

.norms-car-selector-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(135px, 1fr));
  gap: 9px;
}

.norms-page label {
  color: var(--norms-muted);
  font-size: 13px;
  font-weight: 600;
}

.norms-car-selector label {
  display: block;
}

.norms-page select,
.norms-page input {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  color: var(--norms-ink);
  border: 1px solid #d8e0eb;
  border-radius: 9px;
  outline: none;
  background: #fff;
  font-size: 14px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.norms-page select:focus,
.norms-page input:focus {
  border-color: #7ca3ef;
  box-shadow: 0 0 0 3px rgba(40, 100, 215, 0.13);
}

.norms-page select:disabled {
  color: #aeb7c5;
  background: #f4f6f9;
  cursor: not-allowed;
}

.norms-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  width: 100%;
  max-width: 1840px;
  margin: 0 auto 16px;
  padding: 12px 14px;
  color: #a12a3d;
  border: 1px solid #f3c9d0;
  border-radius: 10px;
  background: #fff5f6;
  font-size: 14px;
}

.norms-error button,
.norms-pagination button,
.norms-add-button,
.norms-quantity button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.norms-error-action {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 10px;
  background: transparent;
}

.norms-error-action-progress {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.norms-error-action-progress rect {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.norms-error-action-progress-base {
  stroke: #f3c9d0;
}

.norms-error-action-progress-value {
  stroke: #a12a3d;
  stroke-dasharray: 100;
  transition: stroke-dashoffset 1s linear;
}

.norms-error button {
  position: relative;
  z-index: 1;
  padding: 6px 10px;
  color: #a12a3d;
  background: #ffe7eb;
  font-size: 12px;
  font-weight: 700;
}

.norms-error button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.norms-workspace {
  display: grid;
  grid-template-columns: 236px minmax(430px, 1fr) 370px;
  align-items: stretch;
  gap: 16px;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1840px;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
}

html.norms-standalone.norms-auth-document,
body.norms-standalone.norms-auth-document {
  overflow: auto;
}

.norms-categories,
.norms-results,
.norms-calculator {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--norms-line);
  border-radius: 14px;
  background: var(--norms-panel);
  box-shadow: 0 6px 22px rgba(26, 43, 74, 0.04);
}

.norms-categories,
.norms-calculator {
  overflow: auto;
  scrollbar-color: #cbd5e4 transparent;
  scrollbar-width: thin;
}

.norms-categories {
  min-width: 236px;
}

.norms-calculator {
  overflow: visible;
}

.norms-categories {
  padding: 18px 12px;
}

.norms-panel-heading,
.norms-list-header,
.norms-calculator-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.norms-panel-heading,
.norms-list-header {
  padding: 0 6px 14px;
  border-bottom: 1px solid var(--norms-line);
}

.norms-categories .norms-panel-heading {
  margin-right: -12px;
  margin-left: -12px;
  padding-right: 18px;
  padding-left: 18px;
}

.norms-panel-heading,
.norms-calculator-header {
  min-height: 52px;
}

.norms-panel-heading h2,
.norms-list-header h2,
.norms-calculator-header h2 {
  font-size: 19px;
}

.norms-panel-count,
.norms-line-counter {
  display: inline-grid;
  min-width: 26px;
  min-height: 26px;
  padding: 0 7px;
  place-items: center;
  color: var(--norms-primary);
  border-radius: 8px;
  background: var(--norms-primary-soft);
  font-size: 11px;
  font-weight: 800;
}

.norms-line-counter.is-limit-reached {
  color: #a12a3d;
  border: 1px solid #f3c9d0;
  background: #ffe7eb;
}

.norms-panel-count,
.norms-categories .norms-tree-toggle {
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  flex: 0 0 30px;
}

.norms-panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.norms-panel-heading-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.norms-category-loading {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--norms-primary);
  opacity: 0;
  transition: opacity 160ms ease;
}

.norms-category-loading.is-visible {
  opacity: 1;
}

.norms-category-loading svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 18 32;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.norms-category-loading.is-visible svg {
  animation: norms-category-spin 800ms linear infinite;
}

@keyframes norms-category-spin {
  to {
    transform: rotate(360deg);
  }
}

.norms-categories .norms-tree-toggle {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--norms-primary);
  border: 1px solid #d5e2fa;
  border-radius: 7px;
  background: var(--norms-primary-soft);
  cursor: pointer;
}

.norms-tree-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.norms-categories .norms-tree-toggle:hover {
  border-color: #b7caf0;
  background: #e4edff;
}

.norms-categories nav {
  padding-top: 12px;
}

.norms-categories ul {
  list-style: none;
  margin: 3px 0 0;
  padding: 0 0 0 12px;
}

.norms-categories li {
  position: relative;
}

.norms-categories li::before {
  display: none;
}

.norms-categories button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  color: var(--norms-muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.norms-categories button:hover,
.norms-categories button.active {
  color: var(--norms-primary);
  background: var(--norms-primary-soft);
}

.norms-categories button.norms-category-parent {
  font-weight: 700;
}

.norms-category-all {
  margin-bottom: 2px;
  font-weight: 700;
}

.norms-category-all span {
  color: var(--norms-primary);
}

.norms-results {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.norms-results-toolbar {
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) 105px;
  gap: 14px;
  min-height: 70px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--norms-line);
}

.norms-results-toolbar .norms-list-header {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
}

.norms-results-toolbar .norms-list-header h2 {
  white-space: nowrap;
}

.norms-search {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  margin: 0;
}

.norms-search input {
  height: 42px;
  margin: 0;
  padding-right: 38px;
  padding-left: 38px;
  border-color: #dce4ef;
  background: #f8fafc;
}

.norms-search-select {
  position: relative;
  min-width: 0;
}

.norms-search-select > label {
  display: block;
}

.norms-search-select-control {
  position: relative;
}

.norms-search-select input {
  margin-top: 5px;
  padding-right: 34px;
}

.norms-search-select-control.has-value input {
  padding-right: 58px;
}

.norms-search-select input::-webkit-search-cancel-button {
  appearance: none;
  -webkit-appearance: none;
}

.norms-search-select-clear {
  position: absolute;
  top: calc(50% + 2px);
  right: 28px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  color: var(--norms-subtle);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  transform: translateY(-50%);
}

.norms-search-select-clear:hover {
  color: var(--norms-ink);
  background: #edf1f7;
}

.norms-search-select-arrow {
  position: absolute;
  top: calc(50% + 2px);
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--norms-subtle);
  border-bottom: 1.5px solid var(--norms-subtle);
  pointer-events: none;
  transform: translateY(-50%) rotate(45deg);
}

.norms-search-select-arrow.is-open {
  transform: translateY(-50%) rotate(225deg);
}

.norms-search-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #cddcf2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(26, 43, 74, 0.15);
}

.norms-search-select.is-above .norms-search-options {
  top: auto;
  bottom: calc(100% + 4px);
}

.norms-keyboard-floating {
  position: fixed !important;
  z-index: 30 !important;
  margin: 0 !important;
  transform: none !important;
}

.norms-search-options button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  color: var(--norms-ink);
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.norms-search-options button:hover,
.norms-search-options button[aria-selected="true"] {
  color: var(--norms-primary);
  background: var(--norms-primary-soft);
}

.norms-search-empty {
  display: block;
  padding: 9px 10px;
  color: var(--norms-subtle);
  font-size: 13px;
}

.norms-search-icon {
  position: absolute;
  left: 14px;
  z-index: 1;
  color: var(--norms-subtle);
  font-size: 22px;
  line-height: 1;
  pointer-events: none;
}

.norms-search-clear {
  position: absolute;
  right: 8px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--norms-muted);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.norms-search-clear:hover {
  background: #e8edf5;
}

.norms-results-meta {
  display: flex;
  flex-direction: column;
  width: 105px;
  min-width: 105px;
  color: var(--norms-subtle);
  font-size: 12px;
  text-align: right;
}

.norms-results-meta strong {
  color: var(--norms-ink);
  font-size: 16px;
}

.norms-work-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 17px 16px 12px;
}

.norms-work-list.is-loading .norms-table-body {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.norms-work-loading {
  display: inline-flex;
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  color: var(--norms-ink);
  border: 1px solid #dce4ef;
  border-radius: 9px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 8px 24px rgb(34 53 84 / 12%);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.norms-work-loading-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 2px solid #dce4ef;
  border-top-color: var(--norms-primary);
  border-radius: 50%;
  animation: norms-work-spin 800ms linear infinite;
}

@keyframes norms-work-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .norms-work-loading-spinner {
    animation: none;
  }
}

.norms-table {
  display: flex;
  position: relative;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.norms-table-header,
.norms-work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 92px;
  align-items: center;
  gap: 14px;
}

.norms-table-header {
  flex: 0 0 auto;
  padding: 11px 10px 9px;
  color: var(--norms-subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.norms-table-header span:nth-child(2),
.norms-work-metric {
  text-align: center;
}

.norms-table-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-color: #cbd5e4 transparent;
  scrollbar-width: thin;
}

.norms-work-row {
  min-height: 78px;
  padding: 12px 10px;
  border-top: 1px solid #edf0f4;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.norms-work-row:hover {
  background: #fafcff;
  box-shadow: inset 3px 0 0 var(--norms-primary);
}

.norms-work-main {
  min-width: 0;
}

.norms-work-main-child {
  position: relative;
  padding-left: calc(var(--norms-work-depth) * 20px);
}

.norms-work-main-child::before {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: calc(var(--norms-work-depth) * 20px - 9px);
  width: 1px;
  background: #dbe4f2;
  content: "";
}

.norms-work-row-child {
  background: #fcfdff;
}

.norms-work-name {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0;
  color: var(--norms-ink);
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  hyphens: auto;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.norms-work-main small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--norms-subtle);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.norms-work-main p {
  display: -webkit-box;
  max-width: 100%;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--norms-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.norms-work-metric strong {
  display: block;
  color: var(--norms-ink);
  font-size: 14px;
}

.norms-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 8px;
  color: var(--norms-primary);
  border: 1px solid #cddcf8;
  background: var(--norms-primary-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.norms-add-button:hover {
  color: #fff;
  border-color: var(--norms-primary);
  background: var(--norms-primary);
  transform: translateY(-1px);
}

.norms-add-button:active {
  transform: scale(0.96);
}

.norms-add-button.is-added {
  color: #16734e;
  border-color: #b9e5cf;
  background: #eaf8f1;
}

.norms-add-button.is-added:hover {
  color: #126442;
  border-color: #8bd0ad;
  background: #dff4e9;
}

.norms-add-button.is-recent {
  animation: norms-add-confirm 320ms ease-out;
}

.norms-page button.is-clicked:not(:disabled) {
  animation: norms-button-pulse 320ms ease-out;
}

@keyframes norms-button-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 100, 215, 0.24);
  }
  100% {
    box-shadow: 0 0 0 7px rgba(40, 100, 215, 0);
  }
}

@keyframes norms-add-confirm {
  0% {
    box-shadow: 0 0 0 0 rgba(28, 155, 103, 0.35);
  }
  100% {
    box-shadow: 0 0 0 7px rgba(28, 155, 103, 0);
  }
}

.norms-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 10px;
  padding: 13px 2px 0;
  color: var(--norms-muted);
  border-top: 1px solid var(--norms-line);
  font-size: 13px;
}

.norms-pagination > div {
  display: flex;
  gap: 6px;
}

.norms-pagination small {
  color: var(--norms-subtle);
}

.norms-pagination button {
  padding: 7px 9px;
  color: var(--norms-primary);
  border: 1px solid #dce4ef;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.norms-pagination button:hover:not(:disabled) {
  border-color: #b7caf0;
  background: var(--norms-primary-soft);
}

.norms-pagination button:disabled {
  color: #b8c1ce;
  background: #f7f8fa;
  cursor: not-allowed;
}

.norms-empty-state,
.norms-calculator-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  flex-direction: column;
  gap: 7px;
  padding: 30px;
  color: var(--norms-muted);
  text-align: center;
}

.norms-empty-state strong,
.norms-calculator-empty strong {
  color: var(--norms-ink);
  font-size: 15px;
}

.norms-empty-state span:last-child,
.norms-calculator-empty span:last-child {
  max-width: 260px;
  color: var(--norms-subtle);
  font-size: 13px;
  line-height: 1.45;
}

.norms-calculator {
  display: flex;
  position: relative;
  flex-direction: column;
  padding: 18px 16px 12px;
}

.norms-calculator-toggle {
  display: none;
}

.norms-calculator-header {
  align-items: center;
  position: relative;
  flex: 0 0 auto;
  margin-right: -16px;
  margin-left: -16px;
  padding-right: 16px;
  padding-left: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--norms-line);
}

.norms-calculator-header {
  display: flex;
}

.norms-calculator-header > :first-child {
  min-width: 0;
}

.norms-calculator-header .norms-clear-button {
  margin-left: auto;
}

.norms-calculator-header .norms-line-counter {
  margin-left: auto;
}

.norms-calculator-settings-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--norms-primary);
  border: 1px solid #d5e2fa;
  border-radius: 8px;
  background: var(--norms-primary-soft);
  cursor: pointer;
}

.norms-calculator-settings-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.norms-clear-button {
  align-self: center;
  padding: 4px 0;
  color: var(--norms-subtle);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.norms-clear-button:hover {
  color: #b13b4b;
}

.norms-calculator-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 14px 0;
  border-bottom: 1px solid var(--norms-line);
}

.norms-calculator-settings.is-collapsed {
  display: none;
}

.norms-calculator-settings label {
  min-width: 0;
}

.norms-input-with-suffix {
  position: relative;
}

.norms-input-with-suffix input {
  padding-right: 34px;
  font-size: 13px;
}

.norms-input-with-suffix span {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--norms-subtle);
  font-size: 10px;
  pointer-events: none;
  transform: translateY(-50%);
}

.norms-calculator-lines {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}

.norms-calculator-group + .norms-calculator-group {
  margin-top: 10px;
}

.norms-calculator-group-title {
  margin: 0;
  padding: 11px 2px 7px;
  overflow-wrap: anywhere;
  color: var(--norms-subtle);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.norms-calculator-group:first-child .norms-calculator-group-title {
  padding-top: 12px;
}

.norms-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 13px 2px;
  border-bottom: 1px solid #edf0f4;
}

.norms-line-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--norms-ink);
  font-size: 13px;
  font-weight: 750;
  hyphens: auto;
  line-height: 1.35;
}

.norms-quantity {
  display: inline-flex;
  height: 24px;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.norms-quantity button {
  box-sizing: border-box;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--norms-primary);
  border: 1px solid #d9e3f5;
  background: #f5f8ff;
  font-size: 16px;
  line-height: 1;
}

.norms-quantity button:hover {
  border-color: #b7caf0;
  background: var(--norms-primary-soft);
}

.norms-quantity input {
  box-sizing: border-box;
  width: 38px;
  height: 24px;
  margin: 0;
  padding: 0 2px;
  color: var(--norms-ink);
  border: 1px solid #d9e3f5;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.norms-quantity input:focus {
  border-color: #9eb8e8;
  outline: 2px solid rgb(67 113 205 / 18%);
  outline-offset: 1px;
}

.norms-line > button:last-of-type {
  display: grid;
  width: 22px;
  height: 22px;
  align-self: center;
  place-items: center;
  padding: 0;
  color: var(--norms-subtle);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.norms-line > button:last-of-type:hover {
  color: #b13b4b;
}

.norms-line-summary {
  grid-column: 1 / -1;
  padding-right: 8px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 12px;
}

.norms-line-summary b {
  color: var(--norms-ink);
  font-size: 13px;
  text-align: right;
}

.norms-line-time {
  color: var(--norms-muted);
  font-size: 12px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.norms-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 13px 2px 0;
  border-top: 1px solid var(--norms-line);
}

.norms-total > span {
  color: var(--norms-muted);
  font-size: 13px;
  font-weight: 700;
}

.norms-total > div {
  text-align: right;
}

.norms-total-values {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 12px;
}

.norms-total strong {
  color: var(--norms-ink);
  font-size: 23px;
  letter-spacing: -0.04em;
}

.norms-total-time {
  color: var(--norms-muted);
  font-size: 16px;
  font-weight: 750;
}

.norms-total small {
  display: block;
  max-width: 170px;
  margin-top: 3px;
  color: #b27427;
  font-size: 10px;
  line-height: 1.35;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1250px) {
  .norms-workspace {
    grid-template-columns: 236px minmax(390px, 1fr) 320px;
  }

  .norms-table-header,
  .norms-work-row {
    grid-template-columns: minmax(0, 1fr) 105px 82px;
    gap: 8px;
  }
}

@media (max-width: 1000px) {
  .norms-page {
    min-height: 0;
    padding: 22px 18px;
  }

  .norms-vehicle-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .norms-car-selector {
    max-width: none;
  }

  .norms-workspace {
    grid-template-columns: 236px minmax(0, 1fr);
    height: auto;
  }

  .norms-calculator {
    position: fixed;
    z-index: 5;
    right: 18px;
    bottom: 18px;
    width: min(370px, calc(100vw - 36px));
    height: min(620px, calc(var(--norms-visual-height, 100dvh) - 36px));
    transition: transform 220ms ease;
    box-shadow: 0 18px 50px rgba(26, 43, 74, 0.2);
  }

  .norms-calculator.is-collapsed {
    transform: translateX(calc(100% + 12px));
  }
}

.norms-auth-page {
  box-sizing: border-box;
  display: grid;
  width: 100%;
  min-height: 100dvh;
  overflow: visible;
  padding: 32px 20px;
  place-items: center;
  background: #f5f8fd;
}

.norms-auth-page *,
.norms-auth-page *::before,
.norms-auth-page *::after {
  box-sizing: border-box;
}

.norms-auth-card {
  width: min(100%, 460px);
  padding: 36px;
  border: 1px solid #e3eaf5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(40 63 101 / 10%);
}

.norms-auth-card-wide {
  width: min(100%, 620px);
}

.norms-auth-eyebrow {
  margin-bottom: 10px;
  color: #71809a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.norms-auth-card h1 {
  margin: 0;
  color: #1c2940;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  line-height: 1.1;
}

.norms-auth-description {
  margin: 14px 0 26px;
  color: #71809a;
  line-height: 1.55;
}

.norms-auth-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.norms-auth-field {
  display: grid;
  align-content: start;
  align-self: start;
  min-width: 0;
  gap: 7px;
}

.norms-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.norms-auth-grid > div {
  min-width: 0;
}

.norms-auth-form label {
  color: #42526c;
  font-size: 0.9rem;
  font-weight: 650;
}

.norms-auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #d6e0ef;
  border-radius: 12px;
  color: #1c2940;
  font: inherit;
  outline: none;
  appearance: none;
}

.norms-auth-form input:focus {
  border-color: #4b83f0;
  box-shadow: 0 0 0 3px rgb(75 131 240 / 14%);
}

.norms-auth-form input.is-invalid,
.norms-auth-form input.input-validation-error {
  border-color: #d25454;
  box-shadow: 0 0 0 3px rgb(210 84 84 / 12%);
}

.norms-auth-hint {
  color: #8a96a9;
  font-size: 0.78rem;
}

.norms-auth-submit {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: #316fe9;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.norms-auth-submit:hover {
  background: #255fd0;
}

.norms-auth-switch {
  margin: 24px 0 0;
  color: #71809a;
  text-align: center;
}

.norms-auth-switch a {
  color: #316fe9;
  font-weight: 700;
  text-decoration: none;
}

.norms-auth-error,
.norms-auth-field-error {
  color: #c24141;
  font-size: 0.84rem;
  line-height: 1.3;
}

.norms-auth-error:empty,
.norms-auth-field-error:empty {
  display: none;
}

@media (max-width: 560px) {
  .norms-auth-page {
    padding: 16px;
    align-items: start;
  }

  .norms-auth-card {
    padding: 26px 20px;
    border-radius: 18px;
  }

  .norms-auth-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 680px) {
  .norms-page {
    padding: 18px 12px;
  }

  .norms-topbar {
    display: block;
  }

  .norms-vehicle-summary {
    min-width: 0;
  }

  .norms-car-selector-fields {
    grid-template-columns: 1fr;
  }

  .norms-workspace {
    display: block;
    height: auto;
    min-height: 0;
    overflow-y: auto;
  }

  .norms-categories {
    max-height: 210px;
    margin-bottom: 12px;
  }

  .norms-results {
    min-height: 560px;
  }

  .norms-results-toolbar {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
  }

  .norms-results-meta {
    width: auto;
    min-width: 0;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
  }

  .norms-table-header {
    display: none;
  }

  .norms-work-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 13px 4px;
  }

  .norms-work-metric {
    grid-column: 1;
    text-align: left;
  }

  .norms-add-button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .norms-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .norms-calculator {
    right: 12px;
    bottom: 12px;
    width: min(370px, calc(100vw - 24px));
    height: min(530px, calc(var(--norms-visual-height, 100dvh) - 24px));
    margin-top: 0;
  }

  .norms-calculator.is-collapsed {
    transform: translateX(calc(100% + 6px));
  }
}

@media (max-width: 1000px) {
  .norms-calculator-toggle {
    position: absolute;
    top: 50%;
    left: -18px;
    display: grid;
    width: 24px;
    height: 58px;
    place-items: center;
    padding: 0;
    color: var(--norms-primary);
    border: 1px solid #d5e2fa;
    border-radius: 9px 0 0 9px;
    background: var(--norms-primary-soft);
    cursor: pointer;
    transform: translateY(-50%);
  }

  .norms-calculator-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }
}
