:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e4e8f0;
  --line-strong: #cfd6e4;
  --text: #0f172a;
  --muted: #667085;
  --muted-2: #98a2b3;
  --accent: #2453e6;
  --accent-dark: #1e3a8a;
  --accent-soft: #eef3ff;
  --accent-soft-2: #dfe8ff;
  --green: #067647;
  --green-soft: #ecfdf3;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --red: #b42318;
  --red-soft: #fef3f2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p { margin: 0; }

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

svg.icon { width: 16px; height: 16px; flex: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
}

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

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #2453e6, #16359b);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(36, 83, 230, .3);
}

.brand-text { min-width: 0; }
.brand-text h1 { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.brand-text span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.top-actions { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(36, 83, 230, .25); }
.btn-primary:hover { background: #1d47cf; }

.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #f8faff; border-color: var(--line-strong); }

.btn-danger-ghost { background: #fff; border-color: var(--line); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); border-color: #fecdca; }

.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: #f1f4fa; color: var(--text); }

.link {
  border: 0; background: none; padding: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(36, 83, 230, .3);
  text-underline-offset: 3px;
}
.link:hover { text-decoration-color: currentColor; }

/* ---------- Layout ---------- */
main.container { padding-top: 22px; padding-bottom: 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 18px;
  margin-bottom: 18px;
  scroll-margin-top: 84px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }

.card-title h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }

.step {
  width: 25px; height: 25px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Banner ---------- */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1px solid #d5e0ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #f5f8ff, #eef3ff);
  color: #1e3a8a;
  font-size: 13px;
}
.banner .icon { color: var(--accent); }
.banner div { flex: 1; }

/* ---------- Dropzone ---------- */
.dropzone {
  cursor: pointer;
  border: 1.5px dashed #c9d4ea;
  border-radius: 14px;
  padding: 26px 20px;
  text-align: center;
  background: #fbfcff;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { opacity: .6; pointer-events: none; }

.dz-icon {
  width: 40px; height: 40px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.dz-icon .icon { width: 20px; height: 20px; }
.dz-text { font-size: 14px; }
.dz-text b { font-weight: 650; }
.dz-hint { margin-top: 6px; color: var(--muted); font-size: 12px; }

.dropzone.compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  text-align: left;
  background: #f8fafc;
  border-style: solid;
  border-color: var(--line);
}
.dropzone.compact .dz-icon { width: 30px; height: 30px; margin: 0; flex: none; }
.dropzone.compact .dz-icon .icon { width: 16px; height: 16px; }
.dropzone.compact .dz-hint { display: none; }
.dropzone.compact .dz-text { font-size: 12.5px; color: var(--muted); }
.dropzone.compact .dz-text b { color: var(--text); }

/* ---------- Import note ---------- */
.import-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.import-note b { color: var(--text); font-weight: 600; }
.import-note .spacer { flex: 1; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }

.field > select,
.field > input:not(.cell-input) {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  outline: 0;
  font-size: 14px;
}
.field > input:not(.cell-input):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 83, 230, .12);
}
.field > select { padding-right: 34px; }

.input-wrap {
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 83, 230, .12); }
.input-wrap input:disabled { color: var(--muted); -webkit-text-fill-color: var(--muted); }

.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 12px;
  background: transparent;
  font-size: 14px;
  font-weight: 550;
}
.input-wrap .suffix {
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  border-left: 1px solid var(--line);
  align-self: stretch;
  display: flex;
  align-items: center;
  background: #fafbfd;
}

.currency-select {
  flex: none;
  width: 84px;
  height: 100%;
  padding: 0 22px 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background-color: #f8fafc;
  background-position: right 6px center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text);
}
.currency-select:focus {
  border: 0;
  border-right: 1px solid var(--line);
  box-shadow: none;
  outline: none;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

select {
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  font-size: 13.5px;
  cursor: pointer;
  outline: 0;
}
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 83, 230, .12); }

select.cell-input {
  padding-right: 28px;
  background-position: right 9px center;
  font-size: 12.5px;
}

.hint { font-size: 12px; color: var(--muted); }
.hint.warn { color: var(--amber); }

/* ---------- Parameters ---------- */
.params-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.weight-row { display: flex; gap: 8px; align-items: stretch; }
.weight-row .input-wrap { flex: 1; min-width: 110px; }
.weight-row .segmented { flex: none; }

.delivery-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
}
.delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.delivery-head .dl-title { font-size: 13px; font-weight: 650; }
.delivery-body {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.delivery-body .dl-field { width: 190px; }
.delivery-body .dl-note { padding-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.delivery-body .dl-times { padding-bottom: 10px; color: var(--muted); }
.delivery-total-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.delivery-total-line #dl-calc { font-size: 12.5px; color: var(--muted); }
.delivery-total-line #dl-total { margin-left: auto; font-size: 17px; font-weight: 700; color: var(--text); }
#delivery-hint { display: block; margin-top: 8px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #f1f4fa;
  border: 1px solid #e8ecf4;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 0 10px;
  height: 32px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }

#weight-hint { grid-column: 1 / -1; }

.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.advanced summary,
.structure summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  user-select: none;
}
.advanced summary::-webkit-details-marker,
.structure summary::-webkit-details-marker { display: none; }
.advanced summary .icon,
.structure summary .icon { transition: transform .15s; }
.advanced[open] summary .icon,
.structure[open] summary .icon { transform: rotate(180deg); }
.advanced-body { display: flex; gap: 16px; align-items: flex-start; margin-top: 12px; }
.advanced-body .field { width: 320px; }
.advanced-body .hint { max-width: 620px; }

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

#items-table { min-width: 780px; }
.costs-table { min-width: 720px; }

table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.grid td {
  padding: 4px 6px;
  border-bottom: 1px solid #f0f3f9;
  vertical-align: middle;
}
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:nth-child(even) { background: #fcfdff; }
.grid tbody tr:hover { background: #f8faff; }

.grid tfoot td {
  padding: 9px 10px;
  background: var(--accent-soft);
  border-top: 1px solid #d5e0ff;
  font-weight: 650;
}

.grid .num { text-align: right; }
.grid .center { text-align: center; }
.grid .muted { color: var(--muted); }

.w-no { width: 42px; }
.w-art { width: 120px; }
.w-num { width: 92px; }
.w-money { width: 116px; }
.w-box { width: 66px; }
.w-del { width: 38px; }
.w-name { min-width: 240px; }
.w-type { width: 150px; }
.w-val { width: 130px; }
.w-method { width: 160px; }
.w-sum { width: 130px; }

.cell-input {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  outline: 0;
  font-size: 13px;
}
.cell-input:hover { background: #fff; border-color: var(--line); }
.cell-input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 83, 230, .1); }
.cell-input.num { text-align: right; }
.cell-input.name { font-weight: 550; }

.row-del {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: #b8c0cf;
  cursor: pointer;
}
.row-del:hover { background: var(--red-soft); color: var(--red); }

.costs-table td { padding: 5px 6px; }
.costs-table .cell-input { height: 36px; }

.cost-total { font-size: 12.5px; color: var(--muted); }
.cost-total b { color: var(--text); font-size: 14px; margin-left: 4px; }

.row-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Summary ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
  min-width: 0;
}
.stat span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat b { display: block; margin-top: 3px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.stat small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted-2); }

.stat.accent {
  background: linear-gradient(150deg, #2b5bf0, #1a3faf);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(36, 83, 230, .25);
}
.stat.accent span, .stat.accent small { color: rgba(255, 255, 255, .75); }

/* ---------- Warnings ---------- */
.warnings { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.warnings:empty { display: none; }

.warn-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  border: 1px solid;
}
.warn-item .icon { margin-top: 1px; }
.warn-item.warn { background: var(--amber-soft); border-color: #fedf89; color: #93370d; }
.warn-item.info { background: #f8fafc; border-color: var(--line); color: var(--muted); }

/* ---------- Structure ---------- */
.structure { margin-bottom: 12px; }
.structure-body { margin-top: 10px; }
.structure table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.structure td { padding: 6px 8px; border-bottom: 1px solid #f0f3f9; }
.structure td:first-child { color: var(--text); }
.structure td:last-child { text-align: right; white-space: nowrap; }
.structure .muted { color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #eef1f7;
  margin-bottom: 10px;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 0 16px;
  height: 34px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

.tab-note { font-size: 12.5px; color: var(--muted); margin: 2px 0 10px; }
.tab-note b { color: var(--text); }

.report-wrap { max-height: 620px; }
.report-wrap table.grid { min-width: 1040px; }

.report-table th { top: 0; white-space: normal; line-height: 1.25; }
.report-table td { padding: 8px 9px; white-space: nowrap; font-size: 12.5px; }
.report-table td.name-cell { white-space: normal; min-width: 190px; max-width: 300px; font-weight: 550; }
.report-table td.art-cell {
  color: var(--muted);
  font-size: 12px;
  max-width: 170px;
  white-space: normal;
  word-break: break-word;
}
.report-table td.dim { color: var(--muted); }
.report-table tfoot td { position: sticky; bottom: 0; z-index: 2; }

.diff-pos { color: var(--red); font-weight: 600; }
.diff-neg { color: var(--green); font-weight: 600; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.badge.qty { background: var(--accent-soft); color: var(--accent); }
.badge.value { background: var(--green-soft); color: var(--green); }
.badge.same { background: #f2f4f7; color: var(--muted); }

.footnote { margin-top: 10px; font-size: 11.5px; color: var(--muted-2); }

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

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  padding-bottom: 28px;
  font-size: 11.5px;
  color: var(--muted-2);
  flex-wrap: wrap;
}
.save-status { color: var(--green); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 60;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 12px;
  background: #101828;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #7a271a; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dialog::backdrop { background: rgba(15, 23, 42, .48); backdrop-filter: blur(2px); }
.dialog-inner { padding: 22px 24px; max-height: calc(100vh - 48px); overflow: auto; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }

.dialog-grid {
  display: grid;
  grid-template-columns: 1.2fr .6fr 1.4fr;
  gap: 12px;
  margin: 14px 0 16px;
}
.dialog-grid .field > span { font-size: 11.5px; }

.map-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
  margin-bottom: 16px;
}
.map-fields .field > span { font-size: 11.5px; }

.preview-title { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 8px; }
.preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview th, .preview td { padding: 6px 8px; border-bottom: 1px solid #eef1f7; text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.preview th { background: #f8fafc; color: var(--muted); font-weight: 650; position: sticky; top: 0; }
.preview th.detected { color: var(--accent); }
.preview td.detected { background: #f3f7ff; }

.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-actions #map-auto { margin-right: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .params-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .container { padding: 0 14px; }
  .topbar-inner { height: 60px; }
  .brand-text span { display: none; }
  .brand-text h1 { font-size: 14px; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { padding: 0 10px; }
  .card { padding: 16px 14px 14px; border-radius: 14px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .params-grid { grid-template-columns: 1fr; }
  .delivery-body .dl-field { width: 100%; }
  .delivery-body .dl-times { display: none; }
  .delivery-total-line #dl-total { margin-left: 0; }
  .advanced-body { flex-direction: column; }
  .advanced-body .field { width: 100%; }
  .dialog-grid { grid-template-columns: 1fr; }
  .map-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner { flex-wrap: wrap; }
  .banner .btn { width: 100%; }
}

@media (max-width: 520px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 15px; }
  .map-fields { grid-template-columns: 1fr; }
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}






