.map-page-body{
  background:
    radial-gradient(980px 420px at 9% -10%, rgba(30,202,211,.10) 0%, transparent 55%),
    radial-gradient(920px 380px at 92% -18%, rgba(20,184,166,.08) 0%, transparent 54%),
    linear-gradient(180deg,#0c1424 0%,#0b1120 100%);
}

.map-shell{
  display:grid;
  gap:10px;
  padding-top:10px;
}

.map-info-strip{
  display:grid;
  gap:10px;
  padding:11px 12px;
  background:
    radial-gradient(560px 220px at -2% 0%, rgba(20,184,166,.10) 0%, transparent 62%),
    radial-gradient(460px 220px at 102% 10%, rgba(59,130,246,.05) 0%, transparent 62%),
    linear-gradient(180deg, rgba(17,24,39,.98) 0%, rgba(11,18,32,.98) 100%);
}

.map-info-strip__main{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:10px;
  align-items:start;
}

.map-info-strip__copy{
  display:grid;
  gap:4px;
  min-width:0;
}

.map-info-strip__facts{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
  padding-top:8px;
  border-top:1px dashed rgba(71,85,105,.58);
}

.map-info-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid rgba(71,85,105,.7);
  background:rgba(15,23,42,.7);
  color:#dbe4f0;
}

.map-info-chip__label{
  font-size:9px;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#8ea0bb;
}

.map-info-chip__value{
  font-size:11px;
  font-weight:700;
  color:#ecf2f8;
}

.map-top-shell{
  display:grid;
  grid-template-columns:minmax(0,1fr) 336px;
  grid-template-areas:
    "stage side"
    "graph graph";
  gap:10px 12px;
  align-items:stretch;
  padding-top:0;
}

.map-stage{
  grid-area:stage;
  position:relative;
  min-width:0;
  height:56vh;
  min-height:380px;
}

#map{
  width:100%;
  height:100%;
  max-width:none;
  min-height:0;
  margin:0;
  border:1px solid rgba(38,50,70,.95);
  border-radius:18px;
  overflow:hidden;
  background:#08111d;
  box-shadow:0 18px 36px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.03);
}

body[data-page-key="index"] .container,
body[data-page-key="pro"] .container,
body[data-page-key="topo"] .container{
  margin-top:0;
}

.controls{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:0;
  align-items:center;
}

.map-command-card{
  padding:12px;
  overflow:hidden;
  background:
    radial-gradient(560px 220px at -2% 0%, rgba(20,184,166,.10) 0%, transparent 62%),
    radial-gradient(460px 220px at 102% 10%, rgba(59,130,246,.05) 0%, transparent 62%),
    linear-gradient(180deg, rgba(17,24,39,.98) 0%, rgba(11,18,32,.98) 100%);
}

.map-command-card--side{
  grid-area:side;
  display:grid;
  align-content:start;
  gap:10px;
  height:56vh;
  min-height:380px;
  overflow:auto;
}

.map-command-copy{
  display:grid;
  gap:6px;
}

.map-command-eyebrow,
.map-stack-card__eyebrow,
.map-manual-card__eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(15,23,42,.58);
  color:#cbd5e1;
  font-size:10px;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.map-command-title{
  margin:0;
  font-size:24px;
  line-height:1.02;
  letter-spacing:-.03em;
}

.map-command-lead{
  margin:0;
  max-width:none;
  color:#aebed3;
  line-height:1.4;
  font-size:12px;
}

.map-command-pill{
  padding:5px 8px;
  border-radius:999px;
  border:1px solid rgba(71,85,105,.7);
  background:rgba(15,23,42,.7);
  color:#dbe4f0;
  font-size:10px;
  font-weight:700;
  letter-spacing:.04em;
}

.map-sidecard-section{
  display:grid;
  gap:8px;
  padding-top:8px;
  border-top:1px dashed rgba(71,85,105,.58);
}

.map-sidecard-section--plain{
  padding-top:0;
  border-top:0;
}

.map-sidecard-actions{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:6px;
}

.map-sidecard-actions .map-btn-build{
  grid-column:1 / -1;
  width:100%;
}

.map-command-card .btn{
  min-height:32px;
  padding:0 11px;
  border-radius:9px;
  font-size:12px;
}

.map-btn-build{
  padding:0 14px;
  min-height:34px;
  border-radius:10px;
  border-color:rgba(94,234,212,.26);
  background:linear-gradient(135deg, rgba(26,135,130,.88) 0%, rgba(17,91,96,.94) 100%);
  color:#eff7f7;
  box-shadow:0 6px 12px rgba(10,20,30,.14);
}

.map-btn-build:hover{
  background:linear-gradient(135deg, rgba(30,145,139,.9) 0%, rgba(19,100,105,.96) 100%);
  box-shadow:0 8px 14px rgba(10,20,30,.16);
}

.map-manual-card{
  display:grid;
  gap:5px;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(71,85,105,.62);
  background:rgba(15,23,42,.42);
}

.map-manual-card__title{
  margin:0;
  font-size:14px;
  font-weight:700;
  color:#ecf2f8;
}

.map-manual-card__text,
.map-manual-card__meta{
  color:#9fb0c7;
  line-height:1.4;
  font-size:10px;
}

.map-controls--manual{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:6px;
}

.map-controls--manual input{
  width:100%;
  min-width:0;
  background:#0a1220;
  color:#edf3fb;
  border:1px solid #2b3a55;
  border-radius:10px;
  padding:8px 10px;
  font-size:12px;
}

.map-controls--manual .btn{
  width:100%;
}

.map-profile-card{
  grid-area:graph;
  padding:8px;
  background:
    radial-gradient(540px 220px at -4% 0%, rgba(20,184,166,.12) 0%, transparent 62%),
    radial-gradient(420px 190px at 106% 10%, rgba(245,158,11,.08) 0%, transparent 58%),
    linear-gradient(180deg, rgba(17,24,39,.98) 0%, rgba(11,18,32,.98) 100%);
  overflow:hidden;
}

#graphWrap{
  display:grid;
  gap:8px;
}

#graph{
  background:
    radial-gradient(320px 160px at 20% 0%, rgba(59,130,246,.08) 0%, transparent 68%),
    linear-gradient(180deg, #0d1628 0%, #09111f 100%);
  padding:8px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--line);
  min-height:208px;
}

#graph img{display:block;max-width:100%;height:auto;margin:0 auto;border:none}

.graphTools{display:none;gap:6px;flex-wrap:wrap;margin-top:8px}

.graphToolBtn{
  border:1px solid #334155;
  background:#0f172a;
  color:#93a3b8;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.2px;
  padding:5px 9px;
  cursor:pointer;
  transition:.18s ease;
}

.graphToolBtn:hover{background:#162033;color:#dbeafe}

.graphToolBtn.is-active{
  background:#1a2534;
  color:#f3f7fb;
  border-color:rgba(60,186,174,.46);
  box-shadow:0 0 0 1px rgba(60,186,174,.16);
}

.loader{
  display:none;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:10px;
  background:#111827;
  border:1px solid #374151;
  color:#f59e0b;
}

.spinner{
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid #334155;
  border-top-color:#f59e0b;
  animation:spin 1s linear infinite;
}

@keyframes spin{to{transform:rotate(360deg)}}

.map-workspace{
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  gap:12px;
  align-items:start;
}

.map-main{
  min-width:0;
  display:grid;
  gap:12px;
}

.map-main > .comments{
  margin-top:0;
}

.map-side{
  display:grid;
  gap:12px;
  position:sticky;
  top:84px;
  align-self:start;
}

.map-side .comments{
  margin-top:0;
}

.map-glass-card{
  background:
    radial-gradient(300px 120px at 0% 0%, rgba(20,184,166,.06) 0%, transparent 70%),
    linear-gradient(180deg, rgba(17,24,39,.98) 0%, rgba(11,18,32,.98) 100%);
}

.map-stack-card{
  padding:11px;
}

.map-stack-card--dashed{
  border-style:dashed;
  border-color:rgba(71,85,105,.62);
}

.map-stack-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}

.map-stack-card__head--clickable{
  cursor:pointer;
}

.map-stack-card__title{
  margin:6px 0 0;
  font-size:15px;
  line-height:1.1;
}

.map-stack-card__toggle{
  min-height:24px;
  padding:0 9px;
  border-radius:999px;
  border:1px solid rgba(71,85,105,.72);
  color:#9fb0c7;
  display:inline-flex;
  align-items:center;
  font-size:10px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.map-history-list{
  list-style:none;
  padding-left:0;
  margin:0;
  display:grid;
  gap:6px;
}

.historyItem{
  margin:0;
  padding:7px 9px;
  border:1px solid rgba(51,65,85,.58);
  border-radius:9px;
  background:rgba(10,15,27,.42);
  color:#cbd5e1;
  font-size:11px;
  line-height:1.4;
  cursor:pointer;
  transition:.16s ease;
}

.historyItem:hover,
.historyItem:focus-visible{
  border-color:rgba(96,216,228,.44);
  background:rgba(13,22,38,.72);
  box-shadow:0 0 0 1px rgba(96,216,228,.12) inset;
  outline:none;
}

@media (max-width: 980px){
  .map-info-strip__main,
  .map-top-shell,
  .map-workspace{
    grid-template-columns:1fr;
  }
  .map-top-shell{
    grid-template-areas:
      "stage"
      "side"
      "graph";
    gap:10px;
  }
  .map-command-card--side{
    height:auto;
    min-height:0;
  }
  .map-side{position:static}
}

@media (max-width: 720px){
  .map-shell{gap:8px;padding-top:8px}
  .map-info-strip{
    padding:10px;
  }
  .map-stage{height:46vh;min-height:300px}
  #map{min-height:300px;border-radius:14px}
  body[data-page-key="index"] .container,
  body[data-page-key="pro"] .container,
  body[data-page-key="topo"] .container{
    margin-top:0;
  }
  .map-info-strip__facts{
    padding-top:0;
    border-top:0;
  }
  .map-command-card,
  .map-profile-card,
  .map-stack-card{padding:10px}
  .map-command-title{font-size:21px}
  .map-info-strip__main,
  .map-sidecard-actions,
  .map-controls--manual{grid-template-columns:1fr}
  .map-btn-build{width:100%;justify-content:center}
  .map-controls--manual input,
  .map-controls--manual .btn{width:100%}
}
