.logistics-waybill-editor,
.logistics-waybill-editor * { box-sizing: border-box; }
.logistics-waybill-editor label[hidden], .logistics-dialog label[hidden] { display: none !important; }
.logistics-results.is-waybill-editor {
  overflow: visible;
  max-width: 100%;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.logistics-waybill-editor { display: grid; gap: 12px; }
.logistics-waybill-editor > header {
  position: sticky; top: 0; z-index: 25;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 16px; border: 1px solid #c9dadd; border-radius: 13px;
  background: #fff; box-shadow: 0 8px 22px #102f3a18;
}
.logistics-waybill-editor > header > div { display: flex; align-items: center; gap: 11px; }
.logistics-waybill-editor > header > div:first-child > i {
  width: 43px; height: 43px; display: grid; place-items: center;
  border-radius: 11px; background: #0f7180; color: #fff; font-size: 20px;
}
.logistics-waybill-editor h2 { margin: 0; font-size: 21px; }
.logistics-waybill-editor header p { margin: 3px 0 0; color: #58717a; }
.logistics-waybill-editor header button { min-height: 42px; }
.waybill-error { min-height: 20px; margin: 0; color: #b42318; font-weight: 800; }
.waybill-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.waybill-groups > section {
  border: 1px solid #cbdcdf; border-radius: 13px; background: #fff;
  box-shadow: 0 6px 18px #1239440d; overflow: hidden;
}
.waybill-groups > section:nth-child(7),
.waybill-groups > section:nth-child(8),
.waybill-groups > section:nth-child(9) { grid-column: 1/-1; }
.waybill-groups h3 {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 14px;
  background: #e8f5f4; color: #075864; border-bottom: 1px solid #cbdcdf; font-size: 15px;
}
.waybill-groups h3 i { color: #0d8b8f; }
.waybill-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; padding: 13px; }
.waybill-groups > section:nth-child(7) .waybill-fields,
.waybill-groups > section:nth-child(8) .waybill-fields,
.waybill-groups > section:nth-child(9) .waybill-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
.waybill-fields label { display: flex; flex-direction: column; gap: 6px; color: #163b45; font-weight: 750; }
.waybill-fields input,
.waybill-fields select,
.waybill-fields textarea {
  width: 100%; min-height: 44px; border: 1px solid #b9cdd3; border-radius: 9px;
  padding: 8px 10px; background: #fff; color: #111;
}
.waybill-fields textarea { min-height: 80px; resize: vertical; }
.waybill-fields .is-electronic-code { background: #eef7f8; color: #0f6673; font-weight: 800; border-style: dashed; }
@media (max-width: 920px) {
  .waybill-groups { grid-template-columns: 1fr; }
  .waybill-groups > section { grid-column: 1/-1; }
  .waybill-groups > section:nth-child(n) .waybill-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  #page-logistics { overflow-x: clip; }
  .logistics-waybill-editor > header { position: static; align-items: stretch; flex-direction: column; }
  .logistics-waybill-editor > header > div:last-child { width: 100%; }
  .logistics-waybill-editor > header button { flex: 1; }
  .waybill-groups > section:nth-child(n) .waybill-fields { grid-template-columns: 1fr; }
}
.waybill-media-dialog {box-sizing:border-box;width:min(680px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:20px;overflow:auto;font-family:inherit;overflow-wrap:anywhere}
.waybill-media-dialog * {box-sizing:border-box}
.waybill-media-dialog h2 {font-size:20px;line-height:1.6;margin:0 0 16px}
.waybill-media-dialog>label {display:flex;flex-direction:column;gap:8px}
.waybill-media-dialog input {width:100%;max-width:100%;min-width:0}
.waybill-media-dialog canvas {max-width:100%}
.waybill-media-dialog button {max-width:100%;white-space:normal;margin:4px 0;min-height:40px}
.waybill-tariff-editor {grid-column:1/-1;padding:14px;min-width:0}
.waybill-tariff-editor>p {line-height:1.7;color:#47656c}
.waybill-tariff-picker {display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:center}
.waybill-tariff-picker input,.waybill-tariff-picker select,.waybill-tariff-row input {min-width:0;width:100%;min-height:42px;border:1px solid #b9cdd3;border-radius:8px;padding:8px;background:white;color:#162c35}
.waybill-tariff-row {display:grid;grid-template-columns:2fr 1fr 1fr 1.3fr 1fr auto;gap:10px;align-items:center;padding:14px 0;border-bottom:1px solid #d8e3e5}
.waybill-tariff-row>div:first-child {display:grid;gap:5px;overflow-wrap:anywhere}
.waybill-tariff-row label {display:grid;gap:6px;min-width:0;font-size:12px}
.waybill-tariff-row input[readonly] {background:#edf5f6;border-style:dashed;color:#165769}
.waybill-tariff-row output {font-weight:800;direction:ltr;text-align:center}
.logistics-fields>[hidden],.waybill-tariff-editor [hidden] {display:none!important}
.logistics-dialog .waybill-item-editor {grid-column:1/-1}
@media(max-width:900px){.waybill-tariff-picker{grid-template-columns:1fr}.waybill-tariff-row{grid-template-columns:1fr 1fr}.waybill-tariff-row>div:first-child{grid-column:1/-1}.waybill-tariff-row button{min-height:42px}}
