.modal.delivery-map-dialog { width:min(850px,calc(100vw - 24px)); max-width:850px; }
.admin-dialog.delivery-map-dialog { width:min(1060px,calc(100vw - 24px)); max-width:1060px; }
.delivery-area-maps h3,.delivery-windows h3 { margin:0; }
.delivery-map-editor { margin:14px 0 0; color:#21382f; }
.delivery-map-tools { display:flex; flex-wrap:wrap; align-items:end; gap:8px; margin:10px 0; }
.delivery-map-tools button,.delivery-map-zoom button {
  min-height:38px; padding:7px 11px; border:1px solid #c2d3cb; border-radius:6px; background:white; color:#155849; font:inherit;
}
.delivery-map-tools button[aria-pressed="true"] { background:#d7f5e8; border-color:#4aa884; }
.delivery-map-tools label { display:grid; gap:3px; font-size:12px; font-weight:650; }
.delivery-map-tools input,.delivery-map-tools select { min-height:36px; max-width:100%; padding:5px 8px; border:1px solid #c2d3cb; border-radius:6px; }
.delivery-map-tools input[type="number"] { width:min(145px,36vw); }
.delivery-map-tools .delivery-file { max-width:min(100%,280px); }
.delivery-map-surface {
  height:clamp(265px,40vh,430px); position:relative; overflow:hidden; border-radius:8px; border:1px solid #cbd9d3;
  background:linear-gradient(#cbd8d248 1px,transparent 1px),linear-gradient(90deg,#cbd8d248 1px,transparent 1px),#eef4f1;
  background-size:32px 32px; touch-action:none; cursor:crosshair;
}
.delivery-map-surface canvas,.delivery-map-tiles { position:absolute; inset:0; width:100%; height:100%; }
.delivery-map-tiles img { position:absolute; top:0; left:0; width:256px; height:256px; max-width:none; user-select:none; }
.delivery-map-zoom { position:absolute; top:10px; right:10px; display:grid; gap:3px; }
.delivery-map-zoom button { width:40px; font-size:21px; line-height:1; }
.delivery-map-credit { position:absolute; right:0; bottom:0; padding:2px 5px; background:#fffffff0; color:#245444; font-size:10px; }
.delivery-map-message { min-height:1.35em; font-size:12px; margin:6px 0 0; }
.delivery-map-message.error { color:#aa3028; }
.main-content:has(.delivery-area-overview) {
  min-height:100dvh;
  padding:clamp(10px,2.2vw,32px);
  background:#f1f4f1;
}
.main-content:has(.delivery-area-overview) > .page-header {
  min-height:64px;
  margin-bottom:16px;
  padding:3px 0;
  background:transparent;
}
.main-content:has(.delivery-area-overview) .page-header h1 {
  color:#152c25;
  font-size:clamp(23px,3vw,34px);
  letter-spacing:-.04em;
}
.main-content:has(.delivery-area-overview) .header-actions .primary-button {
  background:#135947;
  border-color:#135947;
  color:#fff;
  min-height:42px;
}
.main-content:has(.delivery-area-overview) .header-actions .primary-button:hover { background:#0d4738; }
.delivery-area-overview {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(275px,320px);
  overflow:hidden;
  min-height:440px;
  height:clamp(440px,calc(100dvh - 170px),710px);
  background:#fff;
  border:1px solid #d5ded7;
  border-radius:16px;
  box-shadow:0 14px 35px #193d2b0c, 0 2px 5px #193d2b08;
}
.delivery-map-overview { position:relative; min-width:0; min-height:0; margin:0; }
.delivery-map-overview .delivery-map-surface {
  height:100%;
  border:0;
  border-radius:0;
  cursor:grab;
  background:
    linear-gradient(#a6b9b34d 1px,transparent 1px),
    linear-gradient(90deg,#a6b9b34d 1px,transparent 1px),
    #e9efec;
  background-size:36px 36px;
}
.delivery-map-overview .delivery-map-surface:active { cursor:grabbing; }
.delivery-map-overview .delivery-map-tools {
  position:absolute;
  z-index:1;
  top:15px;
  left:15px;
  right:15px;
  align-items:center;
  margin:0;
  pointer-events:none;
}
.delivery-map-overview :is(.delivery-map-tools, .delivery-map-zoom) button {
  min-height:42px;
  padding:9px 13px;
  background:#fff;
  border:1px solid #d4ded7;
  border-radius:9px;
  color:#264238;
  box-shadow:0 3px 9px #152d2115;
  font-size:13px;
  font-weight:650;
  pointer-events:auto;
}
.delivery-map-overview .delivery-map-tools button[aria-pressed="true"] { background:#e1f2e9; border-color:#9cc6b3; color:#145340; }
.delivery-map-overview .delivery-map-zoom { top:auto; right:15px; bottom:31px; gap:5px; }
.delivery-map-overview .delivery-map-zoom button { width:43px; font-size:23px; font-weight:500; }
.delivery-map-overview .delivery-map-tiles { filter:saturate(.52) contrast(.94); }
.delivery-map-overview .delivery-map-credit { color:#263e35; border-radius:6px 0 0 0; }
.delivery-map-overview .delivery-map-message {
  position:absolute;
  bottom:14px;
  left:15px;
  max-width:calc(100% - 84px);
  margin:0;
  padding:8px 12px;
  border:1px solid #d4ded7;
  border-radius:8px;
  background:#fff;
  color:#264238;
  font-size:12px;
  line-height:1.4;
  box-shadow:0 3px 9px #152d2114;
  pointer-events:none;
}
.delivery-area-panel { display:flex; flex-direction:column; min-height:0; border-left:1px solid #dfe7e1; background:#fff; }
.delivery-area-panel-header { padding:20px 17px 16px; }
.delivery-area-panel-title { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:18px; }
.delivery-area-panel-title h2 { margin:0; color:#18352b; font-size:20px; letter-spacing:-.03em; }
.delivery-area-panel-title > span { display:grid; place-items:center; min-width:29px; min-height:28px; padding:0 8px; border-radius:100px; background:#edf4ef; color:#285641; font-size:12px; font-weight:700; }
.delivery-area-panel .field-label { color:#4d6057; font-size:12px; }
.delivery-area-panel select { color:#213c31; border-color:#d5ded7; border-radius:8px; }
.delivery-area-legend { margin:0; padding:0 9px 12px; overflow:auto; list-style:none; }
.delivery-area-legend li {
  display:flex;
  align-items:center;
  gap:4px;
  margin:0 0 4px;
  min-width:0;
  border:1px solid transparent;
  border-radius:9px;
}
.delivery-area-legend li[data-selected] { border-color:#cce3d7; background:#eff8f3; }
.delivery-area-preview {
  display:flex;
  align-items:center;
  flex:1;
  gap:10px;
  min-width:0;
  min-height:62px;
  padding:8px;
  border:0;
  background:transparent;
  text-align:left;
}
button.delivery-area-preview:hover { background:#f0f6f2; }
.delivery-area-row-info { display:grid; gap:4px; min-width:0; color:#254537; overflow-wrap:anywhere; }
.delivery-area-row-info strong { color:#17372a; font-size:13px; line-height:1.25; }
.delivery-area-row-info > span { color:#546960; font-size:11px; line-height:1.35; }
.delivery-area-edit { margin-right:5px; min-height:40px; padding:4px 6px; border:0; background:transparent; color:#17614e; font-size:11px; font-weight:700; }
.delivery-area-edit:hover { background:#e3f1e9; }
.delivery-area-swatch { flex:none; width:13px; height:13px; border:2px solid var(--area-color); border-radius:4px; background:var(--area-color); }
.delivery-area-swatch[data-geometry="false"] { border-radius:50%; background:transparent; }
.delivery-area-swatch[data-active="false"] { background:transparent; border-style:dashed; }
.delivery-area-empty { padding:14px 8px; color:#546960; font-size:13px; }
.delivery-area-table { margin:14px 0 0; padding:0 13px 11px; border:1px solid #d5ded7; border-radius:10px; background:#fff; }
.delivery-area-table summary { display:list-item; padding:11px 1px 0; cursor:pointer; color:#254537; font-size:13px; font-weight:650; }
.delivery-area-table[open] summary { margin-bottom:12px; }
@media (max-width:760px) {
  .delivery-area-overview { grid-template-columns:minmax(0,1fr); height:auto; min-height:0; }
  .delivery-map-overview .delivery-map-surface { height:clamp(330px,54dvh,490px); }
  .delivery-area-panel { border-left:0; border-top:1px solid #dfe7e1; }
  .delivery-area-legend { max-height:260px; }
}
.delivery-windows { margin-top:18px; display:grid; gap:8px; }
.delivery-activation-check { display:flex; flex-wrap:wrap; align-items:end; gap:8px; }
.delivery-activation-check > p { flex-basis:100%; margin:0; }
.delivery-activation-check > p:empty { display:none; }
.delivery-window { display:flex; gap:7px; flex-wrap:wrap; align-items:end; }
.delivery-window label { display:grid; gap:4px; font-size:12px; }
.delivery-window input,.delivery-window select { min-height:36px; padding:5px 8px; border:1px solid #c2d3cb; border-radius:6px; }
@media(min-width:820px) {
  .admin-dialog.delivery-map-dialog .dialog-body { display:grid; align-items:start; grid-template-columns:minmax(225px,1fr) minmax(0,2fr); gap:14px 22px; }
  .admin-dialog.delivery-map-dialog .dialog-body > :is(.form-error,.notice) { grid-column:1 / -1; margin-bottom:0; }
  .admin-dialog.delivery-map-dialog .form-grid { grid-column:1; grid-template-columns:1fr; gap:10px; }
  .delivery-area-maps { grid-column:2; grid-row:span 2; min-width:0; }
  .delivery-windows { grid-column:1; margin-top:0; }
}
