/* Shared spacing for links styled as buttons, cards and form actions. */
:root {
  --editor-gutter: 24px;
  --action-inset: 16px;
}

/* The address is the primary request heading; notes retain their line breaks. */
.compact-editor .request-address,.compact-editor .driver-result-context>strong{font-size:24px;line-height:1.25;overflow-wrap:anywhere}
.request-address-field input[name=address_text]{font-size:22px;font-weight:600;line-height:1.3}
.request-note{margin:12px 0;font-size:14px;line-height:1.5}.request-note>b{font-size:13px}.request-note p{white-space:pre-wrap;margin:4px 0;overflow-wrap:anywhere}.request-note small{display:block;font-size:12px;line-height:1.4;color:#687789}
.logistics-note{padding:12px;border:1px solid #dbe3ef;border-radius:8px;background:#f3f6fb}
.kgm-content h3,.additional-request-table td:nth-child(2)>a,.additional-table a.address{font-size:21px;font-weight:700;line-height:1.3;overflow-wrap:anywhere}
.driver-mode .worker-card h2,.master-mode .worker-card h2{font-size:21px;line-height:1.25}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
}

:is(.dispatch-mode, .driver-mode, .master-mode) .compact-editor .modal-footer,
.quick-assignment .modal-footer,
#dispatch-dialog > .modal-footer {
  gap: 10px;
  flex-wrap: wrap;
  padding: var(--action-inset) 0;
  padding-bottom: max(var(--action-inset), env(safe-area-inset-bottom));
  margin-top: 12px;
  bottom: 0;
  border-top: 1px solid #e4e9ef;
}

:is(.dispatch-mode, .driver-mode, .master-mode) .compact-editor > .modal-footer,
.quick-assignment > .modal-footer,
#dispatch-dialog > .modal-footer {
  padding-inline: var(--editor-gutter);
  margin-top: 0;
}

.modal-footer > :is(button, .button) {
  max-width: 100%;
  min-height: 40px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.modal-heading > [data-close] { flex-shrink: 0; }
.modal-heading h2 { min-width: 0; overflow-wrap: anywhere; }
.compact-editor .editor-supplement form > button { margin-top: 12px; }
.compact-editor :is(.resource-row, .resource-picker) > button { flex-shrink: 0; }
.compact-editor button:is([data-remove-fuel], [data-remove-resource]) {
  justify-self: end;
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid #e4cdd0;
  border-radius: 8px;
  background: #fff;
  color: #b3343b;
}
.compact-editor [data-add-fuel] { margin-top: 12px; }

.worker-card > .button { margin-top: 8px; }
.driver-mode .worker-card:has(> .button) { padding: 14px; }
.worker-actions > :is(button, .button, form) { min-width: 0; }

/* Capsule outline for the primary order-creation action. */
.dispatch-mode .new-order-action, .dispatch-mode .title > .new-order-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 7px 20px;
  border: 2.5px solid currentColor;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}
.dispatch-mode .new-order-action:hover {
  background: #f1f5ff;
  text-decoration: none;
}
.dispatch-mode .new-order-action:focus-visible {
  outline: 3px solid #8ba9ef;
  outline-offset: 3px;
}

@media (max-width: 700px) {
  :root { --editor-gutter: 14px; --action-inset: 14px; }
  .modal-footer > :is(button, .button) { min-height: 44px; }
  .dispatch-mode .new-order-action, .dispatch-mode .title > .new-order-action { min-height: 44px; padding-inline: 16px; font-size: 13px; }
}

/* Shift date and equipment fields share a bounded grid on every screen. */
:is(.dispatch-mode,.driver-mode) .shift-editor .shift-fields {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start;
}
.shift-editor .shift-fields > label {
  display:flex;flex-direction:column;gap:6px;margin:0;min-width:0;
}
.shift-editor .shift-fields :is(input,select) {
  display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:42px;margin:0;
}
.shift-editor input[type=date] { min-inline-size:0; }
.dispatch-mode .shift-filters { display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px; }
.dispatch-mode .shift-filters > label { display:flex;flex-direction:column;gap:6px;flex:0 1 175px;min-width:0;margin:0; }
.dispatch-mode .shift-filters > label input { box-sizing:border-box;width:100%;min-width:0;max-width:100%;margin:0; }
.dispatch-mode .shift-filters > select { flex:1 1 180px;min-width:0; }
.dispatch-mode .route-refresh-request { display:inline-flex;align-items:center;gap:5px;flex-shrink:0;min-height:30px;padding:4px 9px;border:1px solid #d9e2ed;border-radius:7px;background:#f6f9fd;color:#355783;font-size:11px;font-weight:500; }
.route-refresh-request span { font-size:20px;line-height:1; }
.route-refresh-request:disabled { opacity:.55;cursor:wait; }
.dispatch-mode .group-bar { flex-wrap:wrap; }
.driver-mode .route-refresh-notice { padding:9px 12px;border-radius:8px;background:#edf4ff;color:#355783;font-size:12px;line-height:1.4; }
@media(max-width:650px) {
  :is(.dispatch-mode,.driver-mode) .shift-editor .shift-fields { grid-template-columns:minmax(0,1fr); }
  .shift-editor .shift-fields > label { grid-column:1/-1; }
  .dispatch-mode .shift-filters > label { flex:1 1 130px; }
}
/* Shared parking marker: prominent like the overdue alert, with road-sign colors. */
.parking-sign,.dispatch-mode .dispatch-row .parking-sign{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;box-sizing:border-box;width:24px;height:28px;border:1px solid #1160b8;border-radius:3px;background:#1266bc!important;box-shadow:inset 0 0 0 2px #fff;color:#fff!important;font:800 21px/1 Roboto,Arial,sans-serif;vertical-align:middle;cursor:default}
.worker-operation{display:flex;align-items:center;gap:10px;min-width:0}
.dispatch-mode .dispatch-register:has(.parking-sign) .col-overdue{width:44px}
.dispatch-mode .dispatch-register .td-overdue{white-space:nowrap}
.dispatch-mode .td-overdue .parking-sign+.overdue-alert{margin-left:4px;vertical-align:middle}
@media(max-width:700px){.dispatch-mode .dispatch-register:has(.parking-sign) .dispatch-row{grid-template-columns:24px 42px 44px 40px minmax(0,1fr) 26px 32px}.dispatch-mode .td-overdue .parking-sign{width:22px;height:26px;font-size:20px}}

/* Additional requests: readable address and notes across narrow driver screens. */
.driver-mode .additional-workspace .worker-card{padding:14px}
.driver-mode .additional-workspace .worker-card-head strong{font-size:13px;line-height:1.4;color:#607084;font-weight:500}
.driver-mode .additional-workspace .worker-card h2{font-size:24px;line-height:1.25;margin:7px 0 9px}
.driver-mode .additional-workspace .worker-job-content>div{min-width:0}
.driver-mode :is(.additional-workspace,.additional-editor) .request-note{padding:12px;background:#f4f7fb;border-radius:8px;margin:12px 0}
.driver-mode :is(.additional-workspace,.additional-editor) .request-note p{font-size:15px;line-height:1.5;color:#263341;margin:5px 0 0}
.driver-mode .additional-workspace .worker-card>.button{width:100%;min-height:48px;margin-top:10px;font-size:15px}
.driver-mode .additional-editor .driver-result-context>strong{font-size:24px;line-height:1.25}
.driver-mode .additional-editor .driver-result-context>b,.driver-mode .additional-editor .driver-result-context>span{overflow-wrap:anywhere}
.driver-mode .additional-editor .driver-reset-form{flex-wrap:wrap;gap:8px}
.driver-mode .additional-editor .driver-reset-form button{min-height:48px;flex:1 1 100%}
.driver-mode .additional-editor .driver-reset-form small{flex-basis:100%}
.driver-mode .additional-editor .modal-heading>[data-close]{min-width:44px;min-height:44px;flex-shrink:0}
.additional-result-summary dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
.additional-result-summary dl>div{padding:12px;background:#f5f7fa;border-radius:8px}
.additional-result-summary dt{font-size:13px;color:#607084}.additional-result-summary dd{font-size:20px;font-weight:600;margin:5px 0 0}
.additional-result-summary .result-note{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:650px){
 .driver-mode .additional-workspace .worker-job-content{grid-template-columns:minmax(0,1fr);gap:8px}
 .driver-mode .additional-workspace .worker-request-photo{width:100%;height:160px;object-fit:contain;margin:0;background:#f4f7fb}
 .driver-mode .additional-editor .upload-grid{grid-template-columns:minmax(0,1fr)}
 .driver-mode .additional-editor :is(input:not([type=hidden]):not([type=checkbox]),select,textarea){font-size:16px;min-height:48px}
 .driver-mode .additional-editor .driver-volume input{font-size:24px;min-height:58px}
 .driver-mode .additional-editor .modal-footer>button{min-height:48px;font-size:16px}
 .driver-mode .additional-editor .photo-source{min-height:48px}
}
@media(max-width:420px){
 .driver-mode .additional-editor .editor-grid{grid-template-columns:minmax(0,1fr)}
 .additional-result-summary dl{grid-template-columns:minmax(0,1fr)}
}

/* Master additional requests: responsive cards and comfortable result entry. */
.master-mobile-open{display:none}
.master-mode .additional-editor .job-hero .request-address{font-size:24px;line-height:1.25;overflow-wrap:anywhere}
.master-mode .additional-editor .job-hero>p{overflow-wrap:anywhere}
.master-mode :is(.master-additional-workspace,.additional-editor) .request-note{padding:12px;background:#f4f7fb;border:1px solid transparent;border-radius:8px;margin:12px 0}
.master-mode :is(.master-additional-workspace,.additional-editor) .request-note p{font-size:15px;line-height:1.5;color:#263341;margin:5px 0 0}
.master-mode :is(.master-additional-workspace,.additional-editor) .logistics-note{background:#fff8e8;border-color:#ead7a8}
.master-mode :is(.master-additional-workspace,.additional-editor) .logistics-note small{color:#6b5a37;line-height:1.5}
.master-mode .additional-editor .modal-heading>[data-close]{min-width:44px;min-height:44px;flex-shrink:0}
.master-mode .additional-editor .editor-grid label:has([name=volume]){grid-column:1/-1;font-size:15px}
.master-mode .additional-editor .editor-grid input[name=volume]{height:58px;font-size:24px;font-weight:600}
.master-mode .additional-editor .modal-footer>button[value=complete],.master-mode .master-complete{background:#238341;border:1px solid #1d7138;color:white}
.master-mode .additional-editor .modal-footer>button[value=complete]:hover,.master-mode .master-complete:hover{background:#1b6d35}
.master-mode .additional-editor .check{min-height:44px;line-height:1.5}
.master-mode .additional-editor .check:has([name=confirm]){padding:12px;background:#f4f7fb;border-radius:8px;align-items:flex-start}
.master-mode .additional-editor .check input{width:22px;height:22px;flex:0 0 22px;margin:0;accent-color:#238341}
@media(max-width:700px){
 .master-mode .master-additional-workspace .title h1{font-size:22px;line-height:1.25}
 .master-mode .master-additional-workspace .tabs a{font-size:13px;padding:12px 9px}
 .master-mode .master-additional-workspace .filters{gap:8px;align-items:stretch}
 .master-mode .master-additional-workspace .filters :is(input,select,button){font-size:16px;min-height:48px}
 .master-mode .master-additional-workspace .filters input[name=q]{flex:1 1 100%;min-width:0}
 .master-mode .master-additional-workspace .filters>a{display:inline-flex;align-items:center;min-height:44px;padding:0 8px}
 .master-mode .master-additional-workspace>p{font-size:13px}
 .master-mode .master-additional-workspace .additional-table{border:0;overflow:visible;background:transparent}
 .master-mode .master-additional-workspace .additional-table :is(table,tbody){display:block;min-width:0;width:100%}
 .master-mode .master-additional-workspace .additional-table thead{display:none}
 .master-mode .master-additional-workspace .additional-table tr[data-modal-row]{display:flex;flex-direction:column;min-width:0;padding:14px;margin:0 0 12px;border:1px solid #dfe5eb;border-radius:12px;background:#fff}
 .master-mode .master-additional-workspace .additional-table td{display:block;min-width:0;padding:0;border:0;overflow-wrap:anywhere}
 .master-mode .master-additional-workspace .additional-table td:nth-child(2){order:0;font-size:13px;color:#607084;margin-bottom:7px}
 .master-mode .master-additional-workspace .additional-table td:nth-child(3){order:1}
 .master-mode .master-additional-workspace .additional-table td:nth-child(3)>.address{display:block;font-size:24px;line-height:1.25}
 .master-mode .master-additional-workspace .additional-table td:nth-child(3)>small{font-size:14px;margin-top:8px}
 .master-mode .master-additional-workspace .additional-table td:first-child{order:2}
 .master-mode .master-additional-workspace .additional-table td:first-child small:before{content:'Подана '}
 .master-mode .master-additional-workspace .additional-table td:nth-child(4){order:3;color:#607084;font-size:12px;margin:6px 0}
 .master-mode .master-additional-workspace .additional-table td:nth-child(4):before{content:'Ответственный: '}
 .master-mode .master-additional-workspace .additional-table td:last-child{order:4}
 .master-mode .master-mobile-open{display:flex;width:100%;min-height:48px;margin-top:12px;font-size:15px}
 .master-mode .additional-editor .modal-body{padding:14px}
 .master-mode .additional-editor .editor-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
 .master-mode .additional-editor label{font-size:14px}
 .master-mode .additional-editor :is(input:not([type=hidden]):not([type=checkbox]),select,textarea){font-size:16px;min-height:48px}
 .master-mode .additional-editor .editor-grid input[name=volume]{font-size:24px;min-height:58px}
 .master-mode .additional-editor textarea{min-height:100px}
 .master-mode .additional-editor .upload-grid{grid-template-columns:minmax(0,1fr)}
 .master-mode .additional-editor .photo-source{min-height:48px}
 .master-mode .additional-editor .upload-slot{padding:12px}
 .master-mode .additional-editor .request-photos img{width:100%;height:180px;object-fit:contain}
 .master-mode .additional-editor .resource-picker{flex-wrap:wrap}
 .master-mode .additional-editor .resource-picker select{flex:1 1 100%}
 .master-mode .additional-editor .resource-picker button{min-height:48px;flex:1}
 .master-mode .additional-editor .resource-row{flex-wrap:wrap;gap:8px}
 .master-mode .additional-editor .resource-row>span{flex:1 1 100%;overflow-wrap:anywhere}
 .master-mode .additional-editor .resource-row label{flex:1;max-width:none;min-width:0}
 .master-mode .additional-editor .resource-row button{min-width:44px;min-height:44px;flex-shrink:0}
 .master-mode .additional-editor .modal-footer>button:last-child{flex:1;min-height:48px;font-size:16px}
}
@media(max-width:420px){.master-mode .additional-editor .editor-grid{grid-template-columns:minmax(0,1fr)}}
