/* К5 · Карточка заказа. Единый визуальный язык ERP. */
#order-card-modal.ow-order-modal {
  --ow-ink: #302d2a;
  --ow-muted: #8e8580;
  --ow-line: #e7e1dc;
  --ow-soft: #f8f6f4;
  --ow-accent: #9d2d42;
  --ow-success: #2f7b51;
  --ow-warning: #9a6419;
  padding: 14px;
  background: rgba(20, 18, 17, .64);
  backdrop-filter: blur(3px);
}

#order-card-modal.ow-order-modal > .modal {
  width: min(1180px, calc(100vw - 28px)) !important;
  max-width: none !important;
  max-height: calc(100vh - 28px) !important;
  border-radius: 16px !important;
  background: #f5f3f1;
  box-shadow: 0 28px 80px rgba(22, 18, 16, .32);
}

#order-card-modal.ow-order-modal,
#order-card-modal.ow-order-modal button,
#order-card-modal.ow-order-modal input,
#order-card-modal.ow-order-modal select,
#order-card-modal.ow-order-modal textarea {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-variant-numeric: tabular-nums;
}

#order-card-modal.ow-order-modal .modal-header {
  min-height: 60px;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid var(--ow-line);
}

#order-card-modal.ow-order-modal .modal-header h3 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  color: var(--ow-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.018em;
}

.ow-modal-title-label {
  color: var(--ow-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

#order-card-modal.ow-order-modal .modal-body {
  max-height: none !important;
  padding: 0 !important;
  background: #f5f3f1;
  scroll-behavior: smooth;
}

#order-card-modal.ow-order-modal .modal-body.ow-refreshing::before {
  content: '';
  position: sticky;
  top: 0;
  z-index: 20;
  display: block;
  width: 100%;
  height: 3px;
  margin-bottom: -3px;
  background: linear-gradient(90deg, transparent, var(--ow-accent), transparent);
  background-size: 45% 100%;
  animation: ow-refresh 1s linear infinite;
}

#order-card-modal.ow-order-modal .modal-footer {
  min-height: 62px;
  padding: 11px 20px;
  background: #fff;
  border-top: 1px solid var(--ow-line);
}

#order-card-modal.ow-order-modal .modal-footer .btn,
#order-card-modal.ow-order-modal .ow-action-card .btn,
#order-card-modal.ow-order-modal .ow-section .btn {
  min-height: 38px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
}

.ow-workspace {
  display: grid;
  gap: 12px;
  padding: 14px 16px 20px;
  color: var(--ow-ink);
  font-size: 12px;
  line-height: 1.4;
}

.ow-hero,
.ow-section {
  overflow: hidden;
  border: 1px solid var(--ow-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(45, 37, 32, .025);
  scroll-margin-top: 12px;
}

.ow-hero-main {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto;
  align-items: start;
  gap: 24px;
  padding: 18px 20px 16px;
}

.ow-customer { min-width: 0; }

.ow-customer > span,
.ow-hero-meta span,
.ow-section-head > div > span,
.ow-section-total span,
.ow-metric > span,
.ow-readiness-row span,
.ow-finance-summary span,
.ow-delivery-address span {
  display: block;
  color: var(--ow-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.ow-customer h2 {
  margin: 5px 0 0;
  color: var(--ow-ink);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.ow-contact-line {
  display: flex;
  align-items: center;
  gap: 6px 13px;
  flex-wrap: wrap;
  margin-top: 7px;
  color: #756d68;
  font-size: 11px;
}

.ow-contact-line b { color: #544d48; }
.ow-contact-line a { color: #756d68; text-decoration: none; }
.ow-contact-line a:hover { color: var(--ow-accent); }

.ow-hero-meta {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(124px, auto);
  overflow: hidden;
  border: 1px solid var(--ow-line);
  border-radius: 11px;
  background: #fbfaf9;
}

.ow-hero-meta > div {
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid var(--ow-line);
}

.ow-hero-meta > div:first-child { border-left: 0; }
.ow-hero-meta b {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #3b3633;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ow-prod-code {
  color: var(--ow-accent) !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  letter-spacing: .06em;
}

.ow-priority { color: #a66413 !important; }

.ow-status {
  display: inline-flex !important;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0edea;
  color: #716963;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  line-height: 1.15;
  white-space: nowrap;
}

.ow-status.success { background: #eaf5ee; color: var(--ow-success); }
.ow-status.warning { background: #fff4e2; color: var(--ow-warning); }
.ow-status.danger { background: #fff0f1; color: #a23346; }
.ow-status.neutral { background: #f0edea; color: #716963; }

.ow-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 20px 14px;
  padding: 12px 14px;
  border: 1px solid var(--ow-line);
  border-radius: 11px;
  background: var(--ow-soft);
}

.ow-action-card > div > span {
  display: block;
  margin-bottom: 3px;
  color: #847a74;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ow-action-card h3 {
  margin: 0;
  color: var(--ow-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.ow-action-card p {
  margin: 3px 0 0;
  color: #817872;
  font-size: 11px;
  line-height: 1.4;
}

.ow-action-card.warning { border-color: #ead8b7; background: #fffaf2; }
.ow-action-card.warning > div > span { color: #a36a18; }
.ow-action-card.success { border-color: #cfe4d6; background: #f5faf7; }
.ow-action-card.success > div > span { color: var(--ow-success); }
.ow-action-card.info { background: #f8f6f4; }
.ow-action-card .btn { flex: 0 0 auto; }

.ow-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ow-line);
  border-bottom: 1px solid var(--ow-line);
}

.ow-metric {
  min-width: 0;
  padding: 13px 17px;
  border-right: 1px solid var(--ow-line);
}

.ow-metric:last-child { border-right: 0; }
.ow-metric b {
  display: block;
  margin-top: 5px;
  color: #37322f;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.018em;
}

.ow-metric small {
  display: block;
  margin-top: 5px;
  color: #978e88;
  font-size: 9.5px;
}

.ow-metric.success b { color: var(--ow-success); }
.ow-metric.danger b,
.ow-metric.danger small { color: #a33247; }

.ow-stage-shell {
  padding: 14px 18px 17px;
  background: #fbfaf9;
}

.ow-stage-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 9px;
}

.ow-stage-heading > span {
  color: #5d5550;
  font-size: 11px;
  font-weight: 800;
}

.ow-stage-heading > small {
  color: #9a918b;
  font-size: 9.5px;
}

.ow-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

#order-card-modal.ow-order-modal .ow-progress-step {
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 19px;
  align-items: start;
  gap: 8px;
  min-width: 0;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--ow-line);
  border-radius: 10px;
  background: #fff;
  color: var(--ow-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

#order-card-modal.ow-order-modal .ow-progress-step:hover {
  border-color: #cfc5bf;
  background: #fff;
  transform: translateY(-1px);
}

.ow-progress-index {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  background: #f0edea;
  color: #827973;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
}

.ow-progress-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.ow-progress-label {
  display: block;
  color: #938983;
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.ow-progress-value {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #49423e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ow-progress-meta {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #9a918b;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ow-progress-mark {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #ddd6d1;
  border-radius: 50%;
  color: #a09994;
  font-size: 9px;
  font-weight: 900;
}

.ow-progress-step--done { border-color: #d5e6db !important; background: #f7fbf8 !important; }
.ow-progress-step--done .ow-progress-index { background: #e5f2e9; color: var(--ow-success); }
.ow-progress-step--done .ow-progress-value { color: #356f50; }
.ow-progress-step--done .ow-progress-mark { border-color: var(--ow-success); background: var(--ow-success); color: #fff; }
.ow-progress-step--current { border-color: #c98491 !important; box-shadow: inset 0 0 0 1px rgba(157, 45, 66, .12); }
.ow-progress-step--current .ow-progress-index { background: #f6e9ec; color: var(--ow-accent); }
.ow-progress-step--current .ow-progress-value { color: var(--ow-accent); }
.ow-progress-step--current .ow-progress-mark { border-color: var(--ow-accent); background: var(--ow-accent); color: #fff; }
.ow-progress-step--pending { background: #faf9f8 !important; }
.ow-progress-step--pending .ow-progress-value { color: #756d68; }
.ow-progress-step--danger { border-color: #ebcbd1 !important; background: #fff7f8 !important; }
.ow-progress-step--danger .ow-progress-index,
.ow-progress-step--danger .ow-progress-mark { border-color: #a23346; background: #a23346; color: #fff; }

.ow-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--ow-line);
  background: #fdfcfb;
}

.ow-section-head.compact { padding: 14px 16px; }
.ow-section-head h3 {
  margin: 4px 0 0;
  color: var(--ow-ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.012em;
}

.ow-section-total { text-align: right; }
.ow-section-total b {
  display: block;
  margin-top: 4px;
  color: var(--ow-accent);
  font-size: 17px;
  font-weight: 800;
}

.ow-items { display: grid; }
.ow-order-item { padding: 0 18px; border-bottom: 1px solid #eeeae7; }
.ow-order-item:last-child { border-bottom: 0; }
.ow-order-item-main {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 90px 135px 140px;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
}

.ow-order-item-name h4 {
  margin: 0;
  color: var(--ow-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.ow-order-item-name > div { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.ow-order-item-name code,
.ow-composition-list code {
  color: #80766f;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 650;
}

.ow-chip {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid #e3d8dc;
  border-radius: 999px;
  background: #f8f1f3;
  color: #8f2d40;
  font-size: 8.5px;
  font-weight: 800;
}

.ow-order-item-number,
.ow-order-item-total { text-align: right; }
.ow-order-item-number span,
.ow-order-item-total span {
  display: block;
  color: #9b918a;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.ow-order-item-number b,
.ow-order-item-total b {
  display: block;
  margin-top: 4px;
  color: #403a36;
  font-size: 12px;
  font-weight: 800;
}

.ow-order-item-number small { display: block; margin-top: 3px; color: #a33347; font-size: 8.5px; }
.ow-order-item-total b { color: var(--ow-ink); font-size: 14px; }
.ow-config-note {
  display: flex;
  gap: 9px;
  margin: -1px 0 12px;
  padding: 8px 10px;
  border: 1px solid #ead8bd;
  border-radius: 9px;
  background: #fffaf2;
  color: #755529;
  font-size: 10px;
}

.ow-config-note b { flex: 0 0 auto; }
.ow-composition,
.ow-history {
  overflow: hidden;
  border: 1px solid var(--ow-line);
  border-radius: 9px;
  background: #faf9f7;
}

.ow-composition { margin: 0 0 12px; }
.ow-history { margin: 0 14px 13px; }
.ow-composition summary,
.ow-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  color: #655d57;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.ow-composition summary::-webkit-details-marker,
.ow-history summary::-webkit-details-marker { display: none; }
.ow-composition summary::after,
.ow-history summary::after { content: '⌄'; margin-left: auto; color: #9a9089; }
.ow-composition[open] summary::after,
.ow-history[open] summary::after { transform: rotate(180deg); }
.ow-composition summary b,
.ow-history summary b { margin-left: auto; color: #9a9089; font-size: 9px; }
.ow-composition-list { border-top: 1px solid var(--ow-line); }
.ow-composition-list > div {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr) 65px;
  gap: 11px;
  align-items: center;
  padding: 8px 11px;
  border-top: 1px solid #efebe8;
  font-size: 10px;
}

.ow-composition-list > div:first-child { border-top: 0; }
.ow-composition-list code { color: var(--ow-accent); font-weight: 750; }
.ow-composition-list span { color: #59514c; }
.ow-composition-list small { color: #80766f; font-size: 9px; font-weight: 750; text-align: right; }

.ow-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; scroll-margin-top: 12px; }
.ow-subsection { min-width: 0; }
.ow-readiness-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 13px 14px; }
.ow-readiness-row > div,
.ow-finance-summary > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #eee9e5;
  border-radius: 9px;
  background: #fcfbfa;
}

.ow-readiness-row b {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #3b3633;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ow-readiness-row small { display: block; overflow: hidden; margin-top: 4px; color: #908680; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ow-section-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--ow-line); }
.ow-payment-complete:disabled {
  border-color: #cfe4d6 !important;
  background: #f2f8f4 !important;
  color: var(--ow-success) !important;
  cursor: default;
  opacity: 1 !important;
}
.ow-document-list { padding: 0 14px; }
.ow-document-row {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #f0ece9;
}

.ow-document-row > div:first-child span { display: block; color: #8f857f; font-size: 8.5px; font-weight: 800; text-transform: uppercase; }
.ow-document-row > div:first-child b { display: block; margin-top: 3px; color: #37312e; font-size: 11px; font-weight: 800; }
.ow-document-row > div:first-child small { display: block; margin-top: 3px; color: #9b918a; font-size: 8.5px; }
.ow-inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.ow-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 6px 11px;
  border: 1px solid #d9d2cc;
  border-radius: 7px;
  background: #fff;
  color: #625a55;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.ow-text-action:hover {
  border-color: #b98e97;
  background: #faf3f5;
  color: var(--ow-accent);
}

.ow-text-action.danger {
  border-color: #e8c5cb;
  background: #fff9f9;
  color: #a4384a;
}

.ow-text-action.danger:hover {
  border-color: #cf8290;
  background: #fff0f2;
  color: #922c3f;
}
.ow-small-primary {
  height: 29px;
  padding: 0 9px;
  border: 1px solid var(--ow-accent);
  border-radius: 8px;
  background: var(--ow-accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
}

.ow-finance-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 13px 14px 9px; }
.ow-finance-summary b { display: block; margin-top: 5px; color: #39332f; font-size: 13px; font-weight: 800; }
.ow-finance-summary .paid { border-color: #d8e9de; background: #f5faf7; }
.ow-finance-summary .paid b { color: var(--ow-success); }
.ow-finance-summary .balance { border-color: #edd5da; background: #fff7f8; }
.ow-finance-summary .balance b { color: #a13247; }
.ow-progress { height: 4px; margin: 0 14px 9px; border-radius: 4px; background: #eeeae7; overflow: hidden; }
.ow-progress span { display: block; height: 100%; border-radius: 4px; background: var(--ow-success); transition: width .25s; }
.ow-payment-list { border-top: 1px solid var(--ow-line); }
.ow-payment-row {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 100px minmax(85px, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #f0ece9;
}

.ow-payment-row:first-child { border-top: 0; }
.ow-payment-row > div b { display: block; color: #514943; font-size: 9.5px; }
.ow-payment-row > div small { display: block; margin-top: 3px; color: #958b84; font-size: 8.5px; }
.ow-payment-row strong { color: var(--ow-success); font-size: 10.5px; text-align: right; }
.ow-payment-row > span { overflow: hidden; color: #77706a; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.ow-payment-row.cancelled { opacity: .55; }
.ow-payment-row.cancelled strong { color: #8f857f; }
.ow-payment-row em { color: #8f857f; font-size: 8.5px; font-style: normal; }

.ow-production-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--ow-line); }
.ow-production-grid .ow-metric { padding: 14px 16px; }
.ow-production-grid .ow-metric b { font-size: 14px; }
.ow-delivery-address { padding: 13px 16px; border-bottom: 1px solid var(--ow-line); }
.ow-delivery-address b { display: block; margin-top: 5px; color: #47403c; font-size: 11px; }
.ow-gate-note {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 13px 16px;
  padding: 10px 12px;
  border: 1px solid #ead6b5;
  border-radius: 9px;
  background: #fff9ef;
  color: #77531f;
  font-size: 10px;
}

.ow-gate-note.ready { border-color: #d0e6d8; background: #f5faf7; color: #356b4d; }
.ow-gate-note b { white-space: nowrap; }
.ow-gate-note span { line-height: 1.4; }
.ow-notes > div:not(.ow-section-head) { padding: 12px 16px; border-top: 1px solid #f0ece9; }
.ow-notes > div:not(.ow-section-head):first-of-type { border-top: 0; }
.ow-notes b { color: #5e554f; font-size: 10px; }
.ow-notes p { margin: 4px 0 0; color: #817770; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.ow-empty { padding: 26px; color: #a0968f; font-size: 11px; text-align: center; }
.ow-empty.compact { padding: 17px; }
.ow-footer-status { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.ow-footer-status span { overflow: hidden; color: #4d4641; font-size: 10.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.ow-footer-status small { margin-top: 3px; color: #9a9089; font-size: 8.5px; }

.ow-loading { display: grid; gap: 12px; padding: 16px; }
.ow-loading-top,
.ow-loading-action,
.ow-loading-grid i,
.ow-loading-panel {
  display: block;
  border-radius: 13px;
  background: linear-gradient(90deg, #eee9e5 25%, #f7f4f1 50%, #eee9e5 75%);
  background-size: 200% 100%;
  animation: ow-shimmer 1.25s infinite;
}

.ow-loading-top { height: 90px; }
.ow-loading-action { height: 68px; }
.ow-loading-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; }
.ow-loading-grid i { height: 70px; border-radius: 0; }
.ow-loading-panel { height: 280px; }
.ow-loading-panel.short { height: 170px; }
.ow-error { display: flex; min-height: 340px; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 28px; text-align: center; }
.ow-error b { font-size: 16px; }
.ow-error span { max-width: 600px; color: #887e77; font-size: 11px; }
.ow-error .btn { margin-top: 8px; }

@keyframes ow-shimmer { to { background-position: -200% 0; } }
@keyframes ow-refresh { from { background-position: -55vw 0; } to { background-position: 100vw 0; } }

@media (max-width: 1040px) {
  .ow-hero-main { grid-template-columns: 1fr; gap: 14px; }
  .ow-hero-meta { width: 100%; grid-auto-columns: minmax(0, 1fr); }
  .ow-stage-shell { overflow: hidden; }
  .ow-stages { overflow-x: auto; grid-template-columns: repeat(5, minmax(190px, 1fr)); padding-bottom: 4px; }
  .ow-two-column { grid-template-columns: 1fr; }
  .ow-order-item-main { grid-template-columns: minmax(220px, 1fr) 75px 115px 125px; }
}

@media (max-width: 760px) {
  .ow-metrics,
  .ow-production-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ow-metric:nth-child(2) { border-right: 0; }
  .ow-metric:nth-child(-n + 2) { border-bottom: 1px solid var(--ow-line); }
}

@media (max-width: 680px) {
  #order-card-modal.ow-order-modal { padding: 0; }
  #order-card-modal.ow-order-modal > .modal { width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
  #order-card-modal.ow-order-modal .modal-header { padding: 12px 15px; }
  #order-card-modal.ow-order-modal .modal-footer { padding: 9px 11px; flex-wrap: wrap; }
  #order-card-modal.ow-order-modal .modal-footer .ow-footer-status { display: none; }
  #order-card-modal.ow-order-modal .modal-footer .btn { flex: 1; min-width: 120px; }
  .ow-workspace { gap: 9px; padding: 9px; }
  .ow-hero,
  .ow-section { border-radius: 12px; }
  .ow-hero-main { padding: 15px; }
  .ow-customer h2 { font-size: 19px; }
  .ow-hero-meta { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .ow-hero-meta > div { border-top: 1px solid var(--ow-line); border-left: 0; }
  .ow-hero-meta > div:nth-child(even) { border-left: 1px solid var(--ow-line); }
  .ow-hero-meta > div:nth-child(-n + 2) { border-top: 0; }
  .ow-action-card { align-items: flex-start; flex-direction: column; margin: 0 13px 13px; }
  .ow-action-card .btn { width: 100%; }
  .ow-metric { padding: 11px; }
  .ow-metric b { font-size: 15px; }
  .ow-stage-shell { padding: 12px 13px 14px; }
  .ow-stage-heading small { display: none; }
  .ow-stages { grid-template-columns: repeat(5, minmax(178px, 1fr)); }
  .ow-section-head { padding: 13px; }
  .ow-order-item { padding: 0 13px; }
  .ow-order-item-main { grid-template-columns: 1fr 1fr 1fr; padding: 12px 0; }
  .ow-order-item-name { grid-column: 1 / -1; }
  .ow-order-item-number { text-align: left; }
  .ow-order-item-total { text-align: right; }
  .ow-composition-list > div { grid-template-columns: 100px minmax(0, 1fr) 48px; }
  .ow-readiness-row,
  .ow-finance-summary { grid-template-columns: 1fr; }
  .ow-document-row { grid-template-columns: 1fr auto; }
  .ow-document-row .ow-inline-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .ow-payment-row { grid-template-columns: 1fr auto; }
  .ow-payment-row > span { grid-column: 1; }
  .ow-payment-row > .ow-text-action,
  .ow-payment-row > em { grid-column: 2; grid-row: 2; }
  .ow-gate-note { align-items: flex-start; flex-direction: column; }
  .ow-gate-note b { white-space: normal; }
}

/* К5 · Финальная типографика и пошаговый контроль заказа. */
#order-card-modal.ow-order-modal .ow-workspace {
  gap: 16px;
  padding: 20px 22px 28px;
  font-size: 14px;
  line-height: 1.5;
}

#order-card-modal.ow-order-modal .modal-header {
  min-height: 68px;
  padding: 17px 26px;
}

#order-card-modal.ow-order-modal .modal-header h3 { font-size: 21px; }
#order-card-modal.ow-order-modal .ow-modal-title-label { font-size: 11px; }
#order-card-modal.ow-order-modal .modal-footer { min-height: 70px; padding: 13px 24px; }
#order-card-modal.ow-order-modal .modal-footer .btn,
#order-card-modal.ow-order-modal .ow-action-card .btn,
#order-card-modal.ow-order-modal .ow-section .btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
}

#order-card-modal.ow-order-modal .ow-hero,
#order-card-modal.ow-order-modal .ow-section { border-radius: 16px; }
#order-card-modal.ow-order-modal .ow-hero-main { gap: 28px; padding: 24px 26px 21px; }
#order-card-modal.ow-order-modal .ow-customer > span,
#order-card-modal.ow-order-modal .ow-hero-meta span,
#order-card-modal.ow-order-modal .ow-section-head > div > span,
#order-card-modal.ow-order-modal .ow-section-total span,
#order-card-modal.ow-order-modal .ow-metric > span,
#order-card-modal.ow-order-modal .ow-readiness-row span,
#order-card-modal.ow-order-modal .ow-finance-summary span,
#order-card-modal.ow-order-modal .ow-delivery-address span {
  font-size: 10.5px;
}
#order-card-modal.ow-order-modal .ow-customer h2 { margin-top: 7px; font-size: 27px; }
#order-card-modal.ow-order-modal .ow-contact-line { margin-top: 10px; font-size: 13px; }
#order-card-modal.ow-order-modal .ow-hero-meta > div { padding: 13px 15px; }
#order-card-modal.ow-order-modal .ow-hero-meta b { margin-top: 6px; font-size: 14px; }
#order-card-modal.ow-order-modal .ow-status { padding: 5px 10px; font-size: 11px !important; }

#order-card-modal.ow-order-modal .ow-action-card {
  gap: 24px;
  margin: 0 26px 19px;
  padding: 16px 18px;
  border-radius: 12px;
}
#order-card-modal.ow-order-modal .ow-action-card > div > span { margin-bottom: 5px; font-size: 10.5px; }
#order-card-modal.ow-order-modal .ow-action-card h3 { font-size: 17px; }
#order-card-modal.ow-order-modal .ow-action-card p { margin-top: 5px; font-size: 13px; }

#order-card-modal.ow-order-modal .ow-metric { padding: 18px 21px; }
#order-card-modal.ow-order-modal .ow-metric b { margin-top: 7px; font-size: 23px; }
#order-card-modal.ow-order-modal .ow-metric small { margin-top: 6px; font-size: 11px; }

#order-card-modal.ow-order-modal .ow-stage-shell {
  padding: 21px 23px 23px;
  border-top: 1px solid var(--ow-line);
  background: #fcfbfa;
}
#order-card-modal.ow-order-modal .ow-stage-heading {
  align-items: flex-end;
  margin-bottom: 21px;
}
#order-card-modal.ow-order-modal .ow-stage-heading > div > span {
  display: block;
  color: #8f2638;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
#order-card-modal.ow-order-modal .ow-stage-heading h3 {
  margin: 4px 0 0;
  color: var(--ow-ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}
#order-card-modal.ow-order-modal .ow-stage-heading > small { font-size: 11px; }

#order-card-modal.ow-order-modal .ow-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: visible;
  padding: 0 2px;
}
#order-card-modal.ow-order-modal .ow-progress-step {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 132px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 0 12px 4px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ow-ink);
  text-align: left;
  transform: none !important;
}
#order-card-modal.ow-order-modal .ow-progress-step:focus-visible {
  outline: 2px solid rgba(157,45,66,.45);
  outline-offset: 3px;
  border-radius: 8px;
}
#order-card-modal.ow-order-modal .ow-progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  z-index: 0;
  top: 17px;
  left: calc(50% + 19px);
  right: calc(-50% + 19px);
  height: 2px;
  background: #dfd9d4;
}
#order-card-modal.ow-order-modal .ow-progress-step--done:not(:last-child)::after { background: #b9d7c2; }
#order-card-modal.ow-order-modal .ow-progress-top {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#order-card-modal.ow-order-modal .ow-progress-index {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  box-sizing: border-box;
  border: 2px solid #d8d1cc;
  border-radius: 50%;
  background: #fff;
  color: #716963;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .02em;
}
#order-card-modal.ow-order-modal .ow-progress-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid #d8d1cc;
  border-radius: 50%;
  background: #fff;
  color: #a09690;
  font-size: 12px;
  font-weight: 900;
}
#order-card-modal.ow-order-modal .ow-progress-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 0 2px;
}
#order-card-modal.ow-order-modal .ow-progress-label {
  display: block;
  color: #7f756f;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.25;
  text-transform: none;
}
#order-card-modal.ow-order-modal .ow-progress-value {
  display: block;
  width: 100%;
  overflow: visible;
  color: #38322f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  white-space: normal;
}
#order-card-modal.ow-order-modal .ow-progress-meta {
  display: block;
  width: 100%;
  overflow: visible;
  color: #918781;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}
#order-card-modal.ow-order-modal .ow-progress-step--done .ow-progress-index { border-color: #4f9667; background: #edf8f0; color: #2f7b51; }
#order-card-modal.ow-order-modal .ow-progress-step--done .ow-progress-mark { border-color: #4f9667; background: #4f9667; color: #fff; }
#order-card-modal.ow-order-modal .ow-progress-step--done .ow-progress-value { color: #2f7b51; }
#order-card-modal.ow-order-modal .ow-progress-step--current .ow-progress-index { border-color: var(--ow-accent); background: #f8edf0; color: var(--ow-accent); }
#order-card-modal.ow-order-modal .ow-progress-step--current .ow-progress-mark { border-color: var(--ow-accent); background: var(--ow-accent); color: #fff; }
#order-card-modal.ow-order-modal .ow-progress-step--current .ow-progress-value { color: var(--ow-accent); }
#order-card-modal.ow-order-modal .ow-progress-step--danger .ow-progress-index,
#order-card-modal.ow-order-modal .ow-progress-step--danger .ow-progress-mark { border-color: #a23346; background: #fff0f1; color: #a23346; }
#order-card-modal.ow-order-modal .ow-progress-step--danger .ow-progress-value { color: #a23346; }

#order-card-modal.ow-order-modal .ow-section-head { padding: 19px 22px; }
#order-card-modal.ow-order-modal .ow-section-head h3 { margin-top: 5px; font-size: 20px; }
#order-card-modal.ow-order-modal .ow-section-total b { font-size: 22px; }
#order-card-modal.ow-order-modal .ow-order-item { padding: 0 22px; }
#order-card-modal.ow-order-modal .ow-order-item-main { gap: 18px; padding: 18px 0; }
#order-card-modal.ow-order-modal .ow-order-item-name h4 { font-size: 15px; }
#order-card-modal.ow-order-modal .ow-order-item-name code { font-size: 11px; }
#order-card-modal.ow-order-modal .ow-chip { padding: 4px 8px; font-size: 10px; }
#order-card-modal.ow-order-modal .ow-order-item-number span,
#order-card-modal.ow-order-modal .ow-order-item-total span { font-size: 10px; }
#order-card-modal.ow-order-modal .ow-order-item-number b,
#order-card-modal.ow-order-modal .ow-order-item-total b { margin-top: 5px; font-size: 14px; }
#order-card-modal.ow-order-modal .ow-order-item-total b { font-size: 17px; }
#order-card-modal.ow-order-modal .ow-composition summary,
#order-card-modal.ow-order-modal .ow-history summary { padding: 12px 14px; font-size: 13px; }
#order-card-modal.ow-order-modal .ow-composition-list > div { padding: 11px 14px; font-size: 13px; }
#order-card-modal.ow-order-modal .ow-composition-list code { font-size: 11px; }
#order-card-modal.ow-order-modal .ow-composition-list small { font-size: 11px; }
#order-card-modal.ow-order-modal .ow-readiness-row { padding: 16px 18px; }
#order-card-modal.ow-order-modal .ow-readiness-row > div,
#order-card-modal.ow-order-modal .ow-finance-summary > div { padding: 13px 14px; }
#order-card-modal.ow-order-modal .ow-readiness-row b { margin-top: 6px; font-size: 14px; }
#order-card-modal.ow-order-modal .ow-readiness-row small { margin-top: 5px; font-size: 11px; }
#order-card-modal.ow-order-modal .ow-document-list { padding: 0 18px; }
#order-card-modal.ow-order-modal .ow-document-row { gap: 12px; padding: 14px 0; }
#order-card-modal.ow-order-modal .ow-document-row > div:first-child span { font-size: 10px; }
#order-card-modal.ow-order-modal .ow-document-row > div:first-child b { font-size: 13px; }
#order-card-modal.ow-order-modal .ow-document-row > div:first-child small { font-size: 10px; }
#order-card-modal.ow-order-modal .ow-text-action { min-height: 36px; padding: 7px 13px; border-radius: 8px; font-size: 12px; }
#order-card-modal.ow-order-modal .ow-small-primary { height: 34px; padding: 0 12px; font-size: 12px; }
#order-card-modal.ow-order-modal .ow-finance-summary { padding: 16px 18px 11px; }
#order-card-modal.ow-order-modal .ow-finance-summary b { margin-top: 6px; font-size: 16px; }
#order-card-modal.ow-order-modal .ow-payment-row { gap: 12px; padding: 12px 14px; }
#order-card-modal.ow-order-modal .ow-payment-row > div b { font-size: 12px; }
#order-card-modal.ow-order-modal .ow-payment-row > div small,
#order-card-modal.ow-order-modal .ow-payment-row > span { font-size: 11px; }
#order-card-modal.ow-order-modal .ow-payment-row strong { font-size: 13px; }
#order-card-modal.ow-order-modal .ow-production-grid .ow-metric { padding: 18px 20px; }
#order-card-modal.ow-order-modal .ow-production-grid .ow-metric b { font-size: 17px; }
#order-card-modal.ow-order-modal .ow-delivery-address { padding: 17px 20px; }
#order-card-modal.ow-order-modal .ow-delivery-address b { margin-top: 6px; font-size: 14px; }
#order-card-modal.ow-order-modal .ow-gate-note { margin: 16px 20px; padding: 13px 15px; font-size: 12px; }
#order-card-modal.ow-order-modal .ow-notes p { font-size: 13px; }

@media (max-width: 1040px) {
  #order-card-modal.ow-order-modal .ow-stages { overflow-x: auto; grid-template-columns: repeat(5, minmax(205px, 1fr)); padding-bottom: 8px; }
}
@media (max-width: 680px) {
  #order-card-modal.ow-order-modal .ow-workspace { gap: 11px; padding: 11px 10px 18px; }
  #order-card-modal.ow-order-modal .ow-hero-main { padding: 18px 16px 16px; }
  #order-card-modal.ow-order-modal .ow-customer h2 { font-size: 23px; }
  #order-card-modal.ow-order-modal .ow-action-card { margin: 0 16px 16px; }
  #order-card-modal.ow-order-modal .ow-stage-shell { padding: 18px 16px 20px; }
  #order-card-modal.ow-order-modal .ow-stage-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  #order-card-modal.ow-order-modal .ow-stage-heading h3 { font-size: 18px; }
  #order-card-modal.ow-order-modal .ow-section-head { padding: 16px; }
  #order-card-modal.ow-order-modal .ow-section-head h3 { font-size: 18px; }
}
