/* =====================================================================
   SIMURBAN v0.9.66 — setas corretas, frota separada e TMPE por escopo
   Carregado depois de styles-ui-v0965.css.
   ===================================================================== */

/* Estradas: ícones maiores e leitura direta das direções/faixas. */
body.city-mode #toolPanel[data-active-tool="road"] .road-main-presets .icon-choice{
  min-height:50px!important;
}
body.city-mode #toolPanel[data-active-tool="road"] .road-main-presets .ui-ico{
  width:35px!important;
  height:35px!important;
  stroke-width:2.15!important;
}
body.city-mode #toolPanel[data-active-tool="road"] .lane-quick-buttons .icon-choice{
  min-height:48px!important;
  padding:4px 2px!important;
}
body.city-mode #toolPanel[data-active-tool="road"] .lane-quick-buttons .ui-ico{
  width:31px!important;
  height:31px!important;
  stroke-width:2.15!important;
}
body.city-mode #toolPanel[data-active-tool="road"] .choice-number{display:none!important}

/* Zoneamento: densidade e pincel em blocos inteiros, um abaixo do outro. */
body.city-mode #toolPanel[data-active-tool="zone"] .zone-density-wrap{
  grid-column:1/-1!important;
  width:100%!important;
}
body.city-mode #toolPanel[data-active-tool="zone"] .zone-density-wrap:not(.zone-brush-wrap){order:2!important}
body.city-mode #toolPanel[data-active-tool="zone"] .zone-brush-wrap{order:3!important}
body.city-mode #toolPanel[data-active-tool="zone"] .zone-buttons:not(.zone-grid-toggle-row){order:1!important}
body.city-mode #toolPanel[data-active-tool="zone"] .zone-grid-toggle-row{order:4!important}
body.city-mode #toolPanel[data-active-tool="zone"] .tool-hint{order:5!important}
body.city-mode #toolPanel[data-active-tool="zone"] .zone-density-buttons,
body.city-mode #toolPanel[data-active-tool="zone"] .zone-brush-buttons{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}

/* Primeira etapa de Veículos: somente frota já comprada. */
body.city-mode #toolPanel[data-active-tool="vehicles"]{
  width:min(430px,calc(100vw - 90px))!important;
  max-width:430px!important;
}
body.city-mode #toolPanel[data-active-tool="vehicles"] .tool-section.active{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
  padding:10px!important;
  overflow:hidden!important;
}
.owned-fleet-toolbar{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.owned-fleet-toolbar button,
.owned-fleet-buy{
  min-height:35px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  background:rgba(255,255,255,.055);
  color:#eef7f1;
  font-size:10px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  cursor:pointer;
}
.owned-fleet-toolbar button.active{
  background:linear-gradient(180deg,rgba(143,211,107,.34),rgba(67,112,55,.27));
  border-color:rgba(143,211,107,.52);
}
.owned-fleet-toolbar .ui-ico,.owned-fleet-buy .ui-ico{width:15px;height:15px}
.owned-fleet-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:31px;
  padding:0 9px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:9px;
  background:rgba(0,0,0,.15);
  color:#b9c9bf;
  font-size:9px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.owned-fleet-summary b{color:#fff;font-size:13px}
body.city-mode #toolPanel[data-active-tool="vehicles"] .owned-fleet-list{
  max-height:min(310px,calc(100vh - 390px));
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:2px;
}
body.city-mode #toolPanel[data-active-tool="vehicles"] .fleet-vehicle-row{
  grid-template-columns:minmax(0,1fr)!important;
  gap:6px!important;
  padding:9px!important;
}
body.city-mode #toolPanel[data-active-tool="vehicles"] .fleet-vehicle-row em{
  font-size:9px!important;
  color:#aebeb4!important;
}
body.city-mode #toolPanel[data-active-tool="vehicles"] .fleet-row-actions{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:7px!important;
}
body.city-mode #toolPanel[data-active-tool="vehicles"] .fleet-row-actions select,
body.city-mode #toolPanel[data-active-tool="vehicles"] .fleet-row-actions button{height:32px!important}
.owned-fleet-buy{
  width:100%;
  background:linear-gradient(180deg,rgba(143,211,107,.28),rgba(67,112,55,.22));
  border-color:rgba(143,211,107,.42);
}

/* Segunda etapa: somente catálogo de compra. */
body.city-mode #transitFleetPanel.transit-fleet-panel{
  width:min(540px,calc(100vw - 90px))!important;
  max-width:540px!important;
}
body.city-mode #transitFleetPanel .transit-fleet-body{
  padding:11px!important;
}
body.city-mode #transitFleetPanel .purchase-destination-row{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:center!important;
  gap:8px!important;
  min-height:34px!important;
  margin:0 0 9px!important;
  padding:0 9px!important;
  border:1px solid rgba(255,255,255,.09)!important;
  border-radius:9px!important;
  background:rgba(0,0,0,.15)!important;
}
body.city-mode #transitFleetPanel .purchase-destination-row span{
  color:#9fb2a7!important;
  font-size:8px!important;
  font-weight:950!important;
  text-transform:uppercase!important;
  letter-spacing:.06em!important;
}
body.city-mode #transitFleetPanel .purchase-destination-row b{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:#edf7f1!important;
  font-size:10px!important;
}
body.city-mode #transitFleetPanel .fleet-catalog-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
}
body.city-mode #transitFleetPanel .fleet-catalog-card{
  min-width:0!important;
  padding:10px!important;
}
body.city-mode #transitFleetPanel .fleet-card-actions button{
  width:100%!important;
  min-height:34px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
}

/* TMPE: escopos visualmente separados e seleção junto à bottombar. */
body.city-mode #tmpeInspector.tmpe-popup{
  top:auto!important;
  bottom:82px!important;
  left:62px!important;
  width:min(450px,calc(100vw - 90px))!important;
  max-height:calc(100vh - 150px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
.tmpe-scope-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin:0 0 9px;
}
.tmpe-scope-row span{
  min-height:29px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:4px 7px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:8px;
  background:rgba(255,255,255,.04);
  color:#9fb2a7;
  font-size:8.5px;
  font-weight:900;
  text-align:center;
}
.tmpe-scope-row span.active{
  border-color:rgba(143,211,107,.48);
  background:rgba(143,211,107,.18);
  color:#f1faee;
}

@media(max-width:860px){
  body.city-mode #transitFleetPanel .fleet-catalog-grid{grid-template-columns:1fr!important}
  body.city-mode #toolPanel[data-active-tool="vehicles"]{max-width:none!important}
  body.city-mode #tmpeInspector.tmpe-popup{left:10px!important;right:10px!important;width:auto!important;bottom:72px!important}
}

/* SIMURBAN v0.9.126 — TMPE temporizado e conectores faixa-a-faixa */
.tmpe-section{
  margin-top:10px;
  padding:9px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:9px;
  background:rgba(255,255,255,.035);
}
.tmpe-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
  color:#e9f4ef;
  font-size:10px;
}
.tmpe-section-head span{color:#9fd18b;font-size:9px;font-weight:900}
.tmpe-phase-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.tmpe-phase-grid label{
  display:grid;
  grid-template-columns:1fr 62px 12px;
  align-items:center;
  gap:5px;
  min-height:31px;
  padding:5px 6px;
  border-radius:7px;
  background:rgba(0,0,0,.16);
  color:#b8cbc4;
  font-size:9px;
  font-weight:850;
}
.tmpe-phase-grid input{
  min-width:0;
  width:100%;
  box-sizing:border-box;
  border:1px solid rgba(255,255,255,.13);
  border-radius:6px;
  background:#101918;
  color:#f3d58a;
  padding:5px;
  font-weight:950;
}
.tmpe-phase-grid small{color:#83958e;font-size:8px}
.tmpe-connectors.enabled{border-color:rgba(107,204,245,.30)}
.tmpe-connector-columns{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:8px;
}
.tmpe-connector-columns>div>b{
  display:block;
  margin-bottom:5px;
  color:#aebfba;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.tmpe-connector-list{
  display:grid;
  gap:5px;
  max-height:150px;
  overflow:auto;
  padding-right:2px;
}
.tmpe-connector-list button{
  min-height:28px;
  padding:5px 7px;
  text-align:left;
  font-size:8.5px;
  border-color:rgba(255,255,255,.09);
}
.tmpe-connector-list button.source{border-color:#ff9a4d!important;box-shadow:inset 3px 0 #ff9a4d}
.tmpe-connector-list button.connected{border-color:#78e66b!important;box-shadow:inset 3px 0 #78e66b}
.tmpe-connector-list button:disabled{opacity:.36;cursor:not-allowed}
@media(max-width:620px){
  .tmpe-phase-grid,.tmpe-connector-columns{grid-template-columns:1fr}
}

/* SIMURBAN v0.9.127 — benchmark de desempenho reproduzível */
#menuBenchmark.running {
  opacity: .72;
  cursor: progress;
}

.benchmark-hud {
  position: fixed;
  z-index: 2200;
  top: 154px;
  right: 18px;
  width: min(310px, calc(100vw - 36px));
  padding: 11px 12px 10px;
  border: 1px solid rgba(129, 219, 139, .42);
  border-radius: 12px;
  background: rgba(8, 18, 20, .94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .36), inset 0 0 0 1px rgba(255,255,255,.025);
  color: #e9f3eb;
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.benchmark-hud.hidden {
  display: none !important;
}

.benchmark-hud-title,
.benchmark-hud-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.benchmark-hud-title {
  font-size: 12px;
  letter-spacing: .055em;
}

.benchmark-hud-title strong {
  color: #9fdb8f;
  font-variant-numeric: tabular-nums;
}

.benchmark-record-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ef665f;
  box-shadow: 0 0 0 4px rgba(239, 102, 95, .14), 0 0 12px rgba(239, 102, 95, .7);
  animation: benchmarkPulse 1.05s infinite;
}

.benchmark-hud-title b {
  margin-right: auto;
}

.benchmark-hud-line {
  margin-top: 8px;
  color: #c8d8ca;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.benchmark-progress {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.benchmark-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fba69, #a7df91);
  transition: width .35s linear;
}

.benchmark-hud small {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #8fa497;
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.benchmark-hud.finished {
  border-color: rgba(111, 186, 105, .62);
}

.benchmark-hud.finished .benchmark-record-dot {
  background: #78c879;
  animation: none;
  box-shadow: 0 0 0 4px rgba(120, 200, 121, .14);
}

@keyframes benchmarkPulse {
  0%, 100% { transform: scale(.82); opacity: .72; }
  50% { transform: scale(1.12); opacity: 1; }
}

@media (max-width: 720px) {
  .benchmark-hud {
    top: 116px;
    right: 10px;
    width: min(290px, calc(100vw - 20px));
  }
}

/* SIMURBAN v0.9.213 — preferência do TPME explícita por aproximação */
.tmpe-priority-editor{
  border-color:rgba(255,255,255,.13);
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(0,0,0,.11));
}
.tmpe-priority-legend{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin-bottom:8px;
}
.tmpe-priority-legend span{
  min-height:30px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:6px 7px;
  border-radius:8px;
  font-size:8.5px;
  line-height:1.18;
  font-weight:950;
}
.tmpe-priority-legend i{
  width:11px;
  height:11px;
  border-radius:3px;
  flex:0 0 11px;
  box-shadow:0 0 0 1px rgba(255,255,255,.26),0 0 12px currentColor;
}
.tmpe-priority-legend .priority{color:#bff8cb;background:rgba(64,194,96,.13);border:1px solid rgba(85,228,119,.35)}
.tmpe-priority-legend .priority i{background:#55e477}
.tmpe-priority-legend .stop{color:#ffc0bc;background:rgba(214,65,59,.14);border:1px solid rgba(255,81,74,.38)}
.tmpe-priority-legend .stop i{background:#ff514a}
.tmpe-priority-list{
  display:grid;
  gap:6px;
}
.tmpe-priority-list button{
  width:100%;
  min-height:43px;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:8px;
  padding:7px 9px;
  text-align:left;
  border-radius:9px;
  cursor:pointer;
}
.tmpe-priority-list button span{display:grid;gap:2px;min-width:0}
.tmpe-priority-list button b{font-size:10px;color:#f3f8f1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tmpe-priority-list button small{font-size:8px;color:#9fb0aa}
.tmpe-priority-list button strong{
  min-width:82px;
  text-align:center;
  font-size:8.5px;
  letter-spacing:.055em;
  padding:6px 7px;
  border-radius:7px;
}
.tmpe-priority-list button.priority{
  border-color:rgba(85,228,119,.62)!important;
  background:linear-gradient(180deg,rgba(85,228,119,.25),rgba(33,108,54,.16))!important;
  box-shadow:inset 4px 0 #55e477,0 0 0 1px rgba(85,228,119,.07);
}
.tmpe-priority-list button.priority strong{color:#d8ffe0;background:rgba(85,228,119,.18);border:1px solid rgba(85,228,119,.34)}
.tmpe-priority-list button.stop{
  border-color:rgba(255,81,74,.54)!important;
  background:linear-gradient(180deg,rgba(255,81,74,.19),rgba(105,29,27,.15))!important;
  box-shadow:inset 4px 0 #ff514a;
}
.tmpe-priority-list button.stop strong{color:#ffd2cf;background:rgba(255,81,74,.18);border:1px solid rgba(255,81,74,.34)}
.tmpe-priority-list button:hover{filter:brightness(1.14)}
@media(max-width:620px){
  .tmpe-priority-legend{grid-template-columns:1fr}
  .tmpe-priority-list button{grid-template-columns:1fr}
  .tmpe-priority-list button strong{justify-self:stretch}
}
