:root{
  --bg:#071018;
  --bg2:#0b1a25;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --line: rgba(255,255,255,0.10);
  --text: #e8f0ff;
  --muted: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.70));
  --accent:#64b5ff;
  --shadow: 0 12px 32px rgba(0,0,0,0.45);
  --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 600px at 30% 20%, rgba(var(--accent-rgb,100,181,255),0.10), transparent),
              radial-gradient(800px 500px at 70% 80%, rgba(120,255,210,0.06), transparent),
              var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration:none; }

.shell{
  display:grid;
  grid-template-columns: 220px 1fr;
  height:100vh;
  transition: grid-template-columns .25s cubic-bezier(.4,0,.2,1);
}
.shell.nav-collapsed{
  grid-template-columns: 52px 1fr;
}

/* Hamburger button */
.nav-hamburger{
  display:flex;
  flex-direction:column;
  gap:5px;
  background:none;
  border:none;
  cursor:pointer;
  padding:7px 5px;
  border-radius:8px;
  align-self:flex-start;
  flex-shrink:0;
}
.nav-hamburger:hover{ background:rgba(255,255,255,0.08); }
.nav-hamburger span{
  display:block;
  width:18px;
  height:2px;
  background:var(--muted);
  border-radius:2px;
  transition:background .15s;
}
.nav-hamburger:hover span{ background:var(--text); }

/* Ensure nav-item shows icon+label inline */
.nav-item{
  display:flex;
  align-items:center;
  gap:9px;
  white-space:nowrap;
  overflow:hidden;
}
.nav-item svg{ flex-shrink:0; opacity:.7; }

.nav{
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  overflow: hidden;
  transition: padding .25s cubic-bezier(.4,0,.2,1), width .25s;
  min-width: 0;
  width: 100%;
}

/* ── Collapsed nav ── */
.nav-collapsed .nav-label{
  opacity:0;
  pointer-events:none;
  width:0;
  overflow:hidden;
  display:inline-block;
}
.nav-collapsed .brand-sub{ display:none; }
.nav-collapsed .brand-title{ font-size:10px; letter-spacing:1px; text-align:center; }
.nav-collapsed .brand{ padding:7px 4px; text-align:center; }
.nav-collapsed .world-selector{ display:none; }
.nav-collapsed .nav-section-label{ opacity:0; height:0; overflow:hidden; padding:0; margin:0; }
.nav-collapsed .nav-divider{ margin:3px 0; }
.nav-collapsed .nav-item{
  justify-content:center;
  padding:9px 0;
  gap:0;
}
.nav-collapsed .nav-foot{ display:none; }
.nav-collapsed > aside.nav{
  padding:10px 4px;
  align-items:center;
}
.nav-collapsed .nav-hamburger{
  align-self:center;
  margin-bottom:0;
}

.brand{
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow);
}
.brand-title{
  font-weight: 800;
  letter-spacing: 2px;
}
.brand-sub{
  font-size: 12px;
  color: var(--muted);
}

.nav-item{
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
}
.nav-item:hover{
  border-color: var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.nav-item:hover svg{
  opacity: 1;
}
.nav-item.active{
  border-color: rgba(var(--accent-rgb,100,181,255),0.35);
  background: rgba(var(--accent-rgb,100,181,255),0.10);
  color: #8ccaff;
}
.nav-item.active svg{
  opacity: 1;
}

.nav-foot{
  margin-top:auto;
  padding: 8px 10px;
  font-size: 12px;
}

/* World Selector */
.world-selector{
  padding: 0 4px;
  margin-bottom: 8px;
}
.world-select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.30);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.world-select:hover{
  border-color: rgba(var(--accent-rgb,100,181,255),0.25);
  background: rgba(0,0,0,0.40);
}
.world-select:focus{
  outline: none;
  border-color: rgba(var(--accent-rgb,100,181,255),0.45);
  background: rgba(0,0,0,0.45);
}

/* Navigation dividers and sections */
.nav-divider{
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}
.nav-section-label{
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.35));
  text-transform: uppercase;
}

/* Enhanced nav items with icons */
.nav-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: all .15s;
}
.nav-item svg{
  opacity: 0.6;
  flex-shrink: 0;
  transition: opacity .15s;
}

.main{
  padding: 22px;
  overflow:auto;
}

.page{ max-width: 1200px; margin: 0 auto; }
.page-top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 14px;
}
h1{ margin:0; font-size: 30px; }
h2{ margin:0 0 10px 0; font-size: 18px; }
h3{ margin:0 0 10px 0; font-size: 16px; }

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

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 1100px){
  .shell{ grid-template-columns: 1fr; }
  .nav{ display:none; }
  .grid2{ grid-template-columns: 1fr; }
}

.form{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.native-map-page{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.native-map-top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
}
.native-kicker{
  font-size:12px;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:#95b7c7;
}
.native-title{
  margin:4px 0 0;
}
.native-editor{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.native-toolbar,
.native-panel,
.native-stage-card{
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.09);
  border-radius:18px;
  box-shadow:var(--shadow);
}
.native-toolbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  flex-wrap:wrap;
}
.native-tool-group{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.native-tool-btn{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.03);
  color:var(--text);
  border-radius:12px;
  padding:9px 12px;
  cursor:pointer;
  font-weight:600;
}
.native-tool-btn:hover,
.native-tool-btn.active{
  border-color:rgba(var(--accent-rgb,100,181,255),0.40);
  background:rgba(var(--accent-rgb,100,181,255),0.12);
  color:#9fd1ff;
}
.native-inline-field{
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:12px;
  background:rgba(0,0,0,0.22);
  border:1px solid rgba(255,255,255,0.08);
  color:var(--muted);
}
.native-inline-field select,
.native-inline-field input{
  margin:0;
}
.native-toolbar-status{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:13px;
}
.native-workspace{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 340px;
  gap:14px;
  min-height:74vh;
}
.native-stage-card{
  position:relative;
  overflow:hidden;
  min-height:74vh;
  background:
    radial-gradient(circle at top left, rgba(160,214,227,0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(115,169,124,0.08), transparent 22%),
    #08131c;
}
#nativeCanvas{
  width:100%;
  height:100%;
  display:block;
  cursor:crosshair;
}
.native-stage-overlay{
  position:absolute;
  inset:14px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  pointer-events:none;
}
.native-hint,
.native-coords{
  padding:8px 10px;
  border-radius:999px;
  background:rgba(4,10,16,0.58);
  border:1px solid rgba(255,255,255,0.08);
  color:var(--muted);
  font-size:12px;
  backdrop-filter:blur(10px);
}
.native-sidebar{
  display:flex;
  flex-direction:column;
  gap:0;
  height:74vh;
  overflow:hidden;
}
.native-sidebar-tabs{
  flex-shrink:0;
}
.native-sidebar-panel{
  flex:1;
  overflow-y:auto;
  overflow-x:hidden;
  display:none;
  padding:14px;
  scroll-behavior:smooth;
}
.native-sidebar-panel.active{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.native-panel{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.native-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.native-panel-head h2{
  margin:0 0 4px;
  font-size:17px;
}
.native-inspector-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.native-inspector-row{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.native-inspector-row.full{
  grid-column:1 / -1;
}
.native-inspector-row label{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
}
.native-inspector-row input,
.native-inspector-row select,
.native-inspector-row textarea{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(0,0,0,0.26);
  color:var(--text);
  padding:10px 12px;
}
.native-inspector-row textarea{
  min-height:72px;
  resize:vertical;
}
.native-inspector-empty{
  padding:14px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,0.12);
  color:var(--muted);
  line-height:1.5;
}
.native-coord-display{
  font-family:monospace;
  font-size:11px;
  color:var(--muted);
  padding:4px 8px;
  background:rgba(0,0,0,0.25);
  border-radius:6px;
  letter-spacing:0.02em;
}
.native-layer-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.native-layer-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(0,0,0,0.22);
  border:1px solid rgba(255,255,255,0.08);
}
.native-layer-meta{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.native-layer-title{
  font-weight:700;
}
.native-note-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.native-note-item{
  padding:10px 12px;
  border-radius:14px;
  background:rgba(0,0,0,0.22);
  border:1px solid rgba(255,255,255,0.08);
  color:var(--muted);
  line-height:1.45;
}
.native-search-results{
  display:flex;
  flex-direction:column;
  gap:6px;
  max-height:180px;
  overflow:auto;
}
.native-search-result{
  border:1px solid rgba(255,255,255,0.10);
  border-radius:12px;
  background:rgba(255,255,255,0.03);
  color:var(--text);
  padding:9px 10px;
  text-align:left;
  cursor:pointer;
}
.native-search-result:hover{
  border-color:rgba(var(--accent-rgb,100,181,255),0.4);
  background:rgba(var(--accent-rgb,100,181,255),0.10);
}
.native-linked-entry{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(var(--accent-rgb,100,181,255),0.18);
  background:rgba(var(--accent-rgb,100,181,255),0.08);
  color:var(--text);
  display:flex;
  flex-direction:column;
  gap:3px;
}
.native-linked-entry-name{
  font-weight:700;
  font-size:13px;
}
.native-linked-entry-type{
  font-size:11px;
  text-transform:capitalize;
}
.native-linked-entry-summary{
  font-size:11px;
  line-height:1.5;
  margin-top:2px;
}
.native-unlink-btn{
  margin-top:6px;
  align-self:flex-start;
  padding:3px 10px;
  border-radius:8px;
  border:1px solid rgba(255,100,100,0.3);
  background:rgba(255,100,100,0.1);
  color:rgba(255,140,140,1);
  font-size:11px;
  cursor:pointer;
}
.native-unlink-btn:hover{
  background:rgba(255,100,100,0.22);
}
/* ---- Icon picker ---- */
.native-icon-picker-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.native-icon-current-btn{
  width:44px;height:44px;
  border-radius:10px;
  border:2px solid rgba(200,185,123,0.5);
  background:rgba(220,210,180,0.90);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  flex-shrink:0;
}
.native-icon-current-btn:hover{ border-color:rgba(200,185,123,0.9); }
.native-icon-recents{ display:flex;gap:4px; }
.native-icon-recent-btn{
  width:36px;height:36px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(220,210,180,0.85);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  padding:2px;
}
.native-icon-recent-btn.active{ border-color:rgba(200,185,123,0.9);background:rgba(240,225,175,1); }
.native-icon-recent-btn:hover{ border-color:rgba(var(--accent-rgb,100,181,255),0.5);background:rgba(220,210,180,1); }
.native-icon-picker-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(74px,1fr));
  gap:6px;
  max-height:280px;
  overflow:auto;
  padding:4px 0;
}
.native-icon-picker-item{
  display:flex;flex-direction:column;align-items:center;
  padding:6px 4px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(220,210,180,0.92);
  cursor:pointer;
  transition:border-color 0.15s;
}
.native-icon-picker-item:hover{ border-color:rgba(var(--accent-rgb,100,181,255),0.45);background:rgba(220,210,180,1); }
.native-icon-picker-item.active{ border-color:rgba(200,185,123,0.9);background:rgba(240,225,175,1); }
.native-icon-picker-item span{ color:#22180b; }
.native-icon-picker-item img{ filter:none; }
.native-offset-btn{
  padding:0 8px;
  height:32px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:var(--text);
  font-size:16px;
  cursor:pointer;
  line-height:1;
}
.native-offset-btn:hover{ background:rgba(255,255,255,0.12); }
/* ---- Road texture picker ---- */
.native-texture-current-btn{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:10px;
  border:2px solid rgba(200,185,123,0.5);
  background:rgba(30,20,10,0.6);
  color:var(--text);
  cursor:pointer;
  font-size:12px;
  min-width:0;
}
.native-texture-current-btn:hover{ border-color:rgba(200,185,123,0.9); }
.native-texture-thumb-preview{
  width:100px;
  height:28px;
  border-radius:5px;
  background-size:auto 100%;
  background-repeat:repeat-x;
  border:1px solid rgba(255,255,255,0.12);
  flex-shrink:0;
}
.native-road-texture-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(120px,1fr));
  gap:6px;
  padding:4px 0;
}
.native-road-texture-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:6px 4px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(20,12,4,0.6);
  cursor:pointer;
  transition:border-color 0.15s;
}
.native-road-texture-item:hover{ border-color:rgba(var(--accent-rgb,100,181,255),0.45);background:rgba(30,18,8,0.8); }
.native-road-texture-item.active{ border-color:rgba(200,185,123,0.9);background:rgba(40,28,10,0.9); }
.native-road-texture-preview{
  width:100%;
  height:36px;
  border-radius:5px;
  background-size:auto 100%;
  background-repeat:repeat-x;
  border:1px solid rgba(255,255,255,0.10);
  background-color:rgba(180,160,120,0.25);
  display:flex;
  align-items:center;
  justify-content:center;
}
.native-road-texture-label{
  font-size:10px;
  color:var(--muted);
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}
.native-inspector-section-head{
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--muted);
  padding-top:8px;
  border-top:1px solid rgba(255,255,255,0.06);
  grid-column:1 / -1;
}
.native-command-color{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  color:var(--muted);
}
.native-command-color span{ white-space:nowrap; }
.native-command-color input[type="color"]{
  width:32px;
  height:28px;
  padding:2px;
  border-radius:6px;
  border:1px solid var(--line);
  background:none;
  cursor:pointer;
}
@media (max-width: 1200px){
  .native-workspace{
    grid-template-columns:1fr;
  }
  .native-stage-card{
    min-height:62vh;
  }
}
label{ font-size: 12px; color: var(--muted); }
input, textarea, select{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
}
textarea{ min-height: 120px; resize: vertical; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb,100,181,255),0.45);
  background: rgba(var(--accent-rgb,100,181,255),0.12);
  color: var(--text);
  cursor:pointer;
}
.btn:hover{ background: rgba(var(--accent-rgb,100,181,255),0.18); }
.btn.ghost{
  border-color: var(--line);
  background: rgba(255,255,255,0.04);
}
.btn.small{ padding: 6px 10px; border-radius: 10px; font-size: 12px; }

.row{ display:flex; gap:10px; align-items:center; }
.row.right{ justify-content:flex-end; }
.row-split{ display:flex; gap:10px; align-items:center; justify-content:space-between; }

.list{ display:flex; flex-direction:column; gap:8px; }
.list-row{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.list-row:hover{ background: rgba(255,255,255,0.05); }
.list-title{ font-weight: 700; }
.list-sub{ font-size: 12px; }

.kpi{ margin-top: 10px; }

.pill{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  font-size: 12px;
}

/* Play layout */
.play-shell{
  display:grid;
  grid-template-columns: 1fr 360px;
  gap: 12px;
}
@media (max-width: 1100px){
  .play-shell{ grid-template-columns: 1fr; }
}
.log{
  height: 520px;
  overflow:auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0,0,0,0.18);
}
.msg{
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
  background: rgba(255,255,255,0.03);
}
.msg.user{ border-color: rgba(var(--accent-rgb,100,181,255),0.35); }
.msg.assistant{ border-color: rgba(120,255,210,0.25); }
.msg-role{
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.composer{ margin-top: 10px; }
.composer textarea{ height: 110px; }

.play-side .card{ margin-bottom: 12px; }
.mini-map{
  height: 180px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(0,0,0,0.18);
}

/* Modal */
.modal{
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.55);
  padding: 18px;
}
.hidden{ display:none !important; }
.modal-card{
  width: min(900px, 96vw);
  background: rgba(8,18,26,0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.modal-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom: 10px;
}
.modal-title{ font-weight: 800; }

/* Leaflet tooltip look — see main rules below near the end */

/* fallback dot marker (when icon_key is poi.generic) */
.mg-dot-marker .mg-dot {
  border-radius: 999px;
  background: rgba(120,180,255,0.9);
  border: 2px solid rgba(10,14,18,0.55);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
/* Make <select> options readable in dark UI */
select, option { color: var(--text); }
select option { background: #0b0f14; color: var(--text); }
/* Make native form controls use dark dropdown styling where supported */
:root { color-scheme: dark; }

/* =========================
   Map Editor UI - Premium
   ========================= */
.map-page { height: calc(100vh - 40px); display:flex; flex-direction:column; gap:8px; }
.map-page-top { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.map-title { margin: 0; font-size: 22px; }

.map-editor-shell{
  flex:1;
  display:flex;
  flex-direction:column;
  border-radius:12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  overflow:hidden;
}

/* ===== TOOLBAR ===== */
.map-toolbar{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.18));
  flex-wrap: wrap;
}

.tb-icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px; height:30px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
  transition: background .15s, border-color .15s;
}
.tb-icon-btn:hover{ background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }

.tb-divider{
  width:1px;
  height:24px;
  background: rgba(255,255,255,0.08);
  margin: 0 2px;
}

.tb-group{
  display:flex;
  align-items:center;
  gap:4px;
  padding:3px 4px;
  border-radius:8px;
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.05);
}

.tb-btn{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.65));
  cursor:pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.tb-btn:hover{
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.tb-btn.active{
  background: rgba(var(--accent-rgb,100,181,255),0.15);
  border-color: rgba(var(--accent-rgb,100,181,255),0.35);
  color: #8ccaff;
}
.tb-btn svg{ flex-shrink:0; }

.tb-select{
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-size: 11px;
}

.tb-field{
  display:flex;
  align-items:center;
  gap:4px;
}
.tb-field label{
  font-size:10px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.5));
  margin:0;
  white-space:nowrap;
}
.tb-input-sm{
  width:44px;
  padding: 3px 5px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-size: 11px;
  text-align:center;
}
.tb-color{
  width:24px; height:24px;
  padding:0; border:none;
  border-radius:6px;
  cursor:pointer;
  background: transparent;
}
.tb-range{
  width:80px;
  accent-color: var(--accent);
}
.tb-val{
  font-size:10px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.5));
  min-width: 22px;
  text-align:right;
}

.tb-status{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
}
.tb-tool-label{
  font-size:11px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.5));
}

/* ===== BODY ===== */
.map-editor-body{
  flex:1;
  display:grid;
  grid-template-columns: 1fr 340px;
  min-height: 0;
}
.map-editor-body.panel-collapsed{ grid-template-columns: 1fr 0px; }

.map-canvas{ position:relative; background:#0a0e14; min-height: 0; }
#leafletMap{ width:100%; height:100%; }
.leaflet-container { background:#0a0e14 !important; }
.leaflet-container .leaflet-tile-pane{ background:#0a0e14 !important; }
.leaflet-container .leaflet-overlay-pane{ background: transparent; }
#leafletMap .leaflet-pane{ background: transparent; }
#leafletMap{ background:#0a0e14 !important; }

/* ===== SIDE PANEL ===== */
.map-panel{
  border-left: 1px solid rgba(255,255,255,0.06);
  background: rgba(4,8,14,0.92);
  overflow-y:auto;
  overflow-x:hidden;
  min-height:0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.map-panel::-webkit-scrollbar{ width:5px; }
.map-panel::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.12); border-radius:4px; }
.map-editor-body.panel-collapsed .map-panel{ display:none; }

.map-panel-head{
  position: sticky;
  top: 0;
  z-index: 10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  background: rgba(4,8,14,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
}

.panel-title{
  font-weight:700;
  font-size:13px;
  letter-spacing:0.3px;
}

/* Panel Tabs */
.panel-tabs{
  display:flex;
  gap:0;
  position:sticky;
  top:44px;
  z-index:9;
  background: rgba(4,8,14,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
}
.panel-tab{
  flex:1;
  padding: 8px 0;
  border:none;
  background: transparent;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.45));
  cursor:pointer;
  font-size:11px;
  font-weight:600;
  text-align:center;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.panel-tab:hover{ color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.7)); }
.panel-tab.active{
  color: #8ccaff;
  border-bottom-color: #64b5ff;
}

/* Panel Content */
.panel-content{ }

/* Inspector Section */
.insp-section{
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.insp-header{
  display:flex;
  align-items:center;
  gap:6px;
  padding: 10px 12px 6px;
  font-size:11px;
  font-weight:700;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.55));
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.insp-header svg{ opacity:0.6; }

.insp-form{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding: 4px 12px 12px;
}

.insp-row{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.insp-row > label{
  font-size:10px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.45));
  font-weight:500;
  margin:0;
}
.insp-row > input,
.insp-row > select,
.insp-row > textarea{
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.30);
  color: var(--text);
  font-size: 12px;
}
.insp-row > input:focus,
.insp-row > select:focus,
.insp-row > textarea:focus{
  border-color: rgba(var(--accent-rgb,100,181,255),0.35);
  outline: none;
}
.insp-row > input[type="range"]{
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--accent);
}
.insp-row > input[type="color"]{
  width: 100%;
  height: 28px;
  padding: 2px;
  cursor: pointer;
}

.insp-textarea{
  min-height: 48px;
  resize: vertical;
  font-size: 12px;
}

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

.insp-check{
  display:flex !important;
  align-items:center;
  gap:6px;
  font-size:11px !important;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.7)) !important;
  cursor:pointer;
  padding-top:4px;
}
.insp-check input[type="checkbox"]{
  width:14px; height:14px;
  accent-color: var(--accent);
  margin:0; padding:0;
  border-radius:3px;
}

.insp-icon-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.insp-actions{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:4px;
  flex-wrap:wrap;
}

.entry-ref-wrap{
  position:relative;
}

.entry-ref-results{
  position:absolute;
  top:calc(100% + 4px);
  left:0;
  right:0;
  max-height:220px;
  overflow:auto;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(8,18,26,0.98);
  box-shadow:0 18px 42px rgba(0,0,0,0.42);
  display:none;
  z-index:50;
}

.entry-ref-results.visible{
  display:block;
}

.entry-ref-option{
  padding:8px 10px;
  font-size:12px;
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-bottom:1px solid rgba(255,255,255,0.04);
}

.entry-ref-option:last-child{
  border-bottom:none;
}

.entry-ref-option:hover{
  background:rgba(var(--accent-rgb,100,181,255),0.08);
}

.mention-option-type{
  font-size:10px;
  color:rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.45));
  text-transform:uppercase;
  letter-spacing:0.5px;
}

/* Danger button */
.btn-danger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,100,100,0.25);
  background: rgba(255,60,60,0.08);
  color: rgba(255,140,140,0.9);
  cursor:pointer;
  font-size: 11px;
  transition: all .15s;
}
.btn-danger:hover{ background: rgba(255,60,60,0.18); border-color: rgba(255,100,100,0.4); }
.btn-danger:disabled{ opacity:0.3; cursor:default; }
.btn-danger:disabled:hover{ background: rgba(255,60,60,0.08); }

/* List section */
.panel-list-section{ padding: 8px; }
.panel-list-header{
  padding: 8px 4px;
  font-size:11px;
  font-weight:700;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.55));
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.mg-list{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.mg-list-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  cursor:pointer;
  transition: all .12s;
}
.mg-list-item:hover{ background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.10); }
.mg-list-item.mg-list-active{
  background: rgba(var(--accent-rgb,100,181,255),0.10);
  border-color: rgba(var(--accent-rgb,100,181,255),0.25);
}
.mg-list-title{ font-weight:600; font-size:12px; }
.mg-list-sub{ font-size:10px; opacity:.6; }

/* Selected marker highlight - stronger pulse */
.mg-selected-marker{
  filter: drop-shadow(0 0 12px rgba(120,180,255,1)) drop-shadow(0 0 24px rgba(100,160,255,0.6));
  animation: mg-select-pulse 1.5s ease-in-out infinite alternate;
}
@keyframes mg-select-pulse{
  0%  { filter: drop-shadow(0 0 10px rgba(120,180,255,0.9)) drop-shadow(0 0 20px rgba(100,160,255,0.4)); }
  100%{ filter: drop-shadow(0 0 16px rgba(120,180,255,1)) drop-shadow(0 0 32px rgba(100,160,255,0.7)); }
}

/* Selected path highlight glow */
.mg-selected-path{
  filter: drop-shadow(0 0 8px rgba(120,180,255,0.8));
}

/* Tooltip/labels — main rules below in "Leaflet tooltip reset" section */
.mg-label { white-space: pre-line; }

/* Dot marker div icon */
.mg-dot-marker .mg-dot{
  border-radius: 999px;
  background: rgba(120,180,255,0.95);
  border: 2px solid rgba(10,14,18,0.55);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

/* Pill status colors */
.pill-ok{ border-color: rgba(120,255,210,0.30) !important; }
.pill-warn{ border-color: rgba(255,220,120,0.35) !important; }
.pill-bad{ border-color: rgba(255,120,120,0.35) !important; }

/* Icon preview */
.icon-preview{
  width:28px; height:28px;
  border-radius:6px;
  opacity:.95;
  display:none;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
  object-fit:contain;
}

/* Icon popover */
.icon-popover{
  position:fixed;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 92vw;
  max-height: 480px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,18,26,0.96);
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
  z-index: 100;
}

.icon-popover-top{
  display:flex;
  gap:8px;
  padding:10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  align-items: center;
}

.icon-popover-top input{
  flex:1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.30);
  color: var(--text);
  font-size: 12px;
}

.icon-grid{
  padding:10px;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
  overflow:auto;
  max-height: 380px;
}

.icon-tile{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  color: inherit;
  text-align:center;
  transition: all .12s;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.icon-tile:hover{
  background: rgba(255,255,255,0.07);
  border-color: rgba(var(--accent-rgb,100,181,255),0.25);
}

.icon-tile-img{
  width: 36px;
  height: 36px;
  object-fit: contain;
  display:block;
  margin-bottom:4px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.40));
}

.icon-tile-label{
  font-size: 10px;
  opacity: 0.75;
}

.icon-tile-dot{
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(120,180,255,0.95);
  border: 2px solid rgba(10,14,18,0.55);
  margin-bottom: 4px;
}

.icon-tile-none{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.25);
  border: 1px dashed rgba(255,255,255,0.15);
  margin-bottom: 4px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
}

/* Selected icon tile in picker */
.icon-tile-selected{
  background: rgba(var(--accent-rgb,100,181,255),0.15) !important;
  border-color: rgba(var(--accent-rgb,100,181,255),0.45) !important;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb,100,181,255),0.25);
}

/* ===========================
   Cursor classes per tool mode
   =========================== */
.cursor-select{ cursor: default !important; }
.cursor-poi   { cursor: crosshair !important; }
.cursor-text  { cursor: text !important; }
.cursor-draw  { cursor: crosshair !important; }
.cursor-region{ cursor: crosshair !important; }
.cursor-grab  { cursor: grab !important; }
.cursor-grabbing{ cursor: grabbing !important; }

/* Override Leaflet's grab cursor when in tool modes */
.cursor-poi .leaflet-grab,
.cursor-text .leaflet-grab,
.cursor-draw .leaflet-grab,
.cursor-region .leaflet-grab{ cursor: crosshair !important; }
.cursor-grabbing .leaflet-grab,
.cursor-grabbing .leaflet-dragging{ cursor: grabbing !important; }

/* ===========================
   List item sub-elements
   =========================== */
.mg-list-icon{
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
  border-radius: 4px;
}

.mg-list-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(120,180,255,0.85);
  border: 2px solid rgba(10,14,18,0.45);
  flex-shrink: 0;
  margin: 0 7px;
}

.mg-list-swatch{
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
  margin: 0 5px;
}

.mg-list-info{
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mg-list-info .mg-list-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-list-info .mg-list-sub{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   Empty state (Properties tab)
   =========================== */
.insp-empty{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  text-align: center;
}

.insp-empty-icon{
  opacity: 0.35;
  margin-bottom: 4px;
}

.insp-empty-text{
  font-size: 13px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.50));
  line-height: 1.4;
  max-width: 260px;
}

.insp-empty-hint{
  font-size: 11px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.30));
  line-height: 1.6;
  margin-top: 4px;
}
.insp-empty-hint b{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 10px;
  font-weight: 700;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.55));
  margin: 0 1px;
  vertical-align: middle;
}

/* Invisible anchor marker for region labels (fixed position) */
.mg-region-anchor{
  width: 1px !important;
  height: 1px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

/* Empty icon marker (text-only, no visible icon) */
.mg-empty-icon{
  pointer-events: auto !important;
}
.mg-empty-icon .leaflet-marker-icon{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ===========================
   Custom Confirm Modal
   =========================== */
.mg-modal{
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-modal-backdrop{
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.mg-modal-card{
  position: relative;
  z-index: 1;
  width: min(380px, 92vw);
  background: linear-gradient(180deg, rgba(14,22,32,0.98), rgba(8,14,22,0.98));
  border: 1px solid rgba(255,120,120,0.20);
  border-radius: 16px;
  padding: 28px 24px 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.04);
  text-align: center;
  animation: mg-modal-pop 0.15s ease-out;
}

@keyframes mg-modal-pop{
  from{ opacity:0; transform: scale(0.95) translateY(8px); }
  to  { opacity:1; transform: scale(1) translateY(0); }
}

.mg-modal-icon{
  margin-bottom: 14px;
}

.mg-modal-title{
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,180,180,0.95);
  margin-bottom: 6px;
}

.mg-modal-body{
  font-size: 13px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.55));
  line-height: 1.4;
  margin-bottom: 20px;
}

.mg-modal-actions{
  display: flex;
  gap: 10px;
  justify-content: center;
}
.mg-modal-actions .btn{
  min-width: 90px;
}
.mg-modal-actions .btn-danger{
  min-width: 90px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ===========================
   Inspector sub-sections
   =========================== */
.insp-section-sub{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px 12px;
  margin: 4px 0 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-radius: 0 0 8px 8px;
  background: rgba(255,255,255,0.015);
}
.insp-sub-header{
  font-size: 10px;
  font-weight: 600;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.40));
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.insp-hint{
  font-size: 10px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.28));
  font-style: italic;
  margin-top: 4px;
  padding: 0 2px;
}

/* Draggable label cursor */
.mg-label-draggable{
  cursor: grab !important;
}
.mg-label-draggable:active{
  cursor: grabbing !important;
}

/* Leaflet tooltip reset: remove default white arrow/background */
.leaflet-tooltip.mg-tooltip{
  background: rgba(10, 14, 18, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 5px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.40);
  color: inherit;
}
.leaflet-tooltip.mg-label-nobg{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
/* Remove the default tooltip arrow for our labels */
.leaflet-tooltip.mg-tooltip::before{
  display: none;
}
.leaflet-tooltip.mg-label::before{
  display: none;
}

/* Region POI badge (visual indicator in sidebar list) */
.mg-list-item .mg-poi-badge{
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb,100,181,255),0.12);
  border: 1px solid rgba(var(--accent-rgb,100,181,255),0.25);
  color: #8ccaff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Leaflet zoom control - dark theme */
.leaflet-control-zoom a{
  background: rgba(10, 16, 24, 0.85) !important;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.7)) !important;
  border-color: rgba(255,255,255,0.08) !important;
  backdrop-filter: blur(8px);
}
.leaflet-control-zoom a:hover{
  background: rgba(20, 30, 44, 0.95) !important;
  color: var(--text) !important;
}

/* ===========================
   Icon Popover - make sure it's on top
   =========================== */
.icon-popover{
  z-index: 500;
}

/* ===========================
   Filter toggle in toolbar
   =========================== */
.tb-filter-check{
  display: flex !important;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.55));
  cursor: pointer;
  white-space: nowrap;
  padding: 3px 6px;
  border-radius: 6px;
  transition: all .15s;
}
.tb-filter-check:hover{
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.8));
  background: rgba(255,255,255,0.04);
}
.tb-filter-check input[type="checkbox"]{
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}

/* ===========================
   Offset stepper buttons
   =========================== */
.offset-stepper{
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.30);
  overflow: hidden;
}
.offset-stepper input{
  flex: 1;
  min-width: 0;
  width: 36px;
  padding: 5px 4px;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  text-align: center;
}
.offset-stepper input:focus{
  outline: none;
  background: rgba(var(--accent-rgb,100,181,255),0.06);
}
.offset-stepper-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.04);
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.55));
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all .12s;
  flex-shrink: 0;
}
.offset-stepper-btn:hover{
  background: rgba(var(--accent-rgb,100,181,255),0.15);
  color: #8ccaff;
}
.offset-stepper-btn:active{
  background: rgba(var(--accent-rgb,100,181,255),0.25);
}

/* ===========================
   Region group headers (collapsible sidebar)
   =========================== */
.mg-region-group{
  margin-bottom: 2px;
}
.mg-region-header{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .12s;
  user-select: none;
}
.mg-region-header:hover{
  background: rgba(255,255,255,0.04);
}
.mg-region-chevron{
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform .15s;
}
.mg-region-swatch{
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
}
.mg-region-name{
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.65));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-region-count{
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.4));
  flex-shrink: 0;
  font-weight: 600;
}
.mg-region-children{
  padding-left: 12px;
  border-left: 1px solid rgba(var(--accent-rgb,100,181,255),0.08);
  margin-left: 14px;
  margin-bottom: 4px;
}
.mg-orphan-header{
  cursor: default;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Kind subheaders in shapes sidebar (Roads, Trails, Rivers, etc.) */
.mg-kind-subheader{
  font-size: 9px;
  font-weight: 700;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.30));
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 6px 10px 2px;
  margin-top: 2px;
}

/* Undo/Redo disabled state */
.tb-btn:disabled{
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ===========================
   Parent region tag in lists
   =========================== */
.mg-parent-tag{
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(120,255,210,0.10);
  border: 1px solid rgba(120,255,210,0.20);
  color: rgba(120,255,210,0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ===========================
   Draw settings - show/hide context
   =========================== */
.tb-draw-settings{
  transition: opacity .2s, max-width .2s;
}

/* ===========================
   Tooltip interaction area
   =========================== */
.leaflet-tooltip.mg-tooltip{
  pointer-events: auto;
}

/* ===========================
   Smooth animations
   =========================== */
.insp-section{
  animation: mg-fade-in .15s ease-out;
}
@keyframes mg-fade-in{
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Inspector row compact input
   =========================== */
.insp-row > input[type="number"]{
  -moz-appearance: textfield;
}
.insp-row > input[type="number"]::-webkit-inner-spin-button,
.insp-row > input[type="number"]::-webkit-outer-spin-button{
  opacity: 1;
}

/* ===========================
   Map canvas border removal
   =========================== */
.map-canvas{
  outline: none;
  border: none;
}

/* ===========================
   Scrollbar for panel
   =========================== */
.map-panel{
  scrollbar-gutter: stable;
}

/* ===========================
   Better focus states
   =========================== */
.tb-btn:focus-visible,
.offset-stepper-btn:focus-visible{
  outline: 2px solid rgba(var(--accent-rgb,100,181,255),0.5);
  outline-offset: 1px;
}

/* ===========================
   Tooltip center direction fix
   =========================== */
.leaflet-tooltip-center{
  margin-left: 0 !important;
}

/* ===========================
   SVG curved text label styling
   =========================== */
.mg-label svg{
  overflow: visible;
  display: block;
}
.mg-label svg text{
  paint-order: stroke fill;
}

/* ===========================
   Premium toolbar polish
   =========================== */
.map-toolbar{
  background: linear-gradient(180deg, rgba(6,12,20,0.95), rgba(4,8,16,0.90));
  border-bottom: 1px solid rgba(var(--accent-rgb,100,181,255),0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.tb-group{
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.06);
  backdrop-filter: blur(4px);
}
.tb-btn.active{
  background: linear-gradient(180deg, rgba(var(--accent-rgb,100,181,255),0.18), rgba(var(--accent-rgb,100,181,255),0.12));
  border-color: rgba(var(--accent-rgb,100,181,255),0.40);
  box-shadow: 0 0 8px rgba(var(--accent-rgb,100,181,255),0.15);
}

/* ===========================
   Scrollbar for inspector
   =========================== */
.map-panel{
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb,100,181,255),0.15) transparent;
}
.map-panel::-webkit-scrollbar{ width: 5px; }
.map-panel::-webkit-scrollbar-thumb{
  background: rgba(var(--accent-rgb,100,181,255),0.15);
  border-radius: 4px;
}
.map-panel::-webkit-scrollbar-thumb:hover{
  background: rgba(var(--accent-rgb,100,181,255),0.25);
}

/* ===========================
   Inspector section hover
   =========================== */
.insp-section{
  transition: background .15s;
}
.insp-section:hover{
  background: rgba(255,255,255,0.01);
}

/* ===========================
   Save state badge polish
   =========================== */
.pill{
  transition: all .2s;
  font-size: 11px;
  font-weight: 600;
}
.pill-ok{
  animation: mg-saved-pulse .5s ease-out;
}
@keyframes mg-saved-pulse{
  0%  { box-shadow: 0 0 0 0 rgba(120,255,210,0.3); }
  100%{ box-shadow: 0 0 0 6px rgba(120,255,210,0.0); }
}

/* ===========================
   Compendium shared pills
   =========================== */
.cat-pill{
  font-size: 10px; padding: 2px 8px; border-radius: 6px;
  background: rgba(var(--accent-rgb,100,181,255),0.08); border: 1px solid rgba(var(--accent-rgb,100,181,255),0.15);
  color: #8ccaff; font-weight: 600; text-transform: capitalize;
}
.status-pill{ font-size: 10px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.status-canon{ background: rgba(120,255,210,0.08); border: 1px solid rgba(120,255,210,0.20); color: rgba(120,255,210,0.8); }
.status-draft{ background: rgba(255,220,120,0.08); border: 1px solid rgba(255,220,120,0.20); color: rgba(255,220,120,0.8); }
.status-needs_review{ background: rgba(255,160,100,0.08); border: 1px solid rgba(255,160,100,0.20); color: rgba(255,160,100,0.8); }

/* ===========================
   Global UX Polish (Phase 2)
   =========================== */

/* --- Consistent transitions on all interactive elements --- */
a, button, input, select, textarea,
.btn, .pill, .nav-item, .list-row,
.cat-pill, .status-pill, .tag-pill{
  transition: all .12s ease-out;
}

/* --- Global scrollbar styling (all scrollable containers) --- */
.main, .ed-main, .ed-sidebar, .comp-main, .comp-sidebar,
.log, .icon-grid, .mention-dropdown, .entry-ref-results{
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb,100,181,255),0.12) transparent;
}
.main::-webkit-scrollbar,
.ed-main::-webkit-scrollbar,
.ed-sidebar::-webkit-scrollbar,
.comp-main::-webkit-scrollbar,
.comp-sidebar::-webkit-scrollbar,
.log::-webkit-scrollbar,
.icon-grid::-webkit-scrollbar,
.mention-dropdown::-webkit-scrollbar,
.entry-ref-results::-webkit-scrollbar{
  width: 5px;
}
.main::-webkit-scrollbar-thumb,
.ed-main::-webkit-scrollbar-thumb,
.ed-sidebar::-webkit-scrollbar-thumb,
.comp-main::-webkit-scrollbar-thumb,
.comp-sidebar::-webkit-scrollbar-thumb,
.log::-webkit-scrollbar-thumb,
.icon-grid::-webkit-scrollbar-thumb,
.mention-dropdown::-webkit-scrollbar-thumb,
.entry-ref-results::-webkit-scrollbar-thumb{
  background: rgba(var(--accent-rgb,100,181,255),0.12);
  border-radius: 4px;
}
.main::-webkit-scrollbar-thumb:hover,
.ed-main::-webkit-scrollbar-thumb:hover,
.ed-sidebar::-webkit-scrollbar-thumb:hover,
.comp-main::-webkit-scrollbar-thumb:hover,
.comp-sidebar::-webkit-scrollbar-thumb:hover,
.log::-webkit-scrollbar-thumb:hover,
.icon-grid::-webkit-scrollbar-thumb:hover,
.mention-dropdown::-webkit-scrollbar-thumb:hover,
.entry-ref-results::-webkit-scrollbar-thumb:hover{
  background: rgba(var(--accent-rgb,100,181,255),0.22);
}

/* --- Uniform focus ring on inputs --- */
input:focus, select:focus, textarea:focus{
  border-color: rgba(var(--accent-rgb,100,181,255),0.35);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb,100,181,255),0.08);
}

/* --- Subtle hover lift on generic cards --- */
.card:hover{
  box-shadow: 0 14px 36px rgba(0,0,0,0.50), 0 0 0 1px rgba(var(--accent-rgb,100,181,255),0.06);
}

/* --- Button press feedback --- */
.btn:active{
  transform: scale(0.97);
}
.btn.ghost:active{
  transform: scale(0.97);
}


/* ═══════════════════════════════════════════════════════
   Inventory Enhancements
   ═══════════════════════════════════════════════════════ */

/* Legacy compact treasury — replaced by inv-stats-bar */
.inv-treasury-compact { display: none; }

.inv-treasury-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 215, 0, 0.9);
  white-space: nowrap;
}

.inv-treasury-coins-row {
  display: flex;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

.inv-coin-compact {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inv-coin-icon-sm {
  font-size: 14px;
  opacity: 0.7;
}

.inv-coin-input-sm {
  width: 60px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.inv-coin-input-sm:focus {
  outline: none;
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.inv-coin-unit {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.inv-coin-gp .inv-coin-icon-sm { color: #f0c040; }
.inv-coin-sp .inv-coin-icon-sm { color: #c0c8d0; }
.inv-coin-cp .inv-coin-icon-sm { color: #c87533; }

.inv-treasury-total-compact {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 215, 0, 0.95);
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

/* Enhanced Equipped Status */
.inv-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.inv-badge-equipped {
  background: rgba(100, 255, 181, 0.15);
  border: 1px solid rgba(100, 255, 181, 0.35);
  color: rgba(100, 255, 181, 1);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.inv-badge-2h {
  background: rgba(255, 160, 100, 0.12);
  border: 1px solid rgba(255, 160, 100, 0.25);
  color: rgba(255, 160, 100, 0.9);
}

.inv-badge-rarity {
  background: rgba(var(--accent-rgb,100,181,255), 0.12);
  border: 1px solid rgba(var(--accent-rgb,100,181,255), 0.25);
  color: rgba(var(--accent-rgb,100,181,255), 0.9);
}

.inv-item-row.is-equipped {
  background: linear-gradient(90deg, rgba(100, 255, 181, 0.06), rgba(100, 255, 181, 0.03));
  border-color: rgba(100, 255, 181, 0.25);
  box-shadow: inset 0 0 0 1px rgba(100, 255, 181, 0.08);
}

/* Item row click cursor */
.inv-item-main {
  cursor: pointer;
}

/* ── Item detail popup modal ── */
.inv-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.inv-popup-card {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-width: 100%;
  background: rgba(12, 18, 28, 0.98);
  border: 1px solid rgba(var(--accent-rgb,100,181,255), 0.30);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.85), 0 0 0 1px rgba(var(--accent-rgb,100,181,255),0.10);
  max-height: 90vh;
  overflow-y: auto;
}

.inv-popup-layout {
  display: flex;
  align-items: stretch;
  min-height: 420px;
}

.inv-popup-media-col {
  width: 44%;
  min-width: 240px;
  background: rgba(255,255,255,0.02);
}

.inv-popup-content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.inv-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  z-index: 1;
  border-radius: 4px;
}
.inv-popup-close:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.08);
}

/* Image */
.inv-popup-img-wrap {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.03);
  border-right: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
}
.inv-popup-img-photo .inv-popup-img {
  width: 100%; height: 100%; object-fit: cover;
}
.inv-popup-img-icon .inv-popup-img {
  width: 90px; height: 90px; object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7));
}

/* Name / type header */
.inv-popup-header {
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.inv-popup-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 3px;
}
.inv-popup-type {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.inv-popup-equipped-label {
  color: rgba(120, 255, 210, 0.85);
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0;
}

/* Stat rows */
.inv-popup-stats {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.inv-popup-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 3px 12px;
  gap: 10px;
}
.inv-popup-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.inv-popup-stat-val {
  font-size: 12px;
  font-weight: 600;
  color: rgba(var(--text-rgb,232,240,255),max(var(--theme-text-min-opacity,0),0.9));
  text-align: right;
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Stat bonus chips */
.inv-popup-bonuses {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.inv-popup-bonus-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(100, 255, 181, 0.12);
  border: 1px solid rgba(100, 255, 181, 0.30);
  color: rgba(100, 255, 181, 1);
}

/* Footer: value / weight / slots */
.inv-popup-footer {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.inv-popup-value {
  font-size: 12px;
  font-weight: 700;
}
.inv-popup-currency-gp { color: rgba(255,215,0,0.9); }
.inv-popup-currency-sp { color: rgba(192,200,210,0.9); }
.inv-popup-currency-cp { color: rgba(185,115,60,0.95); }
.inv-popup-currency-sep { color: var(--muted); }
.inv-popup-meta {
  font-size: 11px;
  color: var(--muted);
}

/* Equip section */
.inv-popup-equip-section {
  padding: 12px;
}
.inv-popup-equip-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inv-popup-equip-btn {
  flex-shrink: 0;
  background: rgba(var(--accent-rgb,100,181,255), 0.15);
  border: 1px solid rgba(var(--accent-rgb,100,181,255), 0.35);
  color: rgba(var(--accent-rgb,100,181,255), 1);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.inv-popup-equip-btn:hover {
  background: rgba(var(--accent-rgb,100,181,255), 0.25);
}
.inv-popup-unequip-btn {
  width: 100%;
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.35);
  color: rgba(255, 110, 110, 1);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.inv-popup-unequip-btn:hover {
  background: rgba(255, 90, 90, 0.22);
}

@media (max-width: 720px) {
  .inv-popup-card {
    width: min(420px, calc(100vw - 24px));
  }

  .inv-popup-layout {
    flex-direction: column;
    min-height: 0;
  }

  .inv-popup-media-col {
    width: 100%;
    min-width: 0;
  }

  .inv-popup-img-wrap {
    min-height: 220px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
}

/* ── Delete confirmation dialog ── */
.inv-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10100;
  padding: 16px;
}
.inv-confirm-card {
  background: rgba(14, 20, 32, 0.99);
  border: 1px solid rgba(255, 90, 90, 0.30);
  border-radius: 14px;
  padding: 28px 24px 22px;
  width: 300px;
  max-width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,80,80,0.12);
}
.inv-confirm-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.inv-confirm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.inv-confirm-msg {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.inv-confirm-msg strong {
  color: var(--text);
}
.inv-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.inv-confirm-cancel {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--muted);
  padding: 8px 20px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.inv-confirm-cancel:hover {
  background: rgba(255,255,255,0.13);
  color: var(--text);
}
.inv-confirm-delete {
  background: rgba(220, 50, 50, 0.18);
  border: 1px solid rgba(220, 50, 50, 0.45);
  color: rgba(255, 110, 110, 1);
  padding: 8px 20px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.inv-confirm-delete:hover {
  background: rgba(220, 50, 50, 0.32);
}

/* Legacy tooltip kept hidden (no hover) */
.inv-tt-icon-img {
  width: 18px; height: 18px;
  object-fit: contain; flex-shrink: 0;
  opacity: 0.7;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

/* Item Stat Pills */
.inv-item-stats {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.inv-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.inv-cap-unit-sm {
  font-size: 9px;
  opacity: 0.65;
  margin-left: 1px;
}

.inv-container-pill {
  background: rgba(120, 200, 255, 0.10);
  border-color: rgba(120, 200, 255, 0.25);
  color: rgba(120, 200, 255, 0.95);
}

.inv-dmg-pill {
  background: rgba(255, 100, 100, 0.10);
  border-color: rgba(255, 100, 100, 0.25);
  color: rgba(255, 140, 140, 0.95);
}

.inv-ac-pill {
  background: rgba(100, 200, 255, 0.10);
  border-color: rgba(100, 200, 255, 0.25);
  color: rgba(140, 210, 255, 0.95);
}

.inv-val-pill,
.inv-val-pill-gp {
  background: rgba(255, 215, 0, 0.10);
  border-color: rgba(255, 215, 0, 0.20);
  color: rgba(255, 215, 0, 0.95);
}
.inv-val-pill-sp {
  background: rgba(192, 200, 210, 0.10);
  border-color: rgba(192, 200, 210, 0.20);
  color: rgba(192, 200, 210, 0.95);
}
.inv-val-pill-cp {
  background: rgba(185, 115, 60, 0.10);
  border-color: rgba(185, 115, 60, 0.25);
  color: rgba(205, 140, 80, 0.95);
}

.inv-cap-pill {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

/* Container Bonus Display */
.inv-container-bonus-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(120, 200, 255, 0.08);
  border: 1px solid rgba(120, 200, 255, 0.20);
  cursor: help;
  transition: all 0.15s;
}

.inv-container-bonus-wrap:hover {
  background: rgba(120, 200, 255, 0.12);
  border-color: rgba(120, 200, 255, 0.30);
}

.inv-container-icon {
  font-size: 14px;
  line-height: 1;
}

.inv-container-bonus-text {
  font-size: 13px;
  font-weight: 700;
  color: rgba(120, 200, 255, 0.95);
}

.inv-container-bonus-label {
  font-size: 11px;
  color: rgba(120, 200, 255, 0.75);
}

/* Tooltip icon as image */
.inv-tt-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.7;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
