:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #f0f3f4;
  --ink: #172126;
  --muted: #657178;
  --line: #d8dee1;
  --line-strong: #bdc7cc;
  --accent: #0f766e;
  --accent-strong: #0b5e58;
  --accent-soft: #e8f4f2;
  --blue: #245ec7;
  --blue-strong: #1f4fa8;
  --amber: #9a5a08;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 10px max(20px, calc((100vw - 1380px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.connection-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5aa;
}

.connection-status[data-state="ready"]::before {
  background: #16a36a;
}

.connection-status[data-state="error"]::before {
  background: var(--danger);
}

.topbar-actions,
.panel-actions,
.wizard-actions,
.tender-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 0 20px 32px;
}

.stepper {
  position: sticky;
  top: 64px;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.step-button {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 1px 9px;
  min-height: 66px;
  padding: 11px 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.step-button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: transparent;
}

.step-button span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.step-button strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-button.is-active {
  background: var(--surface);
}

.step-button.is-active::after {
  background: var(--accent);
}

.step-button.is-active span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.workspace {
  min-width: 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: 120px 150px 130px minmax(220px, 1fr);
  align-items: center;
  gap: 0;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.summary-strip div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  padding: 0 14px;
  border-right: 1px solid var(--line);
}

.summary-strip span,
.summary-strip p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-strip strong {
  font-size: 17px;
}

.summary-strip p {
  margin: 0;
  padding: 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 24px 0 20px;
}

.step-panel[hidden] {
  display: none;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
}

.panel-description {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-count {
  padding: 5px 9px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 132px 160px auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 39px;
  padding: 8px 10px;
}

textarea {
  min-height: 112px;
  padding: 10px;
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

.file-button,
.primary-button,
.secondary-button,
.ghost-button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.file-button {
  width: auto;
  border: 1px solid #aad7d2;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.file-button input {
  display: none;
}

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

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: var(--blue);
  color: #fff;
}

.secondary-button:hover {
  background: var(--blue-strong);
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.search-button {
  min-width: 92px;
}

.tender-status {
  min-height: 34px;
  padding: 8px 10px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tender-status[data-state="success"] {
  border-left-color: #16a36a;
}

.tender-status[data-state="error"] {
  border-left-color: var(--danger);
  color: #7d271f;
}

.tender-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  min-width: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tender-list {
  display: grid;
  min-width: 0;
}

.tender-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 16px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tender-card:last-child {
  border-bottom: 0;
}

.tender-card:hover {
  background: #f9fbfb;
}

.tender-card.is-selected {
  box-shadow: inset 3px 0 0 var(--accent);
  background: var(--accent-soft);
}

.tender-card-main {
  min-width: 0;
}

.tender-card-topline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.law-badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 850;
}

.law-badge {
  background: #e8edf8;
  color: #304f8d;
}

.source-badge {
  overflow: hidden;
  max-width: 220px;
  background: var(--surface-2);
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tender-card h3 {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.32;
}

.tender-customer {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tender-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 8px 18px;
  margin-top: 10px;
}

.tender-stats div {
  display: grid;
  gap: 2px;
}

.tender-stats dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.tender-stats dd {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.tender-card-side {
  display: grid;
  align-content: space-between;
  justify-items: stretch;
  gap: 12px;
}

.tender-price {
  text-align: right;
}

.tender-price strong {
  display: block;
  font-size: 16px;
}

.tender-price span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.tender-actions {
  justify-content: flex-end;
}

.tender-actions .source-link {
  padding: 7px 2px;
  font-size: 11px;
}

.select-tender-button {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.tender-card.is-selected .select-tender-button {
  background: var(--accent);
  color: #fff;
}

.selection-panel {
  position: sticky;
  top: 146px;
  min-height: 280px;
  padding: 17px;
  border-left: 1px solid var(--line);
  background: #fbfcfc;
}

.empty-selection {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

.empty-selection strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-selection span {
  margin-top: 4px;
  font-size: 12px;
}

.selected-details h3 {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.35;
}

.selected-facts {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.selected-facts div {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.selected-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.selected-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.selected-source {
  display: inline-block;
  margin-bottom: 10px;
}

.process-tender-button {
  width: 100%;
  margin-bottom: 10px;
}

.process-status {
  margin-bottom: 14px;
  padding: 9px 10px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
}

.process-status[data-state="ready"] { border-left-color: #16a36a; color: #176344; }
.process-status[data-state="review"] { border-left-color: #d99a28; color: #74500c; }
.process-status[data-state="error"] { border-left-color: var(--danger); color: #7d271f; }

.spec-import-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  background: var(--surface);
}

.spec-import-summary[data-state="loading"] { border-left-color: var(--blue); }
.spec-import-summary[data-state="ready"] { border-left-color: #16a36a; }
.spec-import-summary[data-state="review"] { border-left-color: #d99a28; }
.spec-import-summary[data-state="error"] { border-left-color: var(--danger); }

.spec-import-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.spec-import-summary strong {
  font-size: 14px;
}

.spec-import-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.source-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.data-editor {
  min-height: 390px;
  border-radius: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.spec-source {
  border: 1px solid var(--line);
  background: var(--surface);
}

.secondary-details {
  border: 1px solid var(--line);
  background: var(--surface);
}

.secondary-details > summary {
  padding: 12px 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.secondary-details textarea:not(.data-editor) {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
}

.technical-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
}

.spec-source summary {
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.spec-source .data-editor {
  min-height: 220px;
  border-right: 0;
  border-left: 0;
}

.spec-source .hint {
  padding: 8px 12px 10px;
}

.parts-matcher {
  border: 1px solid var(--line);
  background: var(--surface);
}

.parts-matcher-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.parts-matcher-heading h3 {
  margin: 0;
  font-size: 16px;
}

.parts-matcher-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.part-list {
  display: grid;
}

.part-list-empty {
  padding: 34px 20px;
}

.part-item {
  border-bottom: 1px solid var(--line);
}

.part-item:last-child {
  border-bottom: 0;
}

.part-requirement {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
}

.part-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.part-copy {
  min-width: 0;
}

.part-copy h4 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.3;
}

.part-description {
  margin: 0 0 6px;
  color: #44575d;
  font-size: 12px;
  line-height: 1.4;
}

.part-copy p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.part-copy p strong {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.part-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.part-actions .secondary-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.part-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.part-state[data-state="ready"] { color: var(--blue); }
.part-state[data-state="review"] { color: var(--amber); }
.part-state[data-state="selected"] { color: var(--accent); }
.part-state[data-state="error"] { color: var(--danger); }

.exist-result {
  padding: 0 14px 14px 54px;
  background: #fafcfc;
}

.exist-loading,
.exist-message {
  padding: 14px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.exist-message.is-warning { border-left-color: #d99a28; }
.exist-message.is-error { border-left-color: var(--danger); color: #7d271f; }

.catalog-choice-heading {
  display: grid;
  gap: 3px;
  padding: 12px 0 9px;
  font-size: 12px;
}

.catalog-choice-heading span {
  color: var(--muted);
}

.catalog-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.catalog-choice {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.catalog-choice:hover {
  border-color: var(--blue);
  background: #f5f8ff;
}

.catalog-choice span {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.catalog-choice small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exist-result-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.exist-group {
  margin-bottom: 12px;
}

.exist-group h5 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.exist-options {
  display: grid;
  gap: 6px;
}

.exist-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.exist-option.is-selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  background: var(--accent-soft);
}

.exist-option.is-masked {
  opacity: 0.7;
}

.exist-option-main {
  min-width: 0;
}

.exist-option-main > strong {
  font-size: 12px;
}

.exist-option-main > strong span {
  margin-left: 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.exist-option-main p {
  margin: 4px 0;
  font-size: 12px;
}

.exist-option-main small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.exist-offer-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.exist-offer {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 2px 8px;
  padding: 5px 7px;
  border-left: 2px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 10px;
}

.exist-offer strong {
  color: var(--ink);
  text-align: right;
}

.exist-offer small {
  grid-column: 1 / -1;
  font-size: 9px;
  font-weight: 700;
}

.exist-option-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 8px;
  font-size: 11px;
}

.exist-option-side > strong {
  font-size: 13px;
}

.exist-option-side .source-link {
  grid-column: 1 / -1;
  justify-self: end;
  font-size: 10px;
}

.select-exist-part {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
}

.exist-option.is-selected .select-exist-part {
  background: var(--accent);
  color: #fff;
}

.masked-label {
  color: var(--danger);
  font-size: 9px;
  font-weight: 850;
  text-align: right;
}

.exist-disclaimer {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.price-empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.price-empty-state[hidden] {
  display: none;
}

.price-empty-state strong {
  font-size: 15px;
}

.price-empty-state span {
  max-width: 620px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.price-preview {
  border: 1px solid var(--line);
  background: var(--surface);
}

.price-preview-heading {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.price-preview-heading div {
  display: grid;
  gap: 4px;
}

.price-preview-heading strong {
  font-size: 16px;
}

.price-preview-heading span {
  color: var(--muted);
  font-size: 12px;
}

.price-preview-list {
  display: grid;
}

.price-preview-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.6fr) 140px;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.price-preview-row:last-child {
  border-bottom: 0;
}

.price-preview-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.price-preview-row > div > strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.price-preview-row span,
.price-preview-row small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.price-preview-stock {
  border-left: 2px solid var(--line);
  padding-left: 12px;
}

.price-preview-value {
  justify-items: end;
  text-align: right;
}

.price-preview-value > strong {
  font-size: 15px !important;
}

.manual-price-source {
  border: 1px solid var(--line);
  background: var(--surface);
}

.manual-price-source summary {
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.manual-price-source .file-button,
.manual-price-source .data-editor,
.manual-price-source .hint {
  margin: 0 14px 12px;
}

.manual-price-source .data-editor {
  width: calc(100% - 28px);
}

.wizard-actions {
  justify-content: space-between;
  position: sticky;
  bottom: 0;
  z-index: 12;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  background: rgba(244, 246, 247, 0.97);
  backdrop-filter: blur(8px);
}

.wizard-actions .primary-button {
  min-width: 250px;
  min-height: 46px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  contain: inline-size;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #e9edef;
  color: #3f4d51;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-size: 12px;
  line-height: 1.35;
}

tbody tr:hover {
  background: #f9fbfb;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
}

.badge.high {
  background: #dcfce7;
  color: #166534;
}

.badge.medium {
  background: #fef3c7;
  color: var(--amber);
}

.badge.low {
  background: #fee2e2;
  color: var(--danger);
}

.empty {
  padding: 44px 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.tender-skeleton {
  height: 118px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #f3f5f6 25%, #e9edef 37%, #f3f5f6 63%);
  background-size: 400% 100%;
  animation: loading 1.3s ease infinite;
}

@keyframes loading {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (max-width: 980px) {
  .search-toolbar {
    grid-template-columns: minmax(220px, 1fr) 120px 150px;
  }

  .search-button {
    grid-column: 1 / -1;
  }

  .tender-workspace {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    min-height: 58px;
    padding: 9px 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .connection-status {
    font-size: 10px;
  }

  .topbar-actions .ghost-button {
    display: none;
  }

  .topbar-actions .primary-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .app-shell {
    padding: 0 12px 24px;
  }

  .stepper {
    position: sticky;
    top: 0;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .stepper::-webkit-scrollbar {
    display: none;
  }

  .step-button {
    grid-template-columns: 24px minmax(0, 1fr);
    min-width: 145px;
    min-height: 58px;
    padding: 9px 10px;
  }

  .step-button span {
    width: 24px;
    height: 24px;
  }

  .summary-strip {
    grid-template-columns: repeat(3, 1fr);
    min-height: 48px;
  }

  .summary-strip div {
    justify-content: center;
    padding: 0 8px;
  }

  .summary-strip p {
    display: none;
  }

  .step-panel {
    gap: 13px;
    padding-top: 18px;
  }

  .panel-heading h2 {
    font-size: 20px;
  }

  .panel-heading,
  .parts-matcher-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .spec-import-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-toolbar {
    grid-template-columns: 1fr 1fr;
    padding: 11px;
  }

  .search-field,
  .search-button {
    grid-column: 1 / -1;
  }

  .tender-workspace {
    display: flex;
    flex-direction: column;
  }

  .selection-panel {
    position: static;
    order: -1;
    width: 100%;
    min-height: auto;
    padding: 13px;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .empty-selection {
    min-height: 58px;
  }

  .selected-details h3 {
    font-size: 14px;
  }

  .selected-facts {
    grid-template-columns: 1fr 1fr;
  }

  .tender-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
  }

  .tender-card-side {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .tender-price {
    text-align: left;
  }

  .tender-stats {
    grid-template-columns: 1fr 1fr;
  }

  .tender-stats div:last-child {
    grid-column: 1 / -1;
  }

  .tender-actions .source-link {
    display: none;
  }

  .wizard-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 10px 0;
    background: var(--bg);
  }

  .wizard-actions button {
    flex: 1;
  }

  .wizard-actions .primary-button {
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .data-editor {
    min-height: 330px;
  }

  .part-requirement {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .part-actions {
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: start;
  }

  .exist-result {
    padding-left: 14px;
  }

  .exist-option {
    grid-template-columns: minmax(0, 1fr);
  }

  .exist-option-side {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .exist-option-side .source-link {
    grid-column: auto;
  }

  .technical-actions {
    display: grid;
  }

  .price-preview-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }

  .price-preview-stock {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
