:root {
  --as-navy: #0e1f3a; --as-blue: #0f8bd9; --as-ink: #14233f; --as-muted: #6b7892;
  --as-line: #e2e8f2; --as-green: #1f9d63;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--as-ink); background: #f4f7fb;
  -webkit-font-smoothing: antialiased;
}

/* Filter bar */
.mk-filterbar {
  position: sticky; top: 62px; z-index: 900;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 22px; background: #fff; border-bottom: 1px solid var(--as-line);
  box-shadow: 0 2px 10px rgba(17,37,84,.04); flex-wrap: wrap;
}
.mk-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.mk-filter { display: flex; flex-direction: column; gap: 3px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--as-muted); }
.mk-filter select, .mk-filter input {
  border: 1px solid var(--as-line); border-radius: 9px; padding: 9px 12px; font-size: 14px; font-family: inherit;
  color: var(--as-ink); background: #fff; min-width: 130px; cursor: pointer;
}
.mk-filter select:focus, .mk-filter input:focus { outline: none; border-color: var(--as-blue); box-shadow: 0 0 0 3px rgba(15,139,217,.14); }
.mk-area-note { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--as-ink); background: #eef6fc; border: 1px solid #cfe6f7; padding: 8px 12px; border-radius: 999px; }
.mk-area-note button { border: 0; background: none; color: var(--as-blue); font-weight: 700; cursor: pointer; font-size: 13px; }

/* Split shell */
.mk-shell { display: flex; height: calc(100vh - 62px - 63px); }
.mk-map-col { position: relative; flex: 0 0 52%; border-right: 1px solid var(--as-line); }
#area-map { position: absolute; inset: 0; z-index: 0; background: #eef3f8; }
.leaflet-control-attribution { font-size: 10px; }
.mk-list-col { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

.mk-list-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mk-list-head b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: #102a56; }
.mk-list-head span { font-size: 15px; font-weight: 700; }
.mk-list-head small { color: var(--as-muted); font-size: 13px; }

.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: start; gap: 16px; }

/* Card */
.mk-card {
  position: relative; display: flex; flex-direction: column; background: #fff;
  border: 1px solid #e4e9f2; border-top: 3px solid #102a56; border-radius: 12px; overflow: hidden;
  box-shadow: 0 3px 12px rgba(16,42,86,.05); transition: transform .12s, box-shadow .12s;
}
.mk-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(16,42,86,.1); }
.mk-card-tag { background: none; color: #98a1b3; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 12px 14px 0; }
.mk-card-badges { display: flex; flex-wrap: nowrap; gap: 5px; padding: 8px 42px 0 14px; overflow: hidden; }
.mk-badge { font-size: 10px; font-weight: 700; color: #35476a; background: #eef2f8; border: 1px solid #dde5f0; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.mk-badge-more { background: #f6f8fc; color: #98a1b3; border-color: #e4e9f2; }
.mk-card-body { padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.mk-card-area { font-size: 12px; font-weight: 600; color: #6b7892; }
.mk-card-price { font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: #102a56; }
.mk-card-price small { font-size: 11px; font-weight: 600; color: #98a1b3; letter-spacing: 0; }
.mk-card-meta { font-size: 11.5px; color: #98a1b3; }
.mk-unlock { margin-top: 9px; border: 0; cursor: pointer; background: #102a56; color: #fff; font-weight: 700; font-size: 12.5px; padding: 9px; border-radius: 8px; font-family: inherit; letter-spacing: .03em; }
.mk-unlock:hover { background: #1b3a6b; }
.mk-fav { position: absolute; top: 12px; right: 12px; border: 0; background: #f4f6fb; color: #b8c2d4; width: 26px; height: 26px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.mk-fav.on { color: #f2b304; }

.mk-empty { text-align: center; color: var(--as-muted); padding: 60px 20px; font-size: 15px; }
.mk-loading { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 50px; color: var(--as-muted); font-size: 14px; }

/* Map overlays */
.as-hint {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 500;
  max-width: min(420px, 88%); text-align: center; background: rgba(255,255,255,.96);
  border: 1px solid var(--as-line); border-radius: 14px; padding: 11px 16px; box-shadow: 0 10px 30px rgba(17,37,84,.14);
}
.as-hint b { display: block; font-size: 14px; margin-bottom: 2px; }
.as-hint span { font-size: 12.5px; color: var(--as-muted); }
.as-hint em { font-style: normal; font-weight: 700; color: var(--as-blue); }
.as-toolbar { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; gap: 9px; padding: 7px; background: #fff; border-radius: 15px; box-shadow: 0 14px 40px rgba(17,37,84,.22); }
.as-tool { display: flex; align-items: center; gap: 7px; border: 0; cursor: pointer; background: var(--as-navy); color: #fff; font-weight: 700; font-size: 13.5px; padding: 11px 16px; border-radius: 11px; font-family: inherit; }
.as-tool:hover { background: #16305a; }
.as-tool.ghost { background: #eef2f8; color: var(--as-ink); }
.as-ico { font-size: 15px; }

/* Modal */
.mk-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; }
.mk-modal-backdrop { position: absolute; inset: 0; background: rgba(9,20,44,.55); backdrop-filter: blur(2px); }
.mk-modal-card { position: relative; z-index: 1; width: min(460px, 100%); max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 20px; padding: 30px; box-shadow: 0 30px 80px rgba(9,20,44,.4); }
.mk-modal-close { position: absolute; top: 16px; right: 16px; border: 0; background: #eef2f8; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--as-muted); }
.mk-modal-count { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; background: #102a56; color: #fff; border-radius: 12px; }
.mk-modal-count b { font-size: 40px; line-height: 1; font-weight: 800; }
.mk-modal-count span { font-size: 14px; font-weight: 600; opacity: .95; }
.mk-modal-card h2 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 6px; }
.mk-modal-sub { color: var(--as-muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 4px; }
.mk-grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 4px; }
.mk-grid-form label { display: flex; flex-direction: column; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--as-muted); }
.mk-grid-form .mk-full { grid-column: 1 / -1; }
.mk-grid-form input { border: 1px solid var(--as-line); border-radius: 10px; padding: 11px 12px; font-size: 14px; font-family: inherit; color: var(--as-ink); }
.mk-grid-form input:focus { outline: none; border-color: var(--as-blue); box-shadow: 0 0 0 3px rgba(15,139,217,.14); }
.mk-consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-size: 12px; color: var(--as-muted); line-height: 1.45; }
.mk-consent input { margin-top: 2px; }
.mk-submit { width: 100%; border: 0; cursor: pointer; background: #102a56; color: #fff; font-weight: 800; font-size: 15px; padding: 15px; border-radius: 10px; font-family: inherit; letter-spacing: .02em; }
.mk-submit:hover { background: #1b3a6b; }
.mk-submit:disabled { opacity: .6; cursor: default; }
.mk-error { color: #c0362c; font-size: 13px; min-height: 18px; margin: 8px 0 0; }
.mk-success-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: #e5f6ee; color: var(--as-green); font-size: 32px; margin-bottom: 8px; }
.mk-redraw { margin-top: 16px; border: 1px solid var(--as-line); background: #fff; color: var(--as-ink); font-weight: 700; font-size: 14px; padding: 12px 18px; border-radius: 10px; cursor: pointer; font-family: inherit; }

.mk-spinner, .as-spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid #e2e8f2; border-top-color: var(--as-blue); animation: mk-spin .8s linear infinite; }
@keyframes mk-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .mk-shell { flex-direction: column; height: auto; }
  .mk-map-col { flex: none; height: 46vh; border-right: 0; border-bottom: 1px solid var(--as-line); }
  .mk-list-col { max-height: none; }
  .mk-filterbar { top: 56px; }
}
@media (max-width: 560px) {
  .mk-filter select, .mk-filter input { min-width: 0; }
  .mk-filters { flex: 1; }
  .as-toolbar { flex-wrap: wrap; width: 90%; justify-content: center; }
  .mk-modal-card { padding: 24px 20px; }
  .mk-grid-form { grid-template-columns: 1fr; }
  .mk-grid { grid-template-columns: 1fr; }
}
