:root {
  --green: #005b33;
  --green-dark: #003d25;
  --gold: #d7b45a;
  --gold-soft: #fff4d8;
  --ink: #17211c;
  --muted: #66736d;
  --line: #dfe7e2;
  --surface: #ffffff;
  --page: #f3f6f2;
  --danger: #a63838;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--page);
}

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

input:disabled,
select:disabled {
  background: #eef2ef;
  color: #8b9691;
  cursor: not-allowed;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

button:hover {
  background: var(--green-dark);
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--green-dark), #0c7042 55%, #f8f5ea 55%);
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  border: 4px solid var(--gold);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-width: 2px;
  font-size: 22px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  margin: 18px 0 2px;
  text-transform: uppercase;
}

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

.login-panel h1 {
  margin-bottom: 24px;
  color: var(--green-dark);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

.login-form {
  display: grid;
  gap: 14px;
}

.error {
  color: var(--danger);
  min-height: 18px;
  margin: 0;
}

.login-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.login-links button,
.top-actions button,
.tabs button {
  background: #eef4f0;
  color: var(--green-dark);
}

.login-extra-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
}

.form-message {
  color: var(--green-dark);
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
  min-height: 18px;
}

.topbar {
  align-items: center;
  background: var(--green);
  color: #fff;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 18px;
  min-height: 76px;
  padding: 12px 22px;
}

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

.brand-logo {
  width: 52px;
  height: 52px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  object-fit: cover;
}

.brand span {
  color: #d8efe4;
  display: block;
  font-size: 13px;
}

.tabs {
  background:
    linear-gradient(to bottom, transparent calc(100% - 9px), rgba(255, 255, 255, .20) calc(100% - 9px), rgba(255, 255, 255, .20) 100%);
  display: flex;
  gap: 8px;
  justify-content: end;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 10px;
  scrollbar-color: var(--gold) rgba(255, 255, 255, .20);
  scrollbar-gutter: stable;
  scrollbar-width: auto;
}

.tabs::-webkit-scrollbar {
  height: 10px;
}

.tabs::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .20);
  border-radius: 999px;
}

.tabs::-webkit-scrollbar-thumb {
  background: var(--gold);
  border: 2px solid var(--green);
  border-radius: 999px;
}

.tabs::-webkit-scrollbar-thumb:hover {
  background: #e4c66d;
}

.tabs button {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

.tabs button.active {
  background: var(--gold);
  color: #1d281f;
}

.section-tabs {
  display: flex;
  gap: 8px;
  margin: -6px 0 16px;
  padding-left: 34px;
}

.section-tabs button {
  background: #eef4f0;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
  color: var(--green-dark);
  min-height: 40px;
  min-width: 128px;
  padding: 9px 14px;
}

.section-tabs button.active {
  background: var(--gold);
  border-color: #c8a548;
  color: #1d281f;
}

.user-box {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: start;
  min-width: 0;
}

.user-box span {
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: end;
}

.modal-header-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: end;
}

main {
  padding: 24px 32px 32px;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr 340px;
  gap: 16px;
}

.panel,
.proposal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.panel h2 {
  align-items: center;
  background: var(--green);
  color: #fff;
  display: flex;
  font-size: 14px;
  min-height: 46px;
  margin: -14px -14px 14px;
  padding: 10px 12px;
  text-transform: uppercase;
}

.panel {
  align-content: start;
  display: grid;
  gap: 12px;
}

.field-row,
.metrics.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metrics div {
  background: #f5f8f6;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.metrics span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.metrics strong {
  color: var(--green);
  font-size: 20px;
}

.consultant-card {
  background: #f5f8f6;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.lot-note-card,
.proposal-observation {
  background: #fffdf6;
  border: 1px solid #eadcae;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.lot-note-card span,
.proposal-observation span {
  color: #6f5a19;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lot-note-card p,
.proposal-observation p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.lot-note-card.is-empty p {
  color: var(--muted);
}

.consultant-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.consultant-card strong {
  color: var(--green-dark);
}

.consultant-card small {
  color: var(--muted);
  font-size: 12px;
}

.check-line {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
  text-transform: none;
}

.check-line input {
  width: auto;
}

.note {
  background: var(--gold-soft);
  border: 1px solid #eadcae;
  border-radius: 6px;
  color: #6f5a19;
  margin: 0;
  padding: 10px;
}

.fixed-note-box {
  background: #fffdf6;
  border: 1px solid #eadcae;
  border-radius: 6px;
  color: #6f5a19;
  display: grid;
  gap: 6px;
  line-height: 1.35;
  padding: 10px 12px;
}

.fixed-note-box strong {
  color: var(--green-dark);
  font-size: 12px;
  text-transform: uppercase;
}

.term-form {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.print-option {
  background: #f5f8f6;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.admin-note {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.result-panel {
  align-content: start;
}

.result-line {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.result-line strong {
  color: var(--green);
  font-size: 18px;
}

.grand-total {
  background: var(--gold-soft);
  border: 1px solid #eadcae;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: center;
}

.grand-total strong {
  color: var(--green-dark);
  font-size: 24px;
}

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

.result-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 10px;
}

.result-actions button {
  min-height: 38px;
}

#newSimulationBtn {
  grid-column: 1;
  grid-row: 2;
}

.proposal-card {
  min-height: 520px;
  position: relative;
}

.proposal-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--green);
  color: var(--gold);
  display: grid;
  font-size: 32px;
  font-weight: 900;
  margin: 4px auto 8px;
  place-items: center;
}

.proposal-logo-img {
  width: 92px;
  height: 92px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  display: block;
  margin: 4px auto 10px;
  object-fit: cover;
}

.proposal-agency-logo {
  max-height: 66px;
  max-width: 112px;
  object-fit: contain;
  position: absolute;
  right: 18px;
  top: 22px;
}

.proposal-card h2 {
  color: var(--green);
  margin-bottom: 0;
  text-align: center;
}

.proposal-card > p {
  color: var(--gold);
  font-style: italic;
  text-align: center;
}

.proposal-card h3 {
  background: var(--green);
  color: #fff;
  font-size: 12px;
  margin: 12px 0 0;
  padding: 7px;
}

dl {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0;
  margin: 0;
}

dt {
  border-bottom: 1px solid #edf2ef;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
}

dd {
  border-bottom: 1px solid #edf2ef;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  padding: 6px 8px;
  text-align: right;
}

.proposal-card dl {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}

.proposal-total {
  background: var(--gold-soft);
  border: 1px solid #eadcae;
  border-radius: 6px;
  margin-top: 14px;
  padding: 10px;
  text-align: center;
}

.proposal-total span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
}

.proposal-total strong {
  color: var(--green-dark);
  font-size: 18px;
}

.proposal-observation {
  margin-top: 12px;
}

.proposal-observation p {
  font-size: 12px;
}

.signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 44px;
}

.signatures span {
  border-top: 1px solid #9aa59f;
  color: var(--muted);
  font-size: 11px;
  padding-top: 5px;
  text-align: center;
}

.schedule-panel {
  margin-top: 12px;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.import-button {
  align-items: center;
  background: #eef4f0;
  border-radius: 6px;
  color: var(--green-dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 10px 14px;
  text-transform: none;
}

.import-button input {
  display: none;
}

.modal {
  align-items: center;
  background: rgba(0, 0, 0, .45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 50;
}

.modal-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .25);
  max-height: 92vh;
  max-width: 1040px;
  overflow: auto;
  padding: 18px;
  width: min(1040px, 100%);
}

.small-modal {
  max-width: 460px;
  width: min(460px, 100%);
}

.modal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.modal-header h2 {
  color: var(--green-dark);
  font-size: 18px;
  margin: 0;
}

.saved-proposal {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.saved-proposal-logo img {
  border: 3px solid var(--gold);
  border-radius: 50%;
  display: block;
  height: 96px;
  margin: 0 auto 12px;
  object-fit: cover;
  width: 96px;
}

.saved-proposal h3 {
  color: var(--green);
  text-align: center;
}

.saved-proposal dl {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.saved-proposal-schedule {
  margin-top: 18px;
}

.saved-proposal-schedule h4 {
  background: var(--green);
  color: #fff;
  font-size: 13px;
  margin: 0;
  padding: 9px 10px;
  text-transform: uppercase;
}

.saved-proposal-schedule .table-wrap {
  border: 1px solid var(--line);
  border-top: 0;
  max-height: 460px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 9px;
  text-align: left;
  white-space: nowrap;
}

.obs-cell {
  max-width: 280px;
  white-space: normal;
}

th {
  background: #f4f7f5;
  color: var(--green-dark);
  font-size: 12px;
  text-transform: uppercase;
}

tr.balloon-row td {
  background: var(--gold-soft);
}

.admin-layout {
  align-items: start;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}

.is-consultant #lotsTab .admin-layout {
  grid-template-columns: 1fr;
}

.lot-editor-panel,
.lots-list-panel {
  align-content: start;
  gap: 10px;
}

.lot-editor-panel h2,
.lots-list-panel h2 {
  margin-bottom: 8px;
}

.lots-list-panel .table-actions {
  margin: 0;
  padding: 0 0 8px;
}

.lots-list-panel .table-wrap {
  margin-top: 0;
}

.lot-form {
  align-content: start;
  display: grid;
  gap: 12px;
}

.lot-form label,
.lot-form .field-row {
  align-items: start;
}

.lot-form .check-line {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: flex-start;
}

.lot-form .check-line input {
  flex: 0 0 auto;
}

.lot-form input,
.lot-form select {
  height: 38px;
  min-height: 38px;
}

.lot-form .check-line input {
  height: auto;
  min-height: 0;
  width: auto;
}

.lot-form textarea {
  min-height: 84px;
}

.status {
  border-radius: 20px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.status-select {
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  min-height: 0;
  padding: 5px 24px 5px 9px;
  width: auto;
}

.status.available,
.status-select.available {
  background: #e3f5eb;
  color: #0b6f3d;
}

.status.reserved,
.status-select.reserved {
  background: var(--gold-soft);
  color: #7a5d00;
}

.status.sold,
.status-select.sold {
  background: #f3e2e2;
  color: #9d3434;
}

.status.blocked,
.status-select.blocked {
  background: #e8eaed;
  color: #4c5661;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions button {
  padding: 7px 9px;
}

.row-actions button:last-child {
  background: #f5e9e9;
  color: var(--danger);
}

.agency-logo-preview {
  align-items: center;
  background: #f5f8f6;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  padding: 10px;
}

.agency-logo-preview img,
.agency-logo-thumb {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
}

.agency-logo-preview img {
  height: 56px;
  width: 80px;
}

.agency-logo-preview button {
  background: #f5e9e9;
  color: var(--danger);
}

.agency-logo-thumb {
  display: block;
  height: 36px;
  width: 56px;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.dash-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  text-transform: uppercase;
}

.dash-card strong {
  color: var(--green);
  display: block;
  font-size: 24px;
  margin-top: 8px;
}

.map-panel {
  gap: 10px;
}

.map-toolbar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.map-toolbar label {
  width: min(260px, 100%);
}

.map-help {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.map-help-inline {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.map-zoom-controls {
  align-self: center;
  margin-left: auto;
}

.map-legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 10px 16px;
}

.map-legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.legend-box {
  border-radius: 4px;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.legend-box.reserved {
  background: rgba(215, 180, 90, .28);
}

.legend-box.sold {
  background: rgba(166, 56, 56, .22);
}

.legend-box.blocked {
  background: rgba(76, 86, 97, .22);
}

.legend-box.selected {
  background: rgba(215, 180, 90, .25);
  outline: 2px solid rgba(215, 180, 90, .9);
}

.map-lock {
  align-self: center;
  background: #eef4f0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.map-zoom-controls {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}

.map-zoom-controls button {
  min-height: 38px;
  min-width: 42px;
  padding: 8px 10px;
}

.map-zoom-controls span {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  min-width: 48px;
  text-align: center;
}

.map-canvas {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  min-height: 420px;
  overscroll-behavior: contain;
  overflow: auto;
  position: relative;
  touch-action: none;
  user-select: none;
}

.map-canvas.is-dragging {
  cursor: grabbing;
}

.map-content {
  --map-zoom: 1;
  display: inline-block;
  min-width: calc(1800px * var(--map-zoom));
  position: relative;
  width: calc(100% * var(--map-zoom));
}

.map-content img {
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  width: 100%;
}

.map-markers {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.map-marker {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: transparent;
  display: inline-flex;
  font-size: 0;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.map-marker.available {
  background: transparent;
}

.map-marker.reserved {
  background: transparent;
  border-color: transparent;
}

.map-marker.sold {
  background: transparent;
  border-color: transparent;
}

.map-marker.blocked {
  background: transparent;
  border-color: transparent;
}

.map-marker.selected {
  background: rgba(255, 255, 255, .08);
  outline: 3px solid rgba(215, 180, 90, .95);
  z-index: 3;
}

.proposal-map-crop {
  display: none;
  margin-top: 12px;
}

.proposal-map-crop span {
  color: var(--green-dark);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.proposal-map-viewport {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 190px;
  overflow: hidden;
  position: relative;
}

.proposal-map-viewport img {
  display: block;
  left: 50%;
  max-width: none;
  position: absolute;
  top: 50%;
  transform: translate(var(--map-shift-x, -50%), var(--map-shift-y, -50%));
  width: 720%;
}

.saved-map-crop {
  display: block;
}

@media (max-width: 1440px) {
  .topbar {
    grid-template-columns: auto minmax(220px, 1fr);
  }

  .tabs {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-bottom: 12px;
  }

  .calculator-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) minmax(320px, 1.05fr);
  }

  .proposal-card {
    grid-column: 1 / -1;
    min-height: 0;
  }
}

@media (max-width: 1100px) {
  .topbar,
  .calculator-grid,
  .admin-layout,
  .dashboard-cards,
  .map-toolbar {
    grid-template-columns: 1fr;
  }

  .tabs,
  .user-box,
  .top-actions {
    justify-content: start;
  }

  .topbar {
    gap: 12px;
  }

  .tabs {
    width: 100%;
  }

  .map-zoom-controls {
    margin-left: 0;
  }

}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .login-shell {
    align-items: start;
    padding: 14px;
  }

  .login-panel {
    padding: 22px;
  }

  .demo-access,
  .field-row,
  .metrics.two,
  .signatures {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand-logo {
    height: 44px;
    width: 44px;
  }

  .brand strong,
  .brand span,
  .user-box span {
    overflow-wrap: normal;
    word-break: normal;
  }

  .tabs {
    gap: 6px;
    margin: 0 -2px;
    padding: 2px 2px 12px;
  }

  .tabs button {
    min-height: 40px;
    min-width: auto;
    padding: 9px 11px;
    white-space: nowrap;
  }

  .top-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  main {
    padding: 10px;
  }

  .panel,
  .proposal-card {
    border-radius: 6px;
    padding: 12px;
  }

  .panel h2 {
    font-size: 13px;
    margin: -12px -12px 12px;
    padding: 9px 10px;
  }

  input,
  select,
  textarea,
  button,
  .import-button {
    min-height: 44px;
  }

  .lot-form input,
  .lot-form select {
    height: 44px;
  }

  .lot-form textarea {
    min-height: 92px;
  }

  .actions,
  .table-actions,
  .row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions button,
  .table-actions button,
  .import-button,
  .row-actions button {
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .result-line {
    align-items: start;
    display: grid;
    gap: 4px;
  }

  .result-line strong,
  .grand-total strong {
    font-size: 20px;
  }

  .proposal-card {
    min-height: 0;
  }

  .proposal-logo-img {
    height: 76px;
    width: 76px;
  }

  .proposal-agency-logo {
    max-height: 44px;
    max-width: 78px;
    right: 12px;
    top: 16px;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  dd {
    margin-bottom: 6px;
    text-align: left;
  }

  .proposal-map-viewport {
    height: 160px;
  }

  .proposal-map-viewport img {
    width: 720%;
  }

  .table-wrap {
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    font-size: 12px;
    padding: 8px;
  }

  .dashboard-cards {
    gap: 8px;
  }

  .dash-card {
    padding: 12px;
  }

  .dash-card strong {
    font-size: 20px;
  }

  .map-canvas {
    min-height: 360px;
  }

  .map-content {
    min-width: calc(1500px * var(--map-zoom));
  }

  .modal {
    align-items: stretch;
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .modal-header {
    align-items: stretch;
    display: grid;
    gap: 10px;
  }

  .saved-proposal {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .brand {
    align-items: start;
  }

  .brand strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
  }

  .brand span {
    font-size: 12px;
  }

  .tabs button {
    font-size: 13px;
  }

  .check-line {
    align-items: flex-start;
  }

  .check-line input {
    margin-top: 2px;
  }

  .map-canvas {
    min-height: 320px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .panel,
  .schedule-panel {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .calculator-grid {
    display: block;
  }

  .proposal-card {
    border: 0;
    margin: 0 auto;
    max-width: 540px;
    padding: 12px 20px;
  }

  body.print-with-schedule .schedule-panel {
    border: 0;
    display: grid !important;
    margin: 24px 18px 0;
    page-break-before: always;
  }

  body.print-with-schedule .schedule-panel h2 {
    background: var(--green);
    color: #fff;
  }

  body.print-with-schedule .schedule-panel .table-wrap {
    overflow: visible;
  }

  body.print-with-schedule .schedule-panel table {
    min-width: 0;
  }

  body.print-with-schedule .schedule-panel tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-with-schedule .schedule-panel th,
  body.print-with-schedule .schedule-panel td {
    font-size: 10px;
    padding: 5px;
  }

  body.print-with-map .proposal-map-crop.has-map-point {
    display: block;
  }
}
