
:root {
  color-scheme: light;
  --bg: #fffbe6;
  --card: #ffffff;
  --text: #172018;
  --muted: #667066;
  --green: #16723a;
  --green-soft: #e6f6ea;
  --border: #d9dfd2;
  --danger: #8a1f11;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, #e3f8dc, #fffbe6);
  border-bottom: 1px solid var(--border);
}
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
h1 { margin: 3px 0 0; font-size: 25px; }
h2 { margin: 0 0 10px; font-size: 18px; }
.container { max-width: 820px; margin: 0 auto; padding: 14px; }
.card, .item-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(20, 40, 20, .06);
}
.top-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 10px;
  background: var(--bg);
}
.map-toolbar {
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
}
.map-toolbar .button {
  padding: 9px 11px;
  min-height: 40px;
}
.map-layer-select {
  flex: 1 1 180px;
  width: auto;
  min-width: 150px;
  min-height: 40px;
  margin: 0;
  border-radius: 999px;
  font-weight: 700;
  color: var(--green);
  border-color: var(--green);
}
.map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: white;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}
.map-toggle input {
  width: auto;
  min-height: auto;
  margin: 0;
}
.sticky-filter { position: sticky; top: 52px; z-index: 1; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
select, input, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 16px;
  background: white;
  margin-bottom: 10px;
  font-family: inherit;
}
textarea { min-height: 110px; resize: vertical; }
.summary { color: var(--muted); margin: 10px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-form .button { width: 100%; text-align: center; }
.button, .small-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--green);
  color: var(--green);
  font-weight: 700;
  background: white;
}
.button.primary { background: var(--green); color: white; }
.small-link { padding: 8px 12px; margin-top: 8px; font-size: 14px; background: var(--green-soft); }
.item-title { font-size: 20px; font-weight: 800; margin-bottom: 2px; }
.item-meta { color: var(--green); font-weight: 700; margin-bottom: 10px; }
.item-address { color: var(--muted); font-size: 14px; margin: -4px 0 10px; overflow-wrap: anywhere; }
.order-card { display: block; color: inherit; border-color: #cbd8c3; }
.compact-order-card {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.order-reg-no { font-weight: 800; color: var(--green); white-space: nowrap; }
.order-title-one-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card:active { transform: scale(.995); }
dl { margin: 0; display: grid; gap: 8px; }
dl > div { display: grid; grid-template-columns: 105px 1fr; gap: 8px; align-items: start; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; overflow-wrap: anywhere; }
.path { font-size: 13px; color: #344034; }
.detail-list > div { grid-template-columns: 115px 1fr; border-bottom: 1px solid #edf0e8; padding-bottom: 6px; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.cad-map-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px; }
.cad-code { font-weight: 800; color: var(--green); overflow-wrap: anywhere; }
.quick-button { min-height: 40px; padding: 8px 12px; background: var(--green-soft); color: var(--green); }
.neighbor-card .compact-form { margin-top: 8px; }
.boundary-card .invitation-text {
  margin: 10px 0;
  padding: 10px;
  border-radius: 12px;
  background: var(--green-soft);
  border: 1px solid #b8dfc1;
}
.invitation-text h3 { margin: 0 0 6px; font-size: 15px; }
.invitation-text p { margin: 0; overflow-wrap: anywhere; }
.boundary-date { margin-bottom: 4px; }
.boundary-property-details { margin: 0 0 10px; }
.boundary-property-details > summary {
  cursor: pointer;
  list-style-position: outside;
  padding: 6px 0;
}
.boundary-property-details > summary .item-title { display: inline; }
.boundary-units {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}
.boundary-unit-row {
  display: grid;
  grid-template-columns: minmax(52px, auto) 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #edf0e8;
}
.boundary-unit-time { font-weight: 800; color: var(--text); white-space: nowrap; }
.boundary-details { margin-top: 10px; }
.boundary-details summary { font-weight: 800; color: var(--green); padding: 8px 0; }
.neighbor-mini-card {
  border-top: 1px solid #edf0e8;
  padding: 10px 0;
}
.small-title { font-size: 16px; }
.dim, .muted { color: var(--muted); }
.error { border-color: #efb0a6; color: var(--danger); }
.login-error { background: #fff1ef; border: 1px solid #efb0a6; color: var(--danger); border-radius: 12px; padding: 10px; }
.success-message { background: var(--green-soft); border: 1px solid #9bd0aa; color: var(--green); border-radius: 12px; padding: 10px; font-weight: 700; }
.map-card { margin: 0 -14px -14px; border-top: 1px solid var(--border); background: #eef1e8; }
.mobile-map { width: 100%; height: calc(100vh - 126px); min-height: 540px; }
.wms-screen-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  display: none;
}
.wms-base-image { z-index: 100 !important; }
.wms-kadastrs-image {
  z-index: 300 !important;
  filter: contrast(1.45) saturate(1.25) drop-shadow(0 0 1px rgba(255,255,255,.95));
}
.map-vector-overlay {
  position: absolute;
  inset: 0;
  z-index: 850 !important;
  pointer-events: none;
  overflow: visible;
}
.cad-highlight-shape {
  fill: rgba(47, 179, 68, .24);
  stroke: #137333;
  stroke-width: 2.5;
  stroke-opacity: .95;
  vector-effect: non-scaling-stroke;
}
.gps-overlay-halo {
  fill: #ffffff;
  fill-opacity: .95;
  stroke: #1976d2;
  stroke-width: 2;
}
.gps-overlay-dot {
  fill: #1976d2;
  stroke: #ffffff;
  stroke-width: 1.5;
}
.leaflet-map-pane { z-index: 500 !important; }
.leaflet-cad-highlight-pane { z-index: 850 !important; }
.leaflet-gps-pane { z-index: 900 !important; pointer-events: none; }
.leaflet-control-layers { max-width: min(86vw, 360px); max-height: 55vh; overflow: auto; border-radius: 12px; font-size: 13px; }
.leaflet-control-layers label { display: flex; align-items: center; gap: 6px; font-weight: 600; margin: 3px 0; line-height: 1.2; }
.leaflet-control-layers input { width: auto; min-height: auto; margin: 0; padding: 0; }
.leaflet-control-layers-toggle { width: 38px !important; height: 38px !important; }
.locate-button { width: 38px; height: 38px; background: white; border: 2px solid rgba(0,0,0,.2); border-radius: 4px; font-weight: 800; color: var(--green); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
@media (min-width: 700px) {
  .list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .item-card { margin-bottom: 0; }
}
