:root{
  --bg:#0b1220;
  --panel:#0f1b33;
  --panel2:#0b1428;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --accent:#facc15;
  --accent2:#38bdf8;
  --danger:#ef4444;
  --ok:#22c55e;
  --shadow:0 18px 40px rgba(0,0,0,.45);
  --radius:18px;
}

*{box-sizing:border-box;     scrollbar-width: none;}

html,body{
  height:100%;
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif;
}

body{
  position:relative;
  overflow:hidden;
}

body:before{
  content:"";
  position:fixed;
  inset:-40px;
  background:
    radial-gradient(circle at 20% 10%, rgba(250,204,21,.10), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(56,189,248,.10), transparent 50%),
    repeating-linear-gradient(120deg, rgba(255,255,255,.05) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 1px, transparent 1px 16px);
  opacity:.35;
  pointer-events:none;
  filter:blur(.2px);
}

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

.app{
  height:100%;
  display:grid;
  grid-template-columns:320px 1fr;
}

.sidebar{
  overflow-y:auto;
  background:linear-gradient(180deg,var(--panel),var(--panel2));
  border-right:1px solid rgba(255,255,255,.06);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

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

.logo{
  width:40px;
  height:40px;
  border-radius:14px;
  background:rgba(250,204,21,.14);
  display:grid;
  place-items:center;
  color:var(--accent);
  font-weight:900;
  letter-spacing:.5px;
}

.titles .name{font-weight:800}
.titles .tag{
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}

.icon-btn{
  margin-left:auto;
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  transition:transform .15s, background .15s, border-color .15s;
}
.icon-btn:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.06);
  border-color:rgba(250,204,21,.30);
}
.icon-btn:active{transform:translateY(0) scale(.98)}

.nav{
  display:flex;
  gap:10px;
}

.nav-item{
  flex:1;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  color:var(--text);
  border-radius:14px;
  padding:10px 0;
  cursor:pointer;
  transition:.15s;
}
.nav-item:hover{transform:translateY(-1px)}
.nav-item.active{
  border-color:rgba(56,189,248,.45);
  background:rgba(56,189,248,.12);
}
.nav-item .ico{font-size:18px}

.panel{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  padding:12px;
  box-shadow:none;
}

.panel-title{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.12em;
  padding:2px;
  margin:0 0 10px 0;
  cursor:pointer;
}

.panel-title .caret{
  opacity:.75;
  transition:transform .18s;
}

.panel.is-collapsed .panel-title .caret{
  transform:rotate(-90deg);
}

.panel.is-collapsed > *:not(.panel-title){
  display:none !important;
}

.panel-body{
  overflow:hidden;
  transition:max-height .22s ease, opacity .18s ease;
  max-height:1200px;
  opacity:1;
}

.panel.is-collapsed .panel-body{
  max-height:0;
  opacity:0;
}

.actions-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.actions-grid .ico{margin-right:8px}
.actions-grid .lbl{opacity:.95}
.panel-actions .btn{justify-content:center}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:10px;
}

.label{
  color:var(--muted);
  font-size:12px;
  display:flex;
  align-items:center;
  gap:6px;
}

.label.with-icon{justify-content:space-between}

.type-icon{
  width:22px;
  height:22px;
  border-radius:8px;
  opacity:.95;
  box-shadow:0 0 0 1px rgba(255,255,255,.10) inset;
}

select,input,textarea{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.15);
  color:var(--text);
  border-radius:14px;
  padding:10px 12px;
  outline:none;
}

select option{
  background:#0b0f14;
  color:var(--text);
}

textarea{resize:vertical}

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

.btn{
  width:100%;
  border:1px solid rgba(0,0,0,.25);
  background:linear-gradient(180deg, rgba(250,204,21,.95), rgba(250,204,21,.78));
  color:#0b1220;
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  transition:filter .15s ease, transform .15s ease, background .15s ease;
}
.btn:hover{
  filter:brightness(1.02);
  transform:translateY(-1px);
}
.btn:active{transform:translateY(0) scale(.98)}

.btn-secondary{
  border:1px solid rgba(56,189,248,.35);
  background:rgba(255,255,255,.06);
  color:var(--text);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
}
.btn-secondary:hover{background:rgba(255,255,255,.10)}

.cleanup-stage{
  position:relative;
  min-height:360px;
  border-radius:24px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 50% 45%, rgba(74,222,128,.18), transparent 20%),
    radial-gradient(circle at 50% 55%, rgba(139,92,246,.24), transparent 42%),
    linear-gradient(180deg, rgba(7,17,29,.98), rgba(12,27,47,.96));
}

.cleanup-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  touch-action:none;
}

.cleanup-target{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  pointer-events:none;
}

.cleanup-target__ring{
  width:180px;
  height:180px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.16);
  box-shadow:0 0 0 18px rgba(139,92,246,.08), 0 0 40px rgba(74,222,128,.18);
}

.cleanup-target__core{
  position:absolute;
  width:38px;
  height:38px;
  border-radius:999px;
  background:radial-gradient(circle at 35% 35%, #ecfccb, #4ade80 55%, #166534 100%);
  box-shadow:0 0 18px rgba(74,222,128,.55);
}

.cleanup-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:14px;
}

.cleanup-progress{
  flex:1;
  min-width:0;
}

.cleanup-progress__bar{
  height:12px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.08);
}

.cleanup-progress__fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg, #8b5cf6, #4ade80);
  transition:width .12s ease;
}

.cleanup-progress__text{
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

#incCleanupMeta{
  margin-top:8px;
}

.btn.ghost{
  background:transparent;
  color:var(--text);
  border:1px solid rgba(255,255,255,.14);
}

.btn.danger{
  border-color:rgba(255,80,80,.35);
  color:#ffd0d0;
}

.info{
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  white-space:pre-wrap;
  max-height:210px;
  overflow:auto;
}

.footer{
  margin-top:auto;
  color:var(--muted);
  font-size:12px;
  opacity:.85;
}

.main{
  flex-grow:1;
  max-height:100vh;
  position:relative;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.06);
  background:rgba(10,14,20,.65);
  backdrop-filter:blur(10px);
  position:sticky;
  top:0;
  z-index:4;
}

.topbar-left,.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.chip{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
  color:var(--text);
  border-radius:999px;
  padding:8px 10px;
  font-size:13px;
}

.chip .ico{margin-right:8px}

.chip-btn{
  cursor:pointer;
  text-decoration:none;
}
.chip-btn:hover{background:rgba(255,255,255,.10)}
.chip-btn.is-on{
  background:rgba(56,189,248,.22);
  border-color:rgba(56,189,248,.45);
}

.content{
  position:relative;
  flex:1;
  min-height:0;
}

.content::before,
.content::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:2;
  opacity:0;
  transition:opacity .35s ease, background .35s ease, filter .35s ease;
}

.map{
  position:absolute;
  inset:0;
}

#map{
  height:100%;
  width:100%;
  overflow:hidden;
  position:relative;
  z-index:0;
  transition:filter .35s ease, opacity .35s ease;
}

body.env-time-dawn .content::before{
  opacity:1;
  background:
    linear-gradient(180deg, rgba(252,146,68,.48), rgba(118,170,255,.14) 28%, rgba(0,0,0,0) 56%);
}
body.env-time-day .content::before{
  opacity:1;
  background:
    linear-gradient(180deg, rgba(125,211,252,.28), rgba(255,255,255,.08) 28%, rgba(0,0,0,0) 52%);
}
body.env-time-dusk .content::before{
  opacity:1;
  background:
    linear-gradient(180deg, rgba(249,115,22,.44), rgba(93,63,211,.18) 34%, rgba(0,0,0,0) 60%);
}
body.env-time-night .content::before{
  opacity:1;
  background:
    linear-gradient(180deg, rgba(8,15,30,.72), rgba(18,32,62,.26) 30%, rgba(0,0,0,0) 62%);
}
body.env-weather-cloudy #map{
  filter:saturate(.96) brightness(.96);
}
body.env-weather-fog .content::after{
  opacity:1;
  background:
    linear-gradient(180deg, rgba(214,223,236,.34), rgba(214,223,236,.12) 26%, rgba(214,223,236,.04) 44%, rgba(0,0,0,0)),
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.22), rgba(255,255,255,.06) 36%, transparent 62%);
  filter:blur(2px);
}
body.env-weather-rain .content::after,
body.env-weather-storm .content::after{
  opacity:1;
  background:
    linear-gradient(180deg, rgba(29,78,216,.16), rgba(15,23,42,.12) 24%, rgba(0,0,0,0) 44%),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.06), transparent 42%),
    radial-gradient(circle at 50% 62%, rgba(191,219,254,.08), transparent 50%);
  filter:blur(1px);
}
body.env-weather-rain #map{
  filter:saturate(.94) brightness(.95);
}
body.env-weather-storm #map{
  filter:saturate(.9) brightness(.88) contrast(1.05);
}
body.env-weather-storm .content::before{
  opacity:1;
  background:
    linear-gradient(180deg, rgba(7,12,24,.2), rgba(10,16,30,.04) 28%, rgba(0,0,0,0) 60%);
}

.env-controls{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.env-chip{
  min-height:38px;
}
.env-chip.active{
  border-color:rgba(125,211,252,.44);
  background:linear-gradient(180deg, rgba(56,189,248,.16), rgba(37,99,235,.08));
}

body.map-close-view #map::before,
body.map-close-view #map::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:1;
}

body.map-close-view #map::before{
  background:
    linear-gradient(180deg, rgba(9,14,24,.18), rgba(9,14,24,0) 26%, rgba(9,14,24,0) 70%, rgba(9,14,24,.18)),
    radial-gradient(circle at 50% 70%, rgba(255,255,255,.02), rgba(5,10,18,0) 42%);
}

body.map-third-person #map::after{
  background:
    linear-gradient(180deg, rgba(160, 190, 220, .12), rgba(160, 190, 220, 0) 20%),
    radial-gradient(circle at 50% 82%, rgba(8,12,22,0), rgba(8,12,22,.38) 72%);
}

/* FAB */
.fab{
  position:absolute;
  right:16px;
  bottom:16px;
  z-index:9999;
  width:56px;
  height:56px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,.45);
  background:rgba(56,189,248,.20);
  color:var(--text);
  cursor:pointer;
  box-shadow:var(--shadow);
  display:grid;
  place-items:center;
}

.ups-boss-marker{
  position:relative;
  border:0;
  background:transparent;
  padding:0;
  cursor:pointer;
  transform:translateY(6px);
}
.ups-boss-marker__core{
  position:relative;
  width:66px;
  height:66px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:radial-gradient(circle at 50% 38%, rgba(255,240,160,.98), rgba(245,158,11,.92) 58%, rgba(120,53,15,.95) 100%);
  border:2px solid rgba(255,255,255,.72);
  box-shadow:0 14px 28px rgba(0,0,0,.34), 0 0 0 8px rgba(56,189,248,.10);
}
.ups-boss-marker__halo{
  position:absolute;
  inset:-12px;
  border-radius:999px;
  border:2px solid rgba(56,189,248,.42);
  animation:upsBossPulse 1.8s ease-out infinite;
}
.ups-boss-marker__glyph{
  position:relative;
  z-index:1;
  font-size:28px;
  filter:drop-shadow(0 6px 14px rgba(0,0,0,.34));
}
.ups-boss-marker__label{
  margin-top:8px;
  min-width:112px;
  margin-left:-24px;
  padding:8px 10px;
  border-radius:16px;
  background:rgba(8,15,30,.88);
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  display:grid;
  gap:2px;
  text-align:center;
  box-shadow:0 12px 28px rgba(0,0,0,.28);
}
.ups-boss-marker__label strong{
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.ups-boss-marker__label span{
  font-size:11px;
  color:rgba(255,255,255,.72);
}
@keyframes upsBossPulse{
  from{transform:scale(.86);opacity:.92}
  to{transform:scale(1.18);opacity:0}
}
.fab:hover{
  transform:translateY(-1px);
  background:rgba(56,189,248,.28);
}
.fab-ico{
  font-size:22px;
  line-height:1;
}

/* Floating report button */
.fab-report{
  position:absolute;
  right:20px;
  bottom:24px;
  width:58px;
  height:58px;
  border-radius:999px;
  border:0;
  font-size:34px;
  line-height:0;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 14px 30px rgba(0,0,0,.35);
  background:rgba(138, 92, 255, .92);
  color:#fff;
  z-index:60;
  transition:transform .12s ease, filter .12s ease;
}
.fab-report:hover{
  transform:translateY(-1px) scale(1.02);
  filter:brightness(1.05);
}
.fab-report:active{
  transform:translateY(0) scale(.98);
  filter:brightness(.95);
}

/* Drawer */
.drawer{
  position:fixed;
  top:74px;
  right:14px;
  width:360px;
  max-width:calc(100vw - 28px);
  max-height:calc(100vh - 88px);
  background:rgba(17,24,39,.92);
  backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,.10);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  z-index:9999;
  display:none;
  overflow-y:auto;
}
.drawer.open{display:block}

.drawer-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.drawer-title{font-weight:800}

.drawer-body{
  padding:12px;
  overflow:auto;
  max-height:calc(100% - 54px);
}

.drawer-backdrop{
  position:fixed;
  inset:0;
  background:rgba(2,6,16,.24);
  z-index:5;
}

.drawer--incident{
  top:74px;
  right:14px;
  width:460px;
  max-height:calc(100vh - 88px);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.08), transparent 28%),
    linear-gradient(180deg, rgba(17,24,39,.98), rgba(13,18,31,.96));
  border-color:rgba(255,255,255,.08);
  box-shadow:0 26px 60px rgba(0,0,0,.34);
}

.inc-head{
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
}

.inc-badge{
  width:44px;
  height:44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:color-mix(in srgb,var(--accent) 28%, rgba(255,255,255,.06));
  border:1px solid color-mix(in srgb,var(--accent) 45%, rgba(255,255,255,.10));
  box-shadow:0 10px 25px rgba(0,0,0,.25);
}

.inc-badge img{
  width:26px;
  height:26px;
  object-fit:contain;
  filter:drop-shadow(0 6px 10px rgba(0,0,0,.35));
}

.inc-name{
  font-weight:900;
  font-size:20px;
  line-height:1.05;
}

.inc-sub{
  color:var(--muted);
  font-size:12px;
  margin-top:5px;
}

.inc-pill-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

.inc-pill{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 11px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:#f5f8ff;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.inc-pill--soft{
  color:rgba(255,255,255,.76);
  background:rgba(255,255,255,.04);
}

.inc-photo{
  position:relative;
  margin:12px 0 10px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:20px;
  overflow:hidden;
  background:rgba(255,255,255,.03);
  min-height:180px;
}
.inc-photo img{
  display:block;
  width:100%;
  height:auto;
}

.inc-photo .photo-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.35);
  color:rgba(255,255,255,.92);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  backdrop-filter:blur(6px);
}
.inc-photo .photo-nav:hover{background:rgba(0,0,0,.50)}
.inc-photo .photo-nav.prev{left:10px}
.inc-photo .photo-nav.next{right:10px}

.inc-photo .photo-count{
  position:absolute;
  right:10px;
  bottom:10px;
  font-size:12px;
  padding:4px 8px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:999px;
  background:rgba(0,0,0,.30);
  color:rgba(255,255,255,.92);
  backdrop-filter:blur(6px);
}

/* Map hover popup */
.maplibregl-popup.hover-popup .maplibregl-popup-content{
  background:rgba(15,23,42,.92);
  color:rgba(255,255,255,.92);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:10px 12px;
  box-shadow:0 18px 40px rgba(0,0,0,.35);
}
.maplibregl-popup.hover-popup .maplibregl-popup-tip{
  border-top-color:rgba(15,23,42,.92);
}

.hover-card{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:180px;
}
.hover-ico{
  width:28px;
  height:28px;
  border-radius:10px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  display:flex;
  align-items:center;
  justify-content:center;
}
.hover-ico img{
  width:20px;
  height:20px;
  display:block;
}
.hover-txt{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.hover-title{
  font-weight:800;
  font-size:13px;
  line-height:1.1;
}
.hover-sub{
  font-size:12px;
  color:rgba(255,255,255,.70);
}

.inc-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}

.inc-kv{
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  border-radius:14px;
}
.inc-kv .k{
  color:var(--muted);
  font-size:11px;
}
.inc-kv .v{
  font-weight:800;
  margin-top:4px;
}

.inc-desc{
  color:rgba(255,255,255,.92);
  font-size:13px;
  line-height:1.35;
  white-space:pre-wrap;
}

.inc-actions{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}

.hint{
  color:var(--muted);
  font-size:12px;
  margin-bottom:10px;
}

.icon{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--text);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}
.icon:hover{background:rgba(255,255,255,.10)}

.photo-preview{
  margin-top:10px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  overflow:hidden;
}
.photo-preview img{
  display:block;
  width:100%;
  height:auto;
}

.page-loader{
  position:fixed;
  inset:0;
  z-index:20000;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 50% 32%, rgba(250,204,21,.16), transparent 24%),
    radial-gradient(circle at 50% 68%, rgba(56,189,248,.10), transparent 28%),
    linear-gradient(180deg, rgba(6,12,24,.985), rgba(7,15,30,.985));
  transition:opacity .24s ease, visibility .24s ease;
}

.page-loader.is-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.page-loader__inner{
  display:grid;
  gap:14px;
  place-items:center;
  text-align:center;
}

.page-loader__logo{
  width:94px;
  height:94px;
  border-radius:26px;
  padding:12px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 24px 60px rgba(0,0,0,.34);
  animation:pageLoaderFloat 1.3s ease-in-out infinite alternate;
}

.page-loader__logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.page-loader__text{
  font-size:13px;
  font-weight:900;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:rgba(255,255,255,.72);
}

.pwa-install-btn{
  position:fixed;
  left:18px;
  bottom:18px;
  z-index:12000;
  min-height:48px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid rgba(58,124,176,.32);
  background:linear-gradient(135deg, #1e5b87, #3a7cb0);
  color:#ffffff;
  font-weight:900;
  box-shadow:0 18px 40px rgba(14,31,49,.24);
  cursor:pointer;
}

@keyframes pageLoaderFloat{
  from{transform:translateY(0) scale(1)}
  to{transform:translateY(-8px) scale(1.02)}
}

/* Auth overlay */
.auth-overlay{
  position:absolute;
  inset:0;
  display:none;
  place-items:center;
  z-index:9999;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(10px);
}
.auth-overlay.open{display:grid}

.auth-card{
  width:420px;
  max-width:calc(100% - 30px);
  background:rgba(17,24,39,.96);
  border:1px solid rgba(255,255,255,.10);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.auth-card .head{
  padding:16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.auth-card .title{
  font-weight:900;
  font-size:18px;
}
.auth-card .body{padding:16px}

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

.auth-tabs{
  display:flex;
  gap:10px;
  margin-bottom:12px;
}
.tabbtn{
  flex:1;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
  color:var(--text);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
}
.tabbtn.active{
  border-color:rgba(56,189,248,.45);
  background:rgba(56,189,248,.12);
}

/* Modals */
.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  background:rgba(0,0,0,.50);
  backdrop-filter:blur(10px);
}
.modal.open{display:flex}
.modal[hidden]{display:none !important}
[hidden]{display:none !important}
.tutorial-modal{z-index:320}
.tutorial-card{max-width:720px;width:min(92vw,720px);padding:0;border-radius:28px;overflow:hidden;background:linear-gradient(180deg, rgba(10,18,34,.98), rgba(8,14,28,.96));border:1px solid rgba(255,255,255,.10);box-shadow:0 28px 80px rgba(0,0,0,.45)}
.tutorial-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:22px 22px 14px;border-bottom:1px solid rgba(255,255,255,.06)}
.tutorial-kicker{font-size:12px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.55)}
.tutorial-title{margin-top:8px;font-size:32px;font-weight:1000;line-height:1}
.tutorial-stage{padding:22px;display:grid;gap:16px;background:
  radial-gradient(circle at top right, rgba(56,189,248,.14), transparent 28%),
  radial-gradient(circle at left, rgba(250,204,21,.10), transparent 24%)}
.tutorial-step-badge{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 12px;border-radius:999px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05);font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.74)}
.tutorial-visual{display:flex;align-items:center;justify-content:center;min-height:130px;border-radius:24px;border:1px solid rgba(255,255,255,.08);background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));font-size:68px}
.tutorial-copy{display:grid;gap:10px}
.tutorial-copy-title{font-size:24px;font-weight:1000;line-height:1.05}
.tutorial-copy-body{font-size:15px;line-height:1.6;color:rgba(255,255,255,.78)}
.tutorial-tips{display:flex;gap:10px;flex-wrap:wrap}
.tutorial-tip{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);font-size:12px;font-weight:700;color:rgba(255,255,255,.76)}
.tutorial-progress{height:8px;background:rgba(255,255,255,.06);margin:0 22px;border-radius:999px;overflow:hidden}
.tutorial-progress__bar{height:100%;width:20%;background:linear-gradient(90deg, rgba(250,204,21,.95), rgba(56,189,248,.92));border-radius:999px;transition:width .18s ease}
.tutorial-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px 22px}
.tutorial-actions__meta{display:flex;align-items:center;justify-content:center;flex:1}
.tutorial-check{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:rgba(255,255,255,.72)}
.tutorial-check input{accent-color:#facc15}

.announcement-modal{z-index:318}
.announcement-card{position:relative;max-width:760px;width:min(92vw,760px);padding:0;border-radius:28px;overflow:hidden;background:linear-gradient(180deg, rgba(9,17,31,.98), rgba(11,18,32,.96));border:1px solid rgba(255,255,255,.10);box-shadow:0 28px 80px rgba(0,0,0,.45)}
.announcement-close{position:absolute;top:16px;right:16px;z-index:2}
.announcement-media{height:min(34vh,280px);background:rgba(255,255,255,.04);border-bottom:1px solid rgba(255,255,255,.08)}
.announcement-media img{width:100%;height:100%;object-fit:cover;display:block}
.announcement-body{padding:22px;display:grid;gap:12px;background:
  radial-gradient(circle at top right, rgba(56,189,248,.12), transparent 28%),
  radial-gradient(circle at left, rgba(250,204,21,.10), transparent 24%)}
.announcement-kicker{font-size:12px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.52)}
.announcement-title{font-size:34px;font-weight:1000;line-height:1}
.announcement-subtitle{color:rgba(255,255,255,.76);font-size:15px;line-height:1.5}
.announcement-content{color:rgba(255,255,255,.84);line-height:1.7}
.announcement-content p{margin:0 0 10px}
.announcement-content a{color:#7dd3fc}
.announcement-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:8px}
.announcement-check{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:rgba(255,255,255,.72)}
.announcement-check input{accent-color:#facc15}
.announcement-buttons{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

@media (max-width: 760px){
  .announcement-card{width:calc(100vw - 18px);max-width:none;border-radius:24px}
  .announcement-media{height:180px}
  .announcement-title{font-size:26px}
  .announcement-actions{align-items:flex-start}
}

@media (max-width: 760px){
  .tutorial-card{width:calc(100vw - 18px);max-width:none;border-radius:24px}
  .tutorial-title{font-size:24px}
  .tutorial-visual{min-height:100px;font-size:52px}
  .tutorial-actions{flex-wrap:wrap}
  .tutorial-actions .btn{flex:1}
  .tutorial-actions__meta{order:3;flex:0 0 100%;justify-content:flex-start}
}

.modal .modal-backdrop,
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(4px);
}

.modal-card{
  position:relative;
  width:min(860px, calc(100vw - 30px));
  max-height:calc(100vh - 30px);
  background:rgba(17,24,39,.96);
  border:1px solid rgba(255,255,255,.10);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.modal-card.wide{max-width:860px}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.modal-title{font-weight:900}

.modal-body{
  padding:14px;
  overflow:auto;
  max-height:calc(100vh - 140px);
}

.modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  padding:12px 14px;
  border-top:1px solid rgba(255,255,255,.08);
}

.rank-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:10px;
}

.list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}
.list .item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  border-radius:14px;
}
.list .item .name{font-weight:700}

.badges{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}

.badge{
  padding:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  border-radius:14px;
}
.badge.on{
  border-color:rgba(56,189,248,.45);
  background:rgba(56,189,248,.10);
}
.badge .t,.badge .btitle{font-weight:800}
.badge .d,.badge .bdesc{
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
  line-height:1.3;
}

.divider{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:10px 0;
}

.toggle{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  margin:6px 0 10px;
}
.toggle input{
  width:18px;
  height:18px;
}

.ad-fields{
  padding:10px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.02);
  border-radius:14px;
}

.rowitem{
  display:grid;
  grid-template-columns:56px 1fr 70px;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  border-radius:14px;
  margin-top:8px;
}
.rowitem span:last-child{
  text-align:right;
  font-weight:800;
}

/* Contacts UI */
.contact-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin:-6px 0 10px;
}

a.tel{
  color:#dbe8ff;
  text-decoration:none;
}
a.tel:hover{text-decoration:underline}

.card.soft{
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  border-radius:14px;
  padding:12px;
}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

/* Map popup */
.maplibregl-popup-content{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
}

.maplibregl-popup-close-button{
  color:rgba(255,255,255,.85);
  font-size:18px;
  margin:6px 6px 0 0;
}

/* Home marker */
.home-marker{
  width:38px;
  height:38px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(15,23,42,.92);
  box-shadow:0 16px 32px rgba(0,0,0,.35);
  cursor:pointer;
  user-select:none;
}
.home-marker:hover{transform:translateY(-1px)}
.home-marker .inner{
  font-size:20px;
  filter:drop-shadow(0 6px 10px rgba(0,0,0,.35));
}

/* User marker */
.me-marker{
  width:18px;
  height:34px;
  position:relative;
}
.me-marker .dot{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  width:18px;
  height:18px;
  border-radius:999px;
  background:rgba(56,189,248,.95);
  box-shadow:0 0 0 3px rgba(255,255,255,.92), 0 10px 24px rgba(0,0,0,.35);
}
.me-marker .pulse{
  position:absolute;
  left:-14px;
  right:-14px;
  bottom:-14px;
  width:46px;
  height:46px;
  border-radius:999px;
  background:rgba(56,189,248,.18);
  border:1px solid rgba(56,189,248,.35);
  animation:upsPulse 1.6s ease-out infinite;
}

@keyframes upsPulse{
  0%{transform:scale(.55);opacity:.9}
  100%{transform:scale(1.1);opacity:0}
}

.ups-popup{
  width:260px;
  background:rgba(15,23,42,.92);
  border:1px solid rgba(255,255,255,.10);
  border-left:4px solid var(--accent,#38bdf8);
  border-radius:16px;
  box-shadow:0 18px 48px rgba(0,0,0,.35);
  backdrop-filter:blur(8px);
  overflow:hidden;
}
.ups-popup__head{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
}
.ups-popup__ico{
  width:38px;
  height:38px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 0 0 2px rgba(0,0,0,.10) inset, 0 0 0 1px var(--accent,#38bdf8) inset;
  display:grid;
  place-items:center;
  flex:0 0 auto;
}
.ups-popup__ico img{
  width:26px;
  height:26px;
  image-rendering:auto;
}
.ups-popup__t1{
  font-weight:900;
  letter-spacing:.2px;
  display:flex;
  align-items:center;
  gap:8px;
}
.ups-popup__t2{
  font-size:12px;
  color:rgba(255,255,255,.78);
  margin-top:2px;
  text-transform:capitalize;
}
.ups-pill{
  font-size:11px;
  font-weight:800;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
}

/* Upschi 3D layer */
.upschi3d-layer{
  position:absolute;
  left:16px;
  bottom:16px;
  width:220px;
  height:220px;
  z-index:50;
  pointer-events:none;
  will-change:transform;
  background:radial-gradient(circle at 30% 20%, rgba(255,255,255,.10), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.12);
  border-radius:28px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
  backdrop-filter:blur(6px);
}
.upschi3d-layer canvas{
  width:100%;
  height:100%;
  display:block;
  pointer-events:none;
}

/* 3D warning marker */
.warning3d{
  filter:drop-shadow(0 10px 18px rgba(0,0,0,.35));
}
.warning3d model-viewer{pointer-events:none}
.warning3d canvas{border-radius:16px}
.warning3d .w3d-ph{
  width:76px;
  height:76px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.10);
  font-size:22px;
  color:#fff;
}

/* Quick filters */
.quick-filters{
  margin:10px 0 14px;
  padding:10px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
}
.qf-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin-bottom:8px;
}
.qf-row:last-child{margin-bottom:0}
.qf-label{
  font-size:12px;
  opacity:.85;
  min-width:46px;
}
.qf-chip{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:inherit;
  padding:7px 10px;
  border-radius:999px;
  cursor:pointer;
  font-size:12px;
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
}
.qf-chip:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.05);
}
.qf-chip.is-on{
  background:rgba(138,92,255,.18);
  border-color:rgba(138,92,255,.40);
}

/* Poster-like HUD */
.hud{
  position:absolute;
  left:14px;
  top:14px;
  z-index:5;
  pointer-events:none;
}
.hud-card{
  pointer-events:auto;
  min-width:260px;
  max-width:360px;
  border-radius:22px;
  padding:14px 14px 12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(9,14,26,.62);
  backdrop-filter:blur(10px);
  box-shadow:0 20px 40px rgba(0,0,0,.35);
}
.hud-title{
  font-weight:950;
  letter-spacing:.2px;
}
.hud-stats{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.hud-stat{
  padding:8px 10px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  font-weight:900;
}
.hud-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.hud-foot{margin-top:8px}

/* Missions */
.mission{
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  padding:12px;
  background:rgba(255,255,255,.03);
  margin-bottom:10px;
}
.mission-head{
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:space-between;
}
.mission-title{font-weight:950}
.mission-reward{
  font-weight:900;
  opacity:.92;
  white-space:nowrap;
}
.mission-bar{
  height:10px;
  border-radius:99px;
  background:rgba(255,255,255,.08);
  overflow:hidden;
  margin-top:10px;
}
.mission-bar-fill{
  height:100%;
  background:linear-gradient(90deg, rgba(250,204,21,.85), rgba(56,189,248,.75));
  border-radius:99px;
}
.mission-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
}

/* Battle UI basic */
.battle-stage{
  border-radius:16px;
  padding:14px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  --shake:.6;
}
.battle-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.battle-side{
  flex:1;
  min-width:280px;
  padding:12px;
  border-radius:14px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.06);
}
.battle-name{
  font-weight:900;
  letter-spacing:.2px;
}
.battle-bar{
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.10);
  margin-top:6px;
}
.battle-bar__fill{
  height:100%;
  width:50%;
  background:rgba(34,197,94,.85);
  transition:width .22s ease;
}
.battle-sprite{
  height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top:10px;
  border-radius:12px;
  background:rgba(255,255,255,.04);
}
.battle-sprite img{
  max-height:110px;
  max-width:100%;
  image-rendering:pixelated;
}
.battle-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.battle-moves{
  flex:1;
  min-width:280px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}
.battle-move{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  cursor:pointer;
  font-weight:800;
}
.battle-move[disabled]{
  opacity:.45;
  cursor:not-allowed;
}
.battle-log{
  flex:1;
  min-width:280px;
  max-height:150px;
  overflow:auto;
  padding:10px;
  border-radius:12px;
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.08);
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12px;
}

/* Disable game mode bits */
body.no-game-mode .nav-item[data-tab="ach"],
body.no-game-mode .nav-item[data-tab="miss"],
body.no-game-mode .nav-item[data-tab="collection"],
body.no-game-mode .nav-item[data-tab="pvp"],
body.no-game-mode #powersSelector,
body.no-game-mode #battleOverlay,
body.no-game-mode #pvpOverlay{
  display:none !important;
}

/* Ad popup */
.ad-pop{
  position:fixed;
  left:14px;
  bottom:14px;
  z-index:9999;
  max-width:360px;
  border-radius:18px;
  padding:12px;
  background:rgba(15,23,42,.92);
  color:#fff;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 10px 35px rgba(0,0,0,.35);
}
.ad-pop__row{
  display:flex;
  gap:10px;
}
.ad-pop__img{
  width:72px;
  height:72px;
  border-radius:14px;
  overflow:hidden;
  background:rgba(255,255,255,.06);
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
}
.ad-pop__img img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.ad-pop__title{
  font-weight:900;
  line-height:1.1;
}
.ad-pop__meta{
  opacity:.85;
  font-size:12px;
  margin-top:2px;
}
.ad-pop__msg{
  opacity:.92;
  font-size:13px;
  margin-top:8px;
}
.ad-pop__actions{
  display:flex;
  gap:8px;
  margin-top:10px;
  flex-wrap:wrap;
}
.ad-pop__btn{
  border-radius:999px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.ad-pop__btn.primary{
  background:rgba(34,197,94,.22);
  border-color:rgba(34,197,94,.35);
}

/* Battle VFX */
@keyframes upsShake{
  0%{transform:translate3d(0,0,0)}
  20%{transform:translate3d(calc(var(--shake)*-6px),calc(var(--shake)*2px),0)}
  40%{transform:translate3d(calc(var(--shake)*6px),calc(var(--shake)*-2px),0)}
  60%{transform:translate3d(calc(var(--shake)*-4px),calc(var(--shake)*-1px),0)}
  80%{transform:translate3d(calc(var(--shake)*3px),calc(var(--shake)*1px),0)}
  100%{transform:translate3d(0,0,0)}
}
.battle-stage.battle-shake{animation:upsShake .34s ease-in-out}

@keyframes upsFlashEnemy{
  0%{box-shadow:0 0 0 rgba(239,68,68,0)}
  35%{box-shadow:0 0 0 4px rgba(239,68,68,.22), 0 0 18px rgba(239,68,68,.18)}
  100%{box-shadow:0 0 0 rgba(239,68,68,0)}
}
@keyframes upsFlashPlayer{
  0%{box-shadow:0 0 0 rgba(59,130,246,0)}
  35%{box-shadow:0 0 0 4px rgba(59,130,246,.22), 0 0 18px rgba(59,130,246,.18)}
  100%{box-shadow:0 0 0 rgba(59,130,246,0)}
}
.battle-stage.battle-hit-enemy{animation:upsFlashEnemy .28s ease-out}
.battle-stage.battle-hit-player{animation:upsFlashPlayer .28s ease-out}

/* Battle cinematic */
#battleOverlay.battle-overlay{
  position:fixed;
  inset:0;
  z-index:1200;
  display:block;
  background:transparent;
}
#battleOverlay[hidden]{display:none !important}

.battle-overlay__veil{
  display:none !important;
}

.battle-overlay__letterbox{
  display:none !important;
}
.battle-overlay__letterbox--top{top:0}
.battle-overlay__letterbox--bottom{
  bottom:0;
  transform:rotate(180deg);
}

.battle-stage--cinematic{
  position:relative;
  height:100vh;
  padding:20px 24px 18px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:transparent;
  border:none;
  border-radius:0;
  overflow:hidden;
}
.battle-stage--cinematic::before{
  content:none;
}
.battle-stage--cinematic.battle-entering .battle-top-hud,
.battle-stage--cinematic.battle-entering .battle-bottom-dock,
.battle-stage--cinematic.battle-entering .battle-scene-ui{
  animation:battleHudIn .6s ease both;
}
@keyframes battleHudIn{
  0%{opacity:0;transform:translateY(20px) scale(.985)}
  100%{opacity:1;transform:translateY(0) scale(1)}
}

body.battle-mode .sidebar,
body.battle-mode .topbar,
body.battle-mode #fabReport,
body.battle-mode #drawer,
body.battle-mode #incidentDrawer,
body.battle-mode #incidentBackdrop,
body.battle-mode #paymentOverlay,
body.battle-mode .hover-popup{
  opacity:0 !important;
  pointer-events:none !important;
}
body.battle-mode #map{
  opacity:.92;
  filter:saturate(1) contrast(1) brightness(.96);
}

.battle-top-hud,
.battle-bottom-dock,
.battle-log-panel,
.battle-scene-ui,
.battle-side-panel{
  position:relative;
  z-index:3;
}

.battle-top-hud{
  display:flex;
  gap:14px;
  align-items:flex-start;
  justify-content:space-between;
}

.battle-hud-card{
  min-width:min(320px, 36vw);
  max-width:min(390px, 40vw);
  padding:12px 14px;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(8,15,30,.78), rgba(8,15,30,.56));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 18px 40px rgba(0,0,0,.24);
  backdrop-filter:blur(8px);
}

.battle-hud-head,
.battle-player-panel__head,
.battle-command-panel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.battle-side-label{
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:rgba(255,255,255,.62);
  font-weight:800;
}

.battle-name--player{
  font-size:clamp(17px,2vw,24px);
}

.battle-meta-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin-top:8px;
  flex-wrap:wrap;
}

.battle-effects{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.battle-effect-chip,
.battle-energy-pill,
.battle-chip{
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:800;
  line-height:1;
}

.battle-effect-chip{
  padding:7px 10px;
  font-size:11px;
  letter-spacing:.03em;
  text-transform:uppercase;
}

.battle-energy-pill{
  padding:10px 12px;
  font-size:12px;
}

.battle-chip{
  padding:10px 12px;
  font-size:13px;
  cursor:pointer;
}
.battle-chip.ghost{background:rgba(0,0,0,.22)}
.battle-chip.success{
  background:rgba(34,197,94,.18);
  border-color:rgba(34,197,94,.30);
}

.battle-top-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  margin-left:auto;
}

.battle-scene-ui{
  min-height:44vh;
  display:grid;
  grid-template-columns:1fr minmax(120px, 16vw) 1fr;
  align-items:stretch;
  gap:10px;
  pointer-events:none;
}

.battle-fighter{
  display:flex;
  align-items:end;
  position:relative;
}
.battle-fighter--enemy{
  justify-content:flex-end;
  padding-right:min(12vw,180px);
  align-items:flex-start;
}
.battle-fighter--player{
  justify-content:flex-start;
  align-items:flex-end;
  padding-left:min(4vw,64px);
}

.battle-sprite--enemy{
  width:min(116px,10vw);
  min-width:88px;
  height:min(116px,12vh);
  border-radius:999px;
  background:radial-gradient(circle, rgba(255,255,255,.18), rgba(8,15,30,.08) 62%, transparent 70%);
  border:1px solid rgba(255,255,255,.10);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:none;
  opacity:.9;
}
.battle-sprite--enemy img{
  max-height:100%;
  max-width:100%;
  object-fit:contain;
  filter:drop-shadow(0 10px 30px rgba(0,0,0,.45));
}
.battle-sprite--enemy.is-empty{
  opacity:0;
  border-color:transparent;
  background:transparent;
}

.battle-player-ots{
  margin-bottom:3vh;
  padding:10px 14px;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(8,15,30,.04), rgba(8,15,30,.24));
  border:1px solid rgba(255,255,255,.05);
}
.battle-player-ots__kicker{
  font-size:10px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:rgba(255,255,255,.58);
  font-weight:800;
}
.battle-player-ots__sub{
  margin-top:6px;
  color:rgba(255,255,255,.72);
  font-size:12px;
}

.battle-center-copy{
  display:flex;
  justify-content:center;
  align-items:flex-end;
  padding-bottom:18px;
}

.battle-callout{
  max-width:320px;
  padding:12px 14px;
  text-align:center;
  border-radius:18px;
  background:rgba(8,15,30,.60);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.92);
  font-weight:700;
  box-shadow:0 12px 32px rgba(0,0,0,.22);
}
.battle-callout[hidden]{display:none !important}

.battle-bottom-dock{
  display:grid;
  grid-template-columns:minmax(240px, 18vw) 1fr;
  gap:10px;
  align-items:end;
}

.battle-player-panel,
.battle-command-panel{
  padding:12px 14px;
  border-radius:24px;
  background:linear-gradient(180deg, rgba(8,15,30,.72), rgba(8,15,30,.58));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 20px 44px rgba(0,0,0,.24);
  backdrop-filter:blur(10px);
}

.battle-command-title{
  font-size:16px;
  font-weight:900;
}

.battle-command-panel__actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.battle-command-quickrail{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}

.battle-quickrail__hint{
  font-size:11px;
  font-weight:700;
  color:rgba(255,255,255,.62);
  letter-spacing:.03em;
}

.battle-moves--dock{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:8px;
  margin-top:10px;
}

.battle-move{
  min-height:88px;
  text-align:left;
  padding:10px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.12);
  cursor:pointer;
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
  position:relative;
  overflow:hidden;
}
.battle-move:hover{
  transform:translateY(-2px);
  border-color:rgba(56,189,248,.36);
}
.battle-move[disabled]{
  opacity:.42;
  transform:none;
}

.battle-move__slot{
  position:absolute;
  top:10px;
  right:10px;
  min-width:24px;
  height:24px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(0,0,0,.24);
  border:1px solid rgba(255,255,255,.10);
  font-size:11px;
  font-weight:900;
}

.battle-move__head{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding-right:30px;
}

.battle-move__icon{
  width:34px;
  height:34px;
  border-radius:12px;
  background:rgba(255,255,255,.10);
  display:grid;
  place-items:center;
  font-size:18px;
  flex:0 0 34px;
}

.battle-move__titles{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.battle-move__name{
  font-weight:900;
  font-size:14px;
  display:block;
}

.battle-move__effectline{
  font-size:10px;
  color:rgba(255,255,255,.58);
  line-height:1.25;
}

.battle-move__meta{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  margin-top:8px;
  font-size:11px;
  color:rgba(255,255,255,.72);
  flex-wrap:wrap;
}

.battle-move__tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border-radius:999px;
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.08);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.battle-log-panel,
.battle-side-panel{
  position:absolute;
  right:16px;
  top:92px;
  width:min(360px, calc(100vw - 32px));
  max-height:min(50vh, 460px);
  padding:14px;
  border-radius:22px;
  background:rgba(8,15,30,.80);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 20px 50px rgba(0,0,0,.34);
  backdrop-filter:blur(12px);
}

.battle-log-panel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.battle-log{
  max-height:calc(50vh - 76px);
  overflow:auto;
  background:rgba(0,0,0,.20);
}

.battle-info-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.battle-info-card{
  padding:12px;
  border-radius:18px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
}

.battle-info-value{
  margin-top:6px;
  font-size:13px;
  line-height:1.35;
  color:rgba(255,255,255,.92);
  font-weight:700;
}

.battle-fighter-label{
  position:absolute;
  top:10vh;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(8,15,30,.40);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:none;
}

.battle-fighter-label__kicker{
  display:block;
  font-size:10px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(255,255,255,.56);
  margin-bottom:3px;
}

.battle-fighter-label--enemy{right:min(4vw,42px)}

.battle-move[data-kind='poison'],
.battle-move[data-kind='burn'],
.battle-move[data-kind='bleed']{
  border-color:rgba(248,113,113,.24);
}
.battle-move[data-kind='shield'],
.battle-move[data-kind='regen']{
  border-color:rgba(74,222,128,.24);
}
.battle-move[data-kind='electric'],
.battle-move[data-kind='stun']{
  border-color:rgba(251,191,36,.24);
}
.battle-move[data-kind='flood']{
  border-color:rgba(56,189,248,.24);
}

.battle-stage--cinematic[data-theme="flood"] .battle-bar__fill{
  background:linear-gradient(90deg, #38bdf8, #2563eb);
}
.battle-stage--cinematic[data-theme="electric"] .battle-bar__fill{
  background:linear-gradient(90deg, #fbbf24, #f59e0b);
}
.battle-stage--cinematic[data-theme="trash"] .battle-bar__fill{
  background:linear-gradient(90deg, #4ade80, #16a34a);
}
.battle-stage--cinematic[data-theme="pothole"] .battle-bar__fill,
.battle-stage--cinematic[data-theme="generic"] .battle-bar__fill{
  background:linear-gradient(90deg, #fb7185, #ef4444);
}
.battle-stage--cinematic[data-theme="signage"] .battle-bar__fill{
  background:linear-gradient(90deg, #c084fc, #8b5cf6);
}

/* Battle placeholders phase 3 */
.battle-placeholder-layer{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:1;
}

.battle-fighter-label,
.battle-sprite--enemy,
.battle-props,
.battle-avatar,
.battle-command-quickrail,
.battle-player-ots__sub{
  display:none !important;
}

.battle-player-panel{
  padding:10px 12px;
}

.battle-player-panel .battle-side-label{
  display:none;
}

.battle-player-panel .battle-meta-row{
  margin-top:6px;
}
.battle-parry-layer{
  position:absolute;
  inset:0;
  z-index:6;
  pointer-events:none;
}
.battle-parry-layer[hidden]{display:none !important}
.battle-parry-target{
  position:absolute;
  width:72px;
  height:72px;
  margin:-36px 0 0 -36px;
  border:none;
  border-radius:999px;
  background:radial-gradient(circle, rgba(250,204,21,.96), rgba(245,158,11,.94));
  box-shadow:0 12px 30px rgba(245,158,11,.26), 0 0 0 1px rgba(255,255,255,.28);
  color:#111827;
  font-weight:1000;
  letter-spacing:.12em;
  pointer-events:auto;
  cursor:pointer;
  animation:battleParryPulse .58s ease-in-out infinite;
}
.battle-parry-target__ring,
.battle-parry-target__core{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
}
.battle-parry-target__ring{
  border-radius:999px;
  border:2px solid rgba(255,255,255,.68);
  animation:battleParryRing .58s ease-out infinite;
}
.battle-parry-target__core{
  font-size:13px;
}
@keyframes battleParryPulse{
  0%,100%{transform:scale(.94)}
  50%{transform:scale(1.03)}
}
@keyframes battleParryRing{
  from{transform:scale(.7);opacity:.95}
  to{transform:scale(1.24);opacity:0}
}

.battle-floating{
  position:absolute;
  inset:0;
  overflow:hidden;
}

.battle-float{
  position:absolute;
  font-weight:900;
  letter-spacing:.02em;
  text-shadow:0 8px 24px rgba(0,0,0,.4);
  animation:battleFloatUp 1.4s ease-out forwards;
  opacity:0;
}
.battle-float--enemy{left:68%;top:38%}
.battle-float--player{left:22%;top:56%}
.battle-float--damage{
  color:#fca5a5;
  font-size:clamp(20px,2.8vw,34px);
}
.battle-float--heal{
  color:#86efac;
  font-size:clamp(18px,2.4vw,30px);
}
.battle-float--energy{
  color:#93c5fd;
  font-size:clamp(16px,2vw,24px);
}
.battle-float--status{
  color:#fde68a;
  font-size:clamp(16px,2vw,22px);
}

@keyframes battleFloatUp{
  0%{opacity:0;transform:translate3d(0,14px,0) scale(.92)}
  15%{opacity:1}
  100%{opacity:0;transform:translate3d(0,-64px,0) scale(1.08)}
}

.battle-avatar{
  position:absolute;
  bottom:14vh;
  width:min(120px,20vw);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  filter:drop-shadow(0 18px 40px rgba(0,0,0,.35));
  transition:transform .22s ease, filter .22s ease;
  opacity:.18;
}
.battle-avatar--player{left:8vw}
.battle-avatar--enemy{
  right:11vw;
  bottom:28vh;
}

.battle-avatar__glow{
  position:absolute;
  inset:auto 0 16px 0;
  height:24px;
  border-radius:999px;
  background:radial-gradient(circle, rgba(56,189,248,.42), transparent 72%);
  filter:blur(10px);
}
.battle-avatar__core{
  position:relative;
  width:min(92px,14vw);
  height:min(92px,14vw);
  min-width:72px;
  min-height:72px;
  border-radius:28px;
  display:grid;
  place-items:center;
  font-size:clamp(34px,4vw,52px);
  background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.18);
  backdrop-filter:blur(8px);
  opacity:.55;
}
.battle-avatar__plate{
  position:relative;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(8,15,30,.66);
  border:1px solid rgba(255,255,255,.12);
  font-weight:800;
  font-size:12px;
  opacity:.0;
}

.battle-avatar.is-cast{animation:battleAvatarCast .5s ease}
.battle-avatar.is-hit{animation:battleAvatarHit .4s ease}
.battle-avatar.is-attack{animation:battleAvatarAttack .5s ease}

@keyframes battleAvatarCast{
  0%{transform:translateY(0) scale(1)}
  35%{transform:translateY(-8px) scale(1.06)}
  100%{transform:translateY(0) scale(1)}
}
@keyframes battleAvatarHit{
  0%{transform:translateX(0)}
  25%{transform:translateX(-8px)}
  55%{transform:translateX(10px)}
  100%{transform:translateX(0)}
}
@keyframes battleAvatarAttack{
  0%{transform:translate3d(0,0,0)}
  35%{transform:translate3d(14px,-10px,0) scale(1.06)}
  100%{transform:translate3d(0,0,0)}
}

.battle-intro{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
  background:radial-gradient(circle at center, rgba(8,15,30,.18), rgba(8,15,30,.64));
  backdrop-filter:blur(4px);
  z-index:1;
  pointer-events:none;
}
.battle-intro[hidden]{display:none !important}
.battle-intro__badge{
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.16);
  font-size:12px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.battle-intro__title{
  margin-top:16px;
  font-size:clamp(24px,4vw,42px);
  font-weight:1000;
  text-shadow:0 10px 30px rgba(0,0,0,.38);
}
.battle-intro__subtitle{
  margin-top:8px;
  color:rgba(255,255,255,.76);
  font-weight:700;
}
.battle-intro--out{animation:battleIntroOut .4s ease forwards}

@keyframes battleIntroOut{
  to{opacity:0;transform:scale(1.04)}
}

.battle-props{
  position:absolute;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  max-width:min(280px,32vw);
}
.battle-props--enemy{
  top:24vh;
  right:16px;
  justify-content:flex-end;
}
.battle-props--player{
  bottom:27vh;
  left:16px;
}

.battle-prop-chip{
  padding:8px 10px;
  border-radius:999px;
  background:rgba(8,15,30,.56);
  border:1px solid rgba(255,255,255,.12);
  font-size:12px;
  font-weight:800;
  color:rgba(255,255,255,.9);
  backdrop-filter:blur(8px);
}

.battle-stage--cinematic[data-theme="flood"] .battle-avatar__glow{
  background:radial-gradient(circle, rgba(56,189,248,.45), transparent 72%);
}
.battle-stage--cinematic[data-theme="electric"] .battle-avatar__glow{
  background:radial-gradient(circle, rgba(251,191,36,.48), transparent 72%);
}
.battle-stage--cinematic[data-theme="trash"] .battle-avatar__glow{
  background:radial-gradient(circle, rgba(74,222,128,.42), transparent 72%);
}
.battle-stage--cinematic[data-theme="pothole"] .battle-avatar__glow,
.battle-stage--cinematic[data-theme="generic"] .battle-avatar__glow{
  background:radial-gradient(circle, rgba(251,113,133,.42), transparent 72%);
}
.battle-stage--cinematic[data-theme="signage"] .battle-avatar__glow{
  background:radial-gradient(circle, rgba(192,132,252,.42), transparent 72%);
}

.maplibregl-ctrl-bottom-right{display:none}

/* Responsive */
@media (max-width: 980px){
  #btnSidebarToggle{display:block !important}
  #btnMenuTop{display:inline-flex !important}

  .drawer--incident{
    left:14px;
    right:14px;
    width:auto;
    top:74px;
  }

  .app{grid-template-columns:1fr}

  #btnMenu{display:inline-flex}

  .sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:320px;
    max-width:86vw;
    z-index:9999;
    transform:translateX(-105%);
    transition:transform .18s ease;
    display:flex;
  }
  .sidebar.open{transform:translateX(0)}

  .content{min-height:calc(100vh - 56px)}

  .drawer{
    left:14px;
    right:14px;
    width:auto;
  }

  .modal-card{width:94vw}
  .rank-grid{grid-template-columns:1fr}

  .hud{
    left:10px;
    right:10px;
    top:10px;
  }
  .hud-card{
    max-width:unset;
    width:calc(100vw - 20px);
  }

  .battle-stage--cinematic{
    padding:10px 10px calc(env(safe-area-inset-bottom, 0px) + 10px);
    display:grid;
    grid-template-rows:auto 1fr auto;
    gap:8px;
  }
  .battle-top-hud{
    display:grid;
    grid-template-columns:1fr;
    align-items:stretch;
    gap:6px;
  }
  .battle-hud-card{
    min-width:0;
    max-width:none;
    padding:10px 10px;
    border-radius:18px;
  }
  .battle-hud-head{
    gap:8px;
    align-items:flex-start;
  }
  .battle-hud-card .battle-meta-row{
    gap:8px;
    flex-wrap:wrap;
  }
  .battle-hud-card .battle-effects{
    gap:4px;
  }
  .battle-hud-card .battle-effect-chip{
    padding:5px 7px;
    font-size:10px;
  }
  .battle-top-actions{
    justify-content:flex-start;
    gap:6px;
    overflow:auto;
    padding-bottom:2px;
    scrollbar-width:none;
  }
  .battle-top-actions .battle-chip{
    padding:8px 10px;
    font-size:12px;
    flex:0 0 auto;
  }
  #battleInfoToggle{
    display:none;
  }
  .battle-scene-ui{
    grid-template-columns:1fr;
    min-height:14vh;
    gap:4px;
    align-items:center;
  }
  .battle-fighter--enemy,
  .battle-fighter--player{
    padding:0;
    justify-content:center;
  }
  .battle-fighter--player{
    display:flex;
    justify-content:flex-start;
    align-items:flex-end;
  }
  .battle-center-copy{
    order:-1;
    align-items:flex-start;
    padding-bottom:0;
  }
  .battle-callout{
    display:none;
  }
  .battle-fighter-label{
    position:static;
    margin-bottom:8px;
  }
  .battle-sprite--enemy{
    width:92px;
    min-width:92px;
    height:92px;
  }
  .battle-player-ots{
    min-width:0;
    width:auto;
    max-width:86vw;
    margin:0 0 4px 0;
    padding:10px 12px;
  }
  .battle-bottom-dock{
    grid-template-columns:1fr;
    gap:6px;
    position:sticky;
    bottom:0;
    z-index:4;
  }
  .battle-player-panel{order:1}
  .battle-command-panel{order:2}
  .battle-moves--dock{
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:6px;
  }
  .battle-move{
    min-height:76px;
    padding:8px;
    border-radius:14px;
  }
  .battle-move__head{
    gap:7px;
    padding-right:22px;
  }
  .battle-move__icon{
    width:28px;
    height:28px;
    flex-basis:28px;
    border-radius:10px;
    font-size:15px;
  }
  .battle-move__name{
    font-size:12px;
  }
  .battle-move__effectline{
    font-size:10px;
  }
  .battle-move__meta{
    margin-top:6px;
    font-size:10px;
  }
  .battle-command-panel,
  .battle-player-panel{
    padding:10px;
    border-radius:18px;
    background:rgba(8,15,30,.94);
    box-shadow:0 10px 24px rgba(0,0,0,.24);
  }
  .battle-player-panel__head{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
  }
  .battle-player-panel .battle-side-label{
    display:none;
  }
  .battle-player-panel .battle-meta-row{
    margin-top:6px;
    gap:6px;
  }
  .battle-player-panel .battle-effects{
    display:none;
  }
  .battle-command-panel__head{
    align-items:flex-start;
  }
  .battle-command-panel__head > div:first-child .battle-side-label{
    display:none;
  }
  .battle-command-title{
    font-size:14px;
  }
  .battle-quickrail__hint{
    font-size:10px;
  }
  .battle-command-quickrail{
    margin-top:8px;
  }
  .battle-command-quickrail .battle-quickrail__hint:first-child{
    display:none;
  }
  .battle-log-panel__head,
  .battle-player-panel__head{
    gap:8px;
  }
  .battle-player-panel__head{
    align-items:flex-start;
  }
  .battle-side-label{
    font-size:10px;
  }
  .battle-name{
    font-size:16px;
  }
  .battle-log-panel,
  .battle-side-panel{
    left:0;
    right:0;
    top:auto;
    bottom:0;
    width:auto;
    max-height:min(62vh, 520px);
    border-radius:24px 24px 0 0;
    padding:14px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
    background:rgba(8,15,30,.96);
  }
  .battle-log{
    max-height:calc(62vh - 86px);
  }

  .battle-avatar{
    bottom:18vh;
    width:88px;
  }
  .battle-avatar--player{left:12px}
  .battle-avatar--enemy{
    right:12px;
    bottom:28vh;
  }
  .battle-props{
    max-width:44vw;
    gap:8px;
  }
  .battle-props--enemy{top:12vh}
  .battle-props--player{bottom:32vh}
  .battle-float--enemy{
    left:62%;
    top:34%;
  }
  .battle-float--player{
    left:16%;
    top:60%;
  }
}

@media (max-width: 760px){


  body:not(.me-page) #me-tabs{height: 50vh;
    position: absolute;
    top: 50vh;
    min-width: 100%;
    margin: 0 !important;
  }

  #btnLogout{display:none;}
  .grid2{grid-template-columns:1fr}
  .modal-card.wide{max-width:96vw}

  .topbar{
    padding:10px 10px;
    gap:10px;
  }
  .topbar-left{gap:10px}
  .topbar-left .chip:not(#btnMenuTop):not(#btnMyLocTop):not(#chipZoom){
    display:none !important;
  }
  .topbar-right form{margin-left:auto}

  .fab{
    bottom:16px;
    right:16px;
    z-index:30;
  }
}

@media (max-width: 560px){
  .battle-overlay__letterbox{
    display:none;
  }
  .battle-stage--cinematic{
    padding:8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
    gap:4px;
  }
  .battle-top-hud{
    gap:4px;
  }
  .battle-hud-card{
    padding:8px 9px;
    border-radius:16px;
  }
  .battle-hud-card .battle-effects{
    display:none;
  }
  .battle-chip,
  .battle-energy-pill{
    padding:7px 8px;
    font-size:10px;
  }

  .battle-name{font-size:15px}
  .battle-command-title{font-size:13px}
  .battle-meta-row{
    gap:4px;
  }
  .battle-effect-chip{
    padding:6px 8px;
    font-size:10px;
  }
  .battle-move__name{font-size:11px}
  .battle-move__meta{
    font-size:9px;
    margin-top:5px;
  }
  .battle-move__icon{
    width:24px;
    height:24px;
    flex-basis:24px;
    font-size:13px;
  }
  .battle-command-panel__actions{
    gap:4px;
  }
  .battle-command-quickrail{
    justify-content:flex-end;
    gap:4px;
    margin-top:6px;
  }
  .battle-quickrail__hint{
    font-size:9px;
  }
  .battle-sprite--enemy{
    width:74px;
    min-width:74px;
    height:74px;
    border-radius:999px;
  }
  .battle-callout{
    display:none;
  }
  .battle-player-panel{
    padding:8px 9px;
  }
  .battle-command-panel{
    padding:8px 9px;
  }
  .battle-player-ots__sub,
  #battleSceneHint{
    display:none;
  }
  .battle-moves--dock{
    grid-template-columns:1fr 1fr;
    gap:5px;
  }
  .battle-move{
    min-height:70px;
    padding:7px;
  }
  .battle-move__tag{
    padding:5px 7px;
    font-size:10px;
  }
  .battle-move__effectline{
    display:none;
  }
  .battle-player-panel .battle-meta-row{
    margin-top:4px;
  }
  .battle-player-panel .battle-name{
    font-size:14px;
  }
  .battle-log-panel,
  .battle-side-panel{
    max-height:68vh;
    padding:12px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
  }

  .battle-avatar{display:none}
  .battle-props{
    display:none;
  }
  .battle-parry-target{
    width:64px;
    height:64px;
    margin:-32px 0 0 -32px;
  }
  .battle-parry-target__core{
    font-size:12px;
  }
  .battle-prop-chip{
    font-size:11px;
    padding:7px 9px;
  }

  .drawer{
    left:14px;
    right:14px;
    width:auto;
    top:auto;
    bottom:14px;
    max-height:42vh;
    height:auto;
  }
}

/* Sidebar collapsed */
.app.sidebar-collapsed{
  grid-template-columns:88px 1fr;
}

.sidebar.collapsed{
  width:88px;
  padding:10px;
  gap:10px;
}

.sidebar.collapsed .titles,
.sidebar.collapsed .label,
.sidebar.collapsed .footer,
.sidebar.collapsed .field,
.sidebar.collapsed .info,
.sidebar.collapsed select,
.sidebar.collapsed .btn-text,
.sidebar.collapsed .lbl,
.sidebar.collapsed .filters,
.sidebar.collapsed .section-title,
.sidebar.collapsed .section-sub{
  display:none !important;
}

.sidebar.collapsed .brand{
  gap:8px;
  justify-content:center;
}

.sidebar.collapsed .panel{
  padding:10px;
}

.sidebar.collapsed .panel-title{
  justify-content:center;
  margin-bottom:0;
}
.sidebar.collapsed .panel-title .caret{display:none}

.sidebar.collapsed .nav{
  flex-direction:column;
  justify-content:center;
  gap:10px;
}

.sidebar.collapsed .nav-item{
  padding:10px 0;
}

.sidebar.collapsed .actions-grid{
  grid-template-columns:1fr;
}

.sidebar.collapsed .actions-grid .ico,
.sidebar.collapsed .chip .ico{
  margin:0 !important;
}

.sidebar.collapsed .chip,
.sidebar.collapsed .chip-btn{
  padding:12px 0;
  text-align:center;
}

#btnMenu{
  display:none;
  align-items:center;
  justify-content:center;
  min-width:38px;
}
#btnMenuTop{display:none}
.battle-placeholder-layer{position:absolute;inset:0;z-index:1;pointer-events:none;}
.inc-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}

.inc-kv{
  padding:14px 14px 12px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.035);
}

.inc-kv .k{
  font-size:12px;
  color:rgba(255,255,255,.56);
}

.inc-kv .v{
  margin-top:8px;
  font-size:17px;
  font-weight:900;
}

.inc-desc{
  padding:2px 0 4px;
  color:rgba(255,255,255,.92);
  line-height:1.55;
  font-size:16px;
}

.inc-dock{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:10px;
  margin:14px 0 4px;
}

.inc-dock-btn{
  display:grid;
  gap:8px;
  place-items:center;
  min-height:78px;
  padding:10px 8px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.035);
  color:#eef4ff;
  cursor:pointer;
  transition:transform .12s ease, border-color .12s ease, background .12s ease;
}

.inc-dock-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
}

.inc-dock-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  transform:none;
}

.inc-dock-btn__ico{
  font-size:22px;
  line-height:1;
}

.inc-dock-btn__lbl{
  font-size:11px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
  text-align:center;
}

.inc-action-block{
  margin-top:14px;
  padding:14px;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.028);
}

.inc-action-block--staff{
  border-color:rgba(250,204,21,.14);
  background:linear-gradient(180deg, rgba(250,204,21,.06), rgba(255,255,255,.02));
}

.inc-block-title{
  margin-bottom:10px;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(255,255,255,.62);
}

.inc-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.inc-actions .btn{
  min-height:52px;
  justify-content:center;
  font-size:16px;
  font-weight:900;
  border-radius:18px;
}

#incHint,
#incCleanupMeta{
  margin-top:12px;
  line-height:1.45;
}

@media (max-width: 980px){
  .drawer--incident{
    left:0;
    right:0;
    top:auto;
    bottom:0;
    width:100%;
    max-height:calc(100vh - 92px);
    border-radius:24px 24px 0 0;
    border-left:none;
    border-right:none;
    border-bottom:none;
    margin:0;
    padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .drawer--incident .drawer-body{
    padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 18px);
  }

  .inc-grid{
    grid-template-columns:1fr;
  }

  .inc-dock{
    grid-template-columns:repeat(4, minmax(0,1fr));
    gap:8px;
    margin-bottom:6px;
  }

  body:not(.is-staff) #incDockApprove,
  body:not(.is-staff) #incDockReject,
  body:not(.is-staff) #incDockResolve,
  body:not(.is-staff) #incDockDuplicate{
    display:none !important;
  }

  .inc-dock-btn{
    min-height:72px;
    padding:10px 6px;
    border-radius:16px;
  }

  .inc-dock-btn__ico{
    font-size:20px;
  }

  .inc-dock-btn__lbl{
    font-size:10px;
    letter-spacing:.04em;
  }

  .inc-action-block{
    margin-top:10px;
    padding:12px;
    border-radius:18px;
  }

  body:not(.is-staff) .inc-action-block--staff{
    display:none;
  }

  .inc-action-block:not(:first-of-type){
    display:none;
  }
}

@media (min-width: 981px){
  .inc-action-block{
    display:none;
  }
}
