.map-loading {
  min-height: 55vh; display: grid; place-content: center; justify-items: center; gap: 10px; color: #1d2939;
}
.map-loading span { width: 30px; height: 30px; border: 3px solid #f3b1c1; border-top-color: #d81743; border-radius: 50%; animation: map-spin .7s linear infinite; }
.map-loading strong { margin-top: 5px; font-size: .95rem; }
.map-loading small { color: #98a2b3; }
@keyframes map-spin { to { transform: rotate(360deg); } }

.agent-map-page { padding: 22px 0 40px; color: #101828; }
.agent-map-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.agent-map-kicker { color: #d81743; font-size: .65rem; font-weight: 850; letter-spacing: 2.2px; }
.agent-map-head h1 { margin: 8px 0 5px; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.8px; }
.agent-map-head p { margin: 0; color: #667085; font-size: .78rem; }
.agent-map-head-actions { display: flex; gap: 8px; }
.agent-map-add,
.agent-map-back { min-height: 40px; padding: 0 18px; border: 1px solid #e4e7ec; border-radius: 10px; background: #fff; color: #b51238; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.agent-map-add { border-color: #171c27; background: #171c27; color: #fff; }
.agent-map-add:hover { border-color: #d81743; background: #d81743; }
.agent-map-back:disabled { color: #98a2b3; cursor: default; }
.agent-map-back:not(:disabled):hover { border-color: #d81743; background: #fff5f7; }

.agent-map-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; overflow: hidden; border: 1px solid #eaecf0; border-radius: 16px; background: #fff; box-shadow: 0 8px 30px rgba(16,24,40,.04); }
.agent-map-stats article { padding: 17px 20px; border-right: 1px solid #eaecf0; }
.agent-map-stats article:last-child { border-right: 0; }
.agent-map-stats span { display: block; margin-bottom: 4px; color: #667085; font-size: .7rem; }
.agent-map-stats strong { color: #101828; font-size: 1.55rem; }
.agent-map-stats small { margin-left: 5px; color: #98a2b3; font-size: .68rem; }

.agent-map-workspace { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 350px; height: 680px; min-height: 680px; overflow: hidden; border: 1px solid #e4e7ec; border-radius: 20px; background: #fff; box-shadow: 0 20px 55px rgba(16,24,40,.08); transition: grid-template-columns .28s cubic-bezier(.22,.75,.25,1); }
.agent-map-workspace.panel-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.agent-map-stage { position: relative; min-width: 0; min-height: 0; height: 100%; overflow: hidden; background: radial-gradient(circle at 48% 45%, #fff 0, #f7f8fa 58%, #f0f2f5 100%); }
.agent-map-toolbar { position: absolute; z-index: 3; top: 17px; left: 19px; right: 19px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.agent-map-location { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(228,231,236,.9); border-radius: 10px; background: rgba(255,255,255,.9); box-shadow: 0 5px 18px rgba(16,24,40,.05); backdrop-filter: blur(8px); }
.agent-map-location span { width: 7px; height: 7px; border-radius: 50%; background: #d81743; box-shadow: 0 0 0 4px rgba(216,23,67,.1); }
.agent-map-location strong { font-size: .76rem; }
.agent-map-legend { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,.84); color: #667085; font-size: .66rem; backdrop-filter: blur(8px); }
.agent-map-legend i { width: 8px; height: 8px; margin-left: 5px; border: 1.5px solid #fff; border-radius: 50%; }
.agent-map-legend i.gold { background: #f2b705; }
.agent-map-legend i.standard { background: #d81743; }
.agent-map-canvas { width: 100%; height: 100%; min-height: 680px; touch-action: none; }
.agent-map-hint { position: absolute; z-index: 2; right: 18px; bottom: 15px; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.82); color: #98a2b3; font-size: .62rem; pointer-events: none; }

.agent-map-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; height: 100%; border-left: 1px solid #eaecf0; background: #fff; opacity: 1; transform: translateX(0); transition: opacity .18s ease, transform .28s cubic-bezier(.22,.75,.25,1); }
.panel-collapsed .agent-map-panel { opacity: 0; transform: translateX(100%); pointer-events: none; }
.agent-panel-toggle {
  position: absolute; z-index: 6; top: 50%; right: 350px; display: grid; place-items: center; gap: 3px;
  width: 30px; min-height: 108px; padding: 10px 5px; border: 1px solid #e4e7ec; border-right: 0;
  border-radius: 12px 0 0 12px; background: rgba(255,255,255,.94); color: #b51238;
  box-shadow: -7px 0 22px rgba(16,24,40,.08); backdrop-filter: blur(10px); cursor: pointer;
  transform: translateY(-50%); transition: right .28s cubic-bezier(.22,.75,.25,1), background .2s ease;
}
.agent-panel-toggle:hover { background: #fff3f6; }
.agent-panel-toggle span { font-size: 1.25rem; line-height: 1; }
.agent-panel-toggle em { writing-mode: vertical-rl; color: #667085; font-size: .58rem; font-style: normal; letter-spacing: 2px; }
.panel-collapsed .agent-panel-toggle { right: 0; }
.agent-map-panel-head { padding: 18px; border-bottom: 1px solid #eaecf0; }
.agent-map-panel-head > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.agent-map-panel-head > div:first-child span { font-size: .9rem; font-weight: 800; }
.agent-map-panel-head > div:first-child strong { color: #d81743; font-size: .72rem; }
.agent-map-panel-head input { width: 100%; height: 39px; padding: 0 12px; border: 1px solid #dfe3e8; border-radius: 9px; outline: none; background: #f9fafb; font: inherit; font-size: .75rem; }
.agent-map-panel-head input:focus { border-color: #e54869; background: #fff; box-shadow: 0 0 0 3px rgba(216,23,67,.08); }
.agent-map-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 9px; }
.agent-map-filters button { min-height: 33px; border: 0; border-radius: 8px; background: #f2f4f7; color: #667085; font: inherit; font-size: .66rem; cursor: pointer; }
.agent-map-filters button.active { background: #161b26; color: #fff; font-weight: 750; }
.agent-map-list { min-height: 0; padding: 10px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.agent-map-card { margin-bottom: 8px; padding: 14px; border: 1px solid #eaecf0; border-radius: 11px; background: #fff; }
.agent-map-card.is-gold { border-color: #ecd889; background: linear-gradient(135deg, #fffdf4, #fff); }
.agent-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.agent-card-top strong { font-size: .79rem; line-height: 1.45; }
.agent-card-top span { flex: none; padding: 3px 7px; border-radius: 999px; background: #fff0f3; color: #bd1238; font-size: .58rem; font-weight: 750; }
.is-gold .agent-card-top span { background: #fff3bd; color: #7a5800; }
.agent-map-card p { margin: 6px 0 0; color: #667085; font-size: .68rem; line-height: 1.55; word-break: break-word; }
.agent-map-card .agent-card-place { color: #344054; font-weight: 700; }
.agent-card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.agent-card-meta span { padding: 3px 6px; border-radius: 5px; background: #f2f4f7; color: #667085; font-size: .58rem; }
.agent-map-empty { padding: 55px 15px; color: #98a2b3; font-size: .75rem; text-align: center; }

@media (max-width: 980px) {
  .agent-map-workspace { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 760px) {
  .agent-map-page { padding-top: 10px; }
  .agent-map-head { align-items: center; margin-bottom: 13px; }
  .agent-map-head p { font-size: .68rem; }
  .agent-map-head-actions { flex-direction: column; gap: 5px; }
  .agent-map-add, .agent-map-back { min-height: 34px; padding: 0 11px; font-size: .68rem; }
  .agent-map-stats { grid-template-columns: 1fr 1fr; }
  .agent-map-stats article { padding: 13px 14px; border-bottom: 1px solid #eaecf0; }
  .agent-map-stats article:nth-child(2) { border-right: 0; }
  .agent-map-stats article:nth-child(n+3) { border-bottom: 0; }
  .agent-map-stats strong { font-size: 1.25rem; }
  .agent-map-workspace { display: block; height: auto; min-height: 0; border-radius: 15px; overflow: visible; }
  .agent-map-stage { height: 54vh; min-height: 390px; border-radius: 15px 15px 0 0; }
  .agent-map-canvas { min-height: 390px; height: 100%; }
  .agent-map-panel { height: auto; border-top: 1px solid #eaecf0; border-left: 0; }
  .agent-map-workspace.panel-collapsed .agent-map-panel { display: none; }
  .agent-panel-toggle { position: absolute; top: calc(54vh - 45px); right: 9px; bottom: auto; width: auto; min-height: 34px; display: flex; padding: 6px 11px; transform: none; border: 1px solid #e4e7ec; border-radius: 999px; box-shadow: 0 6px 18px rgba(16,24,40,.1); }
  .panel-collapsed .agent-panel-toggle { right: 9px; }
  .agent-panel-toggle em { writing-mode: horizontal-tb; letter-spacing: 1px; }
  .agent-map-list { max-height: 55vh; }
  .agent-map-toolbar { top: 10px; left: 10px; right: 10px; }
  .agent-map-legend { display: none; }
  .agent-map-hint { right: 9px; bottom: 8px; }
}
@media (max-width: 430px) {
  .agent-map-head h1 { font-size: 1.35rem; }
  .agent-map-kicker { font-size: .56rem; letter-spacing: 1.4px; }
  .agent-map-head p strong { display: inline; }
  .agent-map-back { font-size: .68rem; }
  .agent-map-stage { height: 48vh; min-height: 350px; }
  .agent-map-canvas { min-height: 350px; }
  .agent-panel-toggle { top: calc(48vh - 43px); }
}
