/* VibrationGuard simülasyonu */
.sim-section { background: var(--alt); }
.sim {
  --ok: #1F9D61; --warn: #E09400; --crit: #E5484D; --stop: #62666E;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.sim button { font: inherit; }
.sim-h { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Üst bar */
.sim-top { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sim-title { display: grid; gap: 2px; }
.sim-title strong { font-size: 17px; letter-spacing: -0.01em; }
.sim-live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.sim-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; box-shadow: 0 0 0 0 rgba(255,94,14,.5); }
.sim-clock { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.sim-kpis { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.sim-kpis div { padding: 8px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); min-width: 92px; }
.sim-kpis span { display: block; font-size: 11.5px; color: var(--muted); }
.sim-kpis strong { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sim-kpis [data-k="ok"] { color: var(--ok); }
.sim-kpis [data-k="warn"] { color: var(--warn); }
.sim-kpis [data-k="crit"] { color: var(--crit); }
.sim-kpis [data-k="prev"] { color: var(--accent-ink); }
.sim-ctrl { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--alt); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--ink); color: #fff; }
.sim-pause { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font-size: 11px; }
.sim-pause:hover { border-color: var(--ink); }

/* Gövde */
.sim-body { display: grid; grid-template-columns: 1.05fr 1fr; }
.sim-left { padding: 18px; border-right: 1px solid var(--line); display: grid; gap: 16px; align-content: start; background: linear-gradient(180deg, #FBFAF7, #F5F3EE); }
.sim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.tile {
  position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.tile::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--ok); opacity: .9; }
.tile[data-st="warn"]::before { background: var(--warn); }
.tile[data-st="crit"]::before, .tile[data-st="stop"]::before { background: var(--crit); }
.tile[data-st="crit"] { animation: tileAlert 1.6s ease-in-out infinite; }
@keyframes tileAlert { 50% { box-shadow: 0 0 0 3px rgba(229,72,77,.18); } }
.tile-stage { display: block; padding: 10px 6px 0; background: radial-gradient(120% 90% at 50% 0%, #fff, #EEF0F3); }
.tile-info { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px 10px; line-height: 1.3; }
.tile-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tile-row strong { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.tile-name { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-val { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 4px; }
.tile-val b { font-size: 16px; color: var(--ink); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.spk { width: 56px; height: 20px; }
.spk polyline { stroke: var(--ok); }
.tile[data-st="warn"] .spk polyline { stroke: var(--warn); }
.tile[data-st="crit"] .spk polyline, .tile[data-st="stop"] .spk polyline { stroke: var(--crit); }

.st-pill { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(31,157,97,.1); color: var(--ok); white-space: nowrap; }
[data-st="warn"] .st-pill { background: rgba(224,148,0,.12); color: #A86F00; }
[data-st="crit"] .st-pill, [data-st="stop"] .st-pill { background: rgba(229,72,77,.1); color: var(--crit); }

/* Makine çizimi */
.mach { width: 100%; height: auto; display: block; overflow: visible; }
.m-shake { animation: mShake .11s linear infinite; }
@keyframes mShake {
  25% { transform: translate(calc(var(--amp, 0) * 1px), calc(var(--amp, 0) * -.5px)); }
  50% { transform: translate(calc(var(--amp, 0) * -.8px), calc(var(--amp, 0) * .4px)); }
  75% { transform: translate(calc(var(--amp, 0) * .4px), calc(var(--amp, 0) * .7px)); }
}
.m-spin { animation: mSpin var(--spin, .3s) linear infinite; }
@keyframes mSpin { to { transform: translateY(6px); } }
.m-rot { transform-box: fill-box; transform-origin: center; animation: mRot var(--spin, .3s) linear infinite; }
@keyframes mRot { to { transform: rotate(360deg); } }
.is-stopped .m-spin, .is-stopped .m-rot, .is-stopped .m-shake { animation-play-state: paused; }
.m-led { fill: #3DDC97; }
.m-led-ring { stroke: #3DDC97; opacity: 0; }
.mach[data-st="warn"] .m-led { fill: #FFC53D; }
.mach[data-st="warn"] .m-led-ring { stroke: #FFC53D; }
.mach[data-st="crit"] .m-led, .mach[data-st="stop"] .m-led { fill: #FF4D4F; }
.mach[data-st="crit"] .m-led-ring { stroke: #FF4D4F; }
.mach[data-st="warn"] .m-led-ring, .mach[data-st="crit"] .m-led-ring { transform-box: fill-box; transform-origin: center; animation: ledRing 1.2s ease-out infinite; }
@keyframes ledRing { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.mach[data-st="stop"] { filter: grayscale(.7); opacity: .75; }

/* Olay günlüğü */
.sim-log { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.sim-log ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; min-height: 120px; align-content: start; }
.sim-log li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: 13px; line-height: 1.45; padding-left: 10px; border-left: 2px solid var(--line-2); animation: noteIn .4s var(--ease) both; }
.sim-log time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding-top: 1px; }
.sim-log .ev-warn { border-color: var(--warn); }
.sim-log .ev-crit { border-color: var(--crit); }
.sim-log .ev-ok { border-color: var(--ok); }

/* Detay */
.sim-detail { padding: 20px 22px 22px; display: grid; gap: 16px; align-content: start; }
.det-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.det-id { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); letter-spacing: .04em; }
.det-head h3 { font-size: 24px; margin-top: 2px; }
.det-meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.ring { position: relative; width: 74px; height: 74px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: var(--alt); }
.ring-fg { stroke: var(--ok); stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .6s var(--ease), stroke .3s; }
[data-st="warn"] .ring-fg { stroke: var(--warn); }
[data-st="crit"] .ring-fg, [data-st="stop"] .ring-fg { stroke: var(--crit); }
.ring > span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { font-size: 20px; letter-spacing: -0.02em; line-height: 1; }
.ring small { font-size: 10.5px; color: var(--muted); }

.det-stage { position: relative; border-radius: 16px; padding: 22px 26px 8px; background: radial-gradient(120% 100% at 50% 0%, #FFFFFF 0%, #EEF0F3 70%, #E4E7EB 100%); border: 1px solid var(--line); overflow: hidden; }
.det-stage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: repeating-linear-gradient(90deg, rgba(15,16,18,.035) 0 1px, transparent 1px 32px); pointer-events: none; }
.det-stage .mach { max-width: 520px; margin: 0 auto; position: relative; z-index: 1; }
.callout { position: absolute; z-index: 2; top: 12px; right: 12px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); background: rgba(255,255,255,.85); border: 1px solid var(--line); padding: 5px 9px; border-radius: 999px; }
.sim-detail[data-st="crit"] .det-stage { box-shadow: inset 0 0 0 2px rgba(229,72,77,.35); }
.sim-detail[data-st="warn"] .det-stage { box-shadow: inset 0 0 0 2px rgba(224,148,0,.3); }

.det-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.det-metrics > div { padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.det-metrics span { display: block; font-size: 12px; color: var(--muted); }
.det-metrics strong { display: block; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.det-metrics strong em { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.det-metrics small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.iso { position: relative; height: 5px; margin-top: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--ok) 0 40%, var(--warn) 40% 64%, var(--crit) 64%); }
.iso i { position: absolute; top: -3px; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); transition: left .3s var(--ease); }
[data-st="warn"] .det-metrics [data-d="ttf"], [data-st="crit"] .det-metrics [data-d="ttf"] { color: var(--crit); }

.diag { padding: 14px 16px; border-radius: 12px; background: rgba(31,157,97,.06); border: 1px solid rgba(31,157,97,.2); }
[data-st="warn"] .diag { background: rgba(224,148,0,.07); border-color: rgba(224,148,0,.3); }
[data-st="crit"] .diag, [data-st="stop"] .diag { background: rgba(229,72,77,.06); border-color: rgba(229,72,77,.28); }
.diag p:not(.sim-h) { font-size: 15px; font-weight: 500; margin-top: 4px; }
.diag .diag-a { font-weight: 400 !important; color: var(--ink-2); font-size: 14px !important; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chart { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 8px; background: var(--surface); }
.chart-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.chart-h span { font-size: 13px; font-weight: 600; }
.chart-h small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.chart canvas { display: block; width: 100%; height: 150px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.act { height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; font-weight: 500; transition: border-color .2s, background .2s, color .2s; }
.act:hover { border-color: var(--ink); }
.act-fix { margin-left: auto; background: var(--accent); border-color: var(--accent); color: #fff; }
.act-fix:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

.sim-note { margin-top: 16px; font-size: 13.5px; color: var(--muted); }

@media (max-width: 1080px) {
  .sim-top { grid-template-columns: 1fr auto; }
  .sim-kpis { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .sim-body { grid-template-columns: 1fr; }
  .sim-left { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .sim-top { grid-template-columns: 1fr; padding: 14px; }
  .sim-ctrl { overflow-x: auto; }
  .sim-kpis div { min-width: 0; flex: 1 1 28%; padding: 6px 10px; }
  .sim-left, .sim-detail { padding: 12px; }
  .sim-grid { gap: 6px; }
  .tile-info { padding: 6px 7px 8px; }
  .tile-name, .spk { display: none; }
  .det-metrics, .charts { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: 1fr; }
  .act-fix { margin-left: 0; }
  .sim-log li { grid-template-columns: 1fr; gap: 0; }
}

/* =========================================================================
   ColdTrack filo simülasyonu
   ========================================================================= */
.ct-sim { --ok: #1F9D61; --warn: #E09400; --crit: #E5484D; }
.ct-body { display: grid; grid-template-columns: 1.1fr 1fr; }
.ct-left { padding: 18px; border-right: 1px solid var(--line); display: grid; gap: 14px; align-content: start; background: linear-gradient(180deg, #FBFAF7, #F5F3EE); }

/* Harita */
.ct-mapwrap { position: relative; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, #EAF2F9, #E2ECF5); border: 1px solid var(--line); }
.ct-map { display: block; width: 100%; height: auto; }
.m-land { fill: #FBFAF7; stroke: #C9CED6; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 6px 10px rgba(27,60,122,.12)); }
.m-sea { fill: #E2ECF5; stroke: #C9CED6; stroke-width: 1; }
.m-route { fill: none; stroke: #B9BEC7; stroke-width: 3; stroke-dasharray: 7 8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s; }
.m-route.on { stroke: var(--accent); stroke-width: 5; stroke-dasharray: none; }
.m-city circle { fill: #62666E; }
.m-city text { font-family: var(--sans); font-size: 19px; font-weight: 700; fill: #4E535B; paint-order: stroke; stroke: #FBFAF7; stroke-width: 5px; }
.m-truck { cursor: pointer; outline: none; }
.m-dot { fill: var(--ok); stroke: #fff; stroke-width: 3.5; filter: drop-shadow(0 3px 5px rgba(15,16,18,.3)); transition: fill .3s; }
.m-truck[data-st="warn"] .m-dot { fill: var(--warn); }
.m-truck[data-st="crit"] .m-dot { fill: var(--crit); }
.m-pulse { fill: none; stroke-width: 2; stroke: transparent; transform-box: fill-box; transform-origin: center; }
.m-truck[data-st="warn"] .m-pulse { stroke: var(--warn); animation: ledRing 1.6s ease-out infinite; }
.m-truck[data-st="crit"] .m-pulse { stroke: var(--crit); animation: ledRing 1.1s ease-out infinite; }
.m-tag { opacity: 0; transition: opacity .2s; pointer-events: none; }
.m-tag rect { fill: var(--ink); width: 178px; }
.m-plate { font-family: var(--sans); font-size: 16px; font-weight: 700; fill: #fff; }
.m-temp { font-family: var(--mono); font-size: 13px; fill: rgba(255,255,255,.7); }
.m-truck.sel .m-tag, .m-truck:hover .m-tag, .m-truck:focus-visible .m-tag { opacity: 1; }
.m-truck.sel .m-dot { stroke: var(--ink); stroke-width: 3; }
.ct-legend { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 12px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.85); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.ct-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ct-legend i { width: 8px; height: 8px; border-radius: 50%; }
.lg-ok { background: var(--ok); } .lg-warn { background: var(--warn); } .lg-crit { background: var(--crit); }

/* Filo listesi */
.ct-list { display: grid; gap: 6px; }
.ct-row { display: grid; grid-template-columns: 92px 1fr 74px 84px 70px; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: left; cursor: pointer; color: inherit; transition: border-color .2s, box-shadow .2s; position: relative; }
.ct-row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ok); }
.ct-row[data-st="warn"]::before { background: var(--warn); }
.ct-row[data-st="crit"]::before { background: var(--crit); }
.ct-row:hover { box-shadow: var(--shadow); }
.ct-row.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ct-plate { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.ct-cargo { font-size: 13px; font-weight: 600; line-height: 1.3; }
.ct-cargo small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.ct-temp { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ct-row[data-st="crit"] .ct-temp { color: var(--crit); }
.ct-row .st-pill { justify-self: start; }
.ct-prog { height: 5px; border-radius: 999px; background: var(--alt); overflow: hidden; }
.ct-prog i { display: block; height: 100%; background: var(--ink); border-radius: inherit; }

/* Detay */
.ct-detail { padding: 20px 22px 22px; display: grid; gap: 14px; align-content: start; }
.st-pill.big { font-size: 13px; padding: 6px 14px; }
.ct-detail[data-st="warn"] .st-pill.big { background: rgba(224,148,0,.12); color: #A86F00; }
.ct-detail[data-st="crit"] .st-pill.big { background: rgba(229,72,77,.1); color: var(--crit); }
.ct-trip-bar { height: 8px; border-radius: 999px; background: var(--alt); overflow: hidden; position: relative; }
.ct-trip-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1B3C7A, var(--accent)); transition: width .3s linear; }
.ct-trip-info { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.ct-trip-info span:nth-child(2) { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); text-align: center; }
.ct-stage { border-radius: 16px; padding: 14px 10px 0; background: radial-gradient(120% 100% at 50% 0%, #FFFFFF, #EEF0F3 75%); border: 1px solid var(--line); overflow: hidden; }
.ct-detail[data-st="crit"] .ct-stage { box-shadow: inset 0 0 0 2px rgba(229,72,77,.35); }
.ct-detail[data-st="warn"] .ct-stage { box-shadow: inset 0 0 0 2px rgba(224,148,0,.3); }
.ct-truck { display: block; width: 100%; height: auto; }
.ct-metrics strong.bad { color: var(--crit); }
.ct-detail .chart canvas { height: 150px; }
.ct-log { margin: 0 18px 18px; }

/* Kamyon çizimi */
.ct-truck .t-brand { font-family: var(--sans); font-size: 9.5px; font-weight: 800; letter-spacing: .12em; fill: #fff; }
.ct-truck .t-cab { font-family: var(--sans); font-size: 12px; font-weight: 800; fill: rgba(255,255,255,.85); letter-spacing: .08em; }
.t-spokes { animation: tSpin var(--wheel, .3s) linear infinite; transform-origin: 0 0; }
@keyframes tSpin { to { transform: rotate(360deg); } }
.t-road { animation: tRoad var(--road, .6s) linear infinite; }
@keyframes tRoad { to { stroke-dashoffset: 60; } }
.t-body { animation: tBob 1.4s ease-in-out infinite; }
@keyframes tBob { 50% { transform: translateY(-.8px); } }
.is-stopped .t-spokes, .is-stopped .t-road, .is-stopped .t-body { animation-play-state: paused; }
.t-fan { animation: tSpin .35s linear infinite; transform-origin: 0 0; }
.is-fail .t-fan { animation-play-state: paused; }
.t-led { fill: #3DDC97; }
.is-fail .t-led { fill: #FF4D4F; animation: ledBlink .8s steps(2) infinite; }
@keyframes ledBlink { 50% { opacity: .2; } }
.t-air path { animation: tAir 1.6s linear infinite; }
@keyframes tAir { to { stroke-dashoffset: 48; } }
.is-fail .t-air { opacity: 0; }
.t-heat { transition: opacity .6s; }
.t-door-open { display: none; }
.is-open .t-door-open { display: inline; }
.is-open .t-door-closed { display: none; }
.t-sen { --c: #2E7CF6; }
.t-sen-dot { fill: var(--c); stroke: #fff; stroke-width: 2; transition: fill .4s; }
.t-sen-ring { fill: none; stroke: var(--c); stroke-width: 2; opacity: .5; transform-box: fill-box; transform-origin: center; }
.t-sen.hot .t-sen-ring { animation: ledRing 1.2s ease-out infinite; }
.t-sen-chip { fill: rgba(255,255,255,.95); stroke: var(--c); stroke-width: 1.5; transition: stroke .4s; }
.t-sen-t { font-family: var(--sans); font-size: 11px; font-weight: 800; fill: #0F1012; }

@media (max-width: 1080px) {
  .ct-body { grid-template-columns: 1fr; }
  .ct-left { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .ct-left, .ct-detail { padding: 12px; }
  .ct-row { grid-template-columns: 80px 1fr auto; gap: 8px; padding: 9px 12px; }
  .ct-row .st-pill, .ct-prog { display: none; }
  .ct-cargo small { display: none; }
  .ct-trip-info span:nth-child(2) { display: none; }
  .ct-log { margin: 0 12px 12px; }
  .ct-legend { display: none; }
  .m-city text { font-size: 24px; }
}

/* =========================================================================
   MineGuard maden simülasyonu
   ========================================================================= */
.mg-body { display: grid; grid-template-columns: 1.45fr 1fr; }
.mg-left { padding: 18px; border-right: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.mg-views { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mg-levels { display: none; }
.mg-sim[data-view="plan"] .mg-levels { display: inline-flex; }
.mg-hint { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.mg-canvas { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #F4F1EA; }
.mg-canvas canvas { display: block; width: 100%; aspect-ratio: 16 / 10; touch-action: pan-y; cursor: grab; }
.mg-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 4px; }
.mg-sim:not([data-view="3d"]) .mg-zoom { display: none; }
.mg-zoom button { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.9); font-size: 16px; font-weight: 600; color: var(--ink); }
.mg-zoom button:hover { border-color: var(--ink); }
.mg-banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; background: var(--crit, #E5484D); color: #fff; font-size: 13.5px; white-space: nowrap; box-shadow: 0 10px 24px -10px rgba(229,72,77,.7); animation: evacPulse 1.4s ease-in-out infinite; }
.mg-banner.done { background: #1F9D61; animation: none; box-shadow: 0 10px 24px -10px rgba(31,157,97,.6); }
@keyframes evacPulse { 50% { box-shadow: 0 0 0 6px rgba(229,72,77,.18); } }
.mg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 2px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mg-legend i { width: 8px; height: 8px; border-radius: 50%; }
.lg-safe { background: #2E7CF6; }
.lg-sen { background: #7C4DFF; border-radius: 1px !important; transform: rotate(45deg); }
.lg-mesh { background: #FF5E0E; border-radius: 1px !important; }
.lg-room { background: #2E7CF6; border-radius: 2px !important; width: 10px !important; }
.mg-person .mg-av { color: #fff; }
.mg-actions { gap: 6px; }
.mg-actions .act { height: 36px; font-size: 13px; padding: 0 12px; }
.act-danger { background: #E5484D; border-color: #E5484D; color: #fff; }
.act-danger:hover { background: #C93B40; border-color: #C93B40; }
.mg-actions .act-fix { margin-left: 0; }

.mg-right { padding: 18px; display: grid; gap: 12px; align-content: start; background: linear-gradient(180deg, #FBFAF7, #F5F3EE); }
.mg-status { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(31,157,97,.07); border: 1px solid rgba(31,157,97,.25); }
.mg-status.st-warn { background: rgba(224,148,0,.08); border-color: rgba(224,148,0,.35); }
.mg-status.st-crit { background: rgba(229,72,77,.07); border-color: rgba(229,72,77,.35); }
.mg-st-dot { width: 10px; height: 10px; border-radius: 50%; background: #1F9D61; margin-top: 6px; flex: none; animation: pulse 2s infinite; }
.st-warn .mg-st-dot { background: #E09400; }
.st-crit .mg-st-dot { background: #E5484D; }
.mg-status strong { font-size: 15.5px; }
.mg-status p { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.45; }
.mg-card { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.mg-card > .sim-h { margin-bottom: 10px; }
.mg-sensors { display: grid; gap: 4px; }
.mg-sen, .mg-sen-h { display: grid; grid-template-columns: 1fr 52px 52px 46px; gap: 6px; align-items: center; }
.mg-sen { padding: 7px 8px; border-radius: 9px; border: 1px solid transparent; background: var(--bg); text-align: left; font-size: 13px; cursor: pointer; color: inherit; }
.mg-sen:hover { border-color: var(--line-2); }
.mg-sen.sel { border-color: var(--ink); }
.mg-sen[data-st="warn"] { background: rgba(224,148,0,.09); }
.mg-sen[data-st="crit"] { background: rgba(229,72,77,.09); animation: tileAlert 1.4s ease-in-out infinite; }
.mg-sen-n { font-size: 12px; color: var(--muted); line-height: 1.25; }
.mg-sen-n b { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink); }
.mg-sen > span:not(.mg-sen-n) { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.mg-sen-h { padding: 6px 8px 0; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.mg-sen-h span { text-align: right; }
.v-warn { color: #B07800 !important; }
.v-crit { color: #E5484D !important; }
.mg-person { display: flex; gap: 12px; align-items: center; }
.mg-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: #1F9D61; flex: none; }
.mg-av[data-st="evac"], .mg-av[data-st="rescue"], .mg-av[data-st="carry"], .mg-av[data-st="warn"] { background: #E09400; }
.mg-av[data-st="down"], .mg-av[data-st="carried"], .mg-av[data-st="crit"] { background: #E5484D; }
.mg-av[data-st="safe"] { background: #2E7CF6; }
.mg-av.sen { background: #7C4DFF; border-radius: 12px; }
.mg-person strong { display: block; font-size: 16px; }
.mg-person span { font-size: 13px; color: var(--muted); }
.mg-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.mg-kv > div { padding: 9px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.mg-kv span { display: block; font-size: 11.5px; color: var(--muted); }
.mg-kv span small { font-size: 10.5px; opacity: .8; }
.mg-kv b { display: block; font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mg-rescue { margin-top: 10px; width: 100%; }
.mg-chart { display: block; width: 100%; height: 90px; margin-top: 10px; }
.mg-levelbars { display: grid; gap: 7px; }
.lb { display: grid; grid-template-columns: 130px 1fr 26px; gap: 10px; align-items: center; font-size: 12.5px; }
.lb span { color: var(--ink-2); }
.lb i { height: 7px; border-radius: 999px; background: var(--alt); overflow: hidden; }
.lb b { display: block; height: 100%; background: #1F9D61; border-radius: inherit; transition: width .4s var(--ease); }
.lb-safe b { background: #2E7CF6; }
.lb strong { text-align: right; font-variant-numeric: tabular-nums; }
.mg-log { margin: 0 18px 18px; }

@media (max-width: 1080px) {
  .mg-body { grid-template-columns: 1fr; }
  .mg-left { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .mg-left, .mg-right { padding: 12px; }
  .mg-hint { display: none; }
  .mg-canvas canvas { aspect-ratio: 4 / 3.4; }
  .mg-views .seg button { padding: 7px 9px; font-size: 12px; }
  .mg-log { margin: 0 12px 12px; }
  .lb { grid-template-columns: 110px 1fr 22px; }
}

/* =========================================================================
   AICO Sense pano simülasyonu
   ========================================================================= */
.fl-body { display: grid; grid-template-columns: .9fr 1.25fr; }
.fl-left { padding: 18px; border-right: 1px solid var(--line); display: grid; gap: 12px; align-content: start; background: linear-gradient(180deg, #FBFAF7, #F5F3EE); }
.fl-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fl-tile { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: left; cursor: pointer; color: inherit; transition: border-color .2s, box-shadow .2s; overflow: hidden; }
.fl-tile::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: #1F9D61; }
.fl-tile[data-st="warn"]::before { background: #E09400; }
.fl-tile[data-st="crit"]::before, .fl-tile[data-st="fire"]::before { background: #E5484D; }
.fl-tile[data-st="crit"], .fl-tile[data-st="fire"] { animation: tileAlert 1.4s ease-in-out infinite; }
.fl-tile:hover { box-shadow: var(--shadow); }
.fl-tile.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.fl-cab { width: 40px; height: 52px; }
.fc-b { fill: #D3D8DE; stroke: #9AA3AD; }
.fc-d { fill: #2B3036; }
.fc-cu { fill: #D88A4E; }
.fc-r { fill: #F4F5F6; stroke: #C3C9CF; }
.fl-tile[data-st="warn"] .fc-b { fill: #FCE7B8; stroke: #E09400; }
.fl-tile[data-st="crit"] .fc-b, .fl-tile[data-st="fire"] .fc-b { fill: #F9C9CA; stroke: #E5484D; }
.fl-tile-i { display: grid; gap: 2px; min-width: 0; }
.fl-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fl-row strong { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.fl-name { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-val { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.fl-val b { font-size: 15px; color: var(--ink); font-weight: 700; }
.fl-tile[data-st="crit"] .fl-val b, .fl-tile[data-st="fire"] .fl-val b { color: #E5484D; }
.fl-load { width: 44px; height: 5px; border-radius: 999px; background: var(--alt); overflow: hidden; }
.fl-load i { display: block; height: 100%; background: var(--ink); }
.fl-tile[data-st="warn"] .st-pill { background: rgba(224,148,0,.12); color: #A86F00; }
.fl-tile[data-st="crit"] .st-pill, .fl-tile[data-st="fire"] .st-pill { background: rgba(229,72,77,.1); color: #E5484D; }

.fl-compare { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.fl-cmp-row { display: flex; gap: 12px; align-items: center; }
.fl-cmp-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--alt); color: var(--muted); flex: none; transition: background .3s, color .3s; }
.fl-cmp-ic.fl.on { background: #FF5E0E; color: #fff; }
.fl-cmp-ic.det.on { background: #E5484D; color: #fff; }
.fl-cmp-row b { display: block; font-size: 14px; }
.fl-cmp-row span:not(.fl-cmp-ic) { font-size: 13px; color: var(--muted); }
.fl-cmp-lead { font-size: 13px; color: var(--ink-2); padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); line-height: 1.45; }
.fl-auto { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.fl-auto b { display: block; font-size: 13.5px; }
.fl-auto small { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: #FF5E0E; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.fl-detail { padding: 20px 22px 22px; display: grid; gap: 14px; align-content: start; }
.fl-detail[data-st="warn"] .st-pill.big { background: rgba(224,148,0,.12); color: #A86F00; }
.fl-detail[data-st="crit"] .st-pill.big, .fl-detail[data-st="fire"] .st-pill.big { background: rgba(229,72,77,.1); color: #E5484D; }
.fl-stagebar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fl-hint { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.fl-stage { border-radius: 16px; padding: 16px; background: radial-gradient(120% 100% at 50% 0%, #FFFFFF, #ECEEF1 75%); border: 1px solid var(--line); }
.fl-stage .pn-svg { max-height: 520px; width: auto; max-width: 100%; margin: 0 auto; }
.fl-detail[data-st="crit"] .fl-stage, .fl-detail[data-st="fire"] .fl-stage { box-shadow: inset 0 0 0 2px rgba(229,72,77,.4); }
.fl-detail[data-st="warn"] .fl-stage { box-shadow: inset 0 0 0 2px rgba(224,148,0,.35); }
.pn-svg.ir .pn-heat { mix-blend-mode: screen; }
.pn-svg.ir .pn-wires, .pn-svg.ir .pn-dev { opacity: .35; }
.pn-svg .pn-ir, .pn-svg .pn-heat, .pn-svg .pn-smoke { transition: opacity .5s; }
.pn-svg.is-fire .pn-dev { animation: ledBlink .6s steps(2) infinite; }
.fl-metrics strong.warn { color: #B07800; }
.fl-metrics strong.bad { color: #E5484D; }
.fl-detail .chart canvas { height: 140px; }
.fl-log { margin: 0 18px 18px; }

@media (max-width: 1080px) {
  .fl-body { grid-template-columns: 1fr; }
  .fl-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .fl-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .fl-left, .fl-detail { padding: 12px; }
  .fl-tiles { grid-template-columns: 1fr 1fr; }
  .fl-tile { grid-template-columns: 28px 1fr; gap: 8px; padding: 8px; }
  .fl-cab { width: 28px; height: 36px; }
  .fl-name, .fl-load { display: none; }
  .fl-stage { padding: 8px; }
  .fl-log { margin: 0 12px 12px; }
}

/* =========================================================================
   AICO Vision kamera simülasyonu
   ========================================================================= */
.vs-body { display: grid; grid-template-columns: 1.55fr 1fr; }
.vs-left { padding: 18px; border-right: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.vs-main { position: relative; border-radius: 14px; overflow: hidden; background: #0F1012; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.vs-main canvas { display: block; width: 100%; aspect-ratio: 16 / 9; }
.vs-main.alarm { box-shadow: 0 0 0 3px #FF3B3F; animation: tileAlert 1.2s ease-in-out infinite; }
.vs-hud { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; font-family: var(--sans); color: #fff; }
.vs-hud-top { display: flex; align-items: center; gap: 14px; padding: 9px 14px; background: linear-gradient(180deg, rgba(10,22,44,.85), rgba(10,22,44,.55)); font-size: 12px; letter-spacing: .06em; }
.vs-brand { font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.vs-brand b { color: #3DC7F5; }
.vs-hud-top [data-h="cam"] { color: rgba(255,255,255,.75); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-hud-top [data-h="time"] { font-family: var(--mono); color: #3DC7F5; font-size: 14px; }
.vs-hud-row { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 8px; padding: 8px 14px 0; margin-bottom: auto; }
.vs-hud-row > div { background: rgba(10,22,44,.72); border: 1px solid rgba(61,199,245,.35); border-radius: 6px; padding: 6px 10px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.vs-hud-st { font-weight: 800; font-size: 13px; letter-spacing: .08em; color: #3DC7F5; display: flex; align-items: center; }
.vs-hud-st.chk { color: #FFC53D; border-color: rgba(255,197,61,.6) !important; }
.vs-hud-st.al { color: #fff; background: rgba(229,72,77,.9) !important; border-color: #FF3B3F !important; animation: evacPulse 1s ease-in-out infinite; }
.vs-hud-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .08em; min-width: 0; }
.vs-hud-bar i { --n: 0; flex: 1; height: 10px; min-width: 40px; background: repeating-linear-gradient(90deg, #3DC7F5 0 calc(10% - 2px), transparent calc(10% - 2px) 10%) 0 0 / calc(var(--n) * 10%) 100% no-repeat, repeating-linear-gradient(90deg, rgba(61,199,245,.18) 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); }
.vs-hud-bar b { font-family: var(--mono); font-weight: 500; color: #3DC7F5; font-size: 12px; min-width: 46px; text-align: right; }
.vs-main.alarm .vs-hud-bar i { background: repeating-linear-gradient(90deg, #FF4D4F 0 calc(10% - 2px), transparent calc(10% - 2px) 10%) 0 0 / calc(var(--n) * 10%) 100% no-repeat, repeating-linear-gradient(90deg, rgba(255,77,79,.2) 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); }
.vs-hud-ev { text-align: center; font-size: 10px; letter-spacing: .08em; }
.vs-hud-ev b { display: block; font-family: var(--mono); font-size: 15px; color: #3DC7F5; }
.vs-hud-bot { display: flex; gap: 16px; padding: 6px 14px 30px; font-size: 11px; letter-spacing: .08em; font-weight: 600; }
.vs-hud-bot span { color: #3DDC97; }
.vs-hud-bot span.off { color: #FFC53D; }
.vs-hud-bot [data-h="mode"] { margin-left: auto; color: rgba(255,255,255,.8); }
.vs-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vs-th { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #0F1012; cursor: pointer; text-align: left; color: #fff; }
.vs-th canvas { display: block; width: 100%; aspect-ratio: 16 / 9; }
.vs-th.sel { border-color: var(--accent); }
.vs-th[data-st="crit"] { border-color: #FF3B3F; animation: tileAlert 1.2s ease-in-out infinite; }
.vs-th-l { position: absolute; left: 6px; top: 6px; font-size: 10.5px; line-height: 1.25; padding: 3px 7px; border-radius: 6px; background: rgba(15,16,18,.7); max-width: calc(100% - 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-th-l b { font-family: var(--mono); font-weight: 500; margin-right: 5px; }
.vs-th-st { position: absolute; right: 6px; bottom: 20px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(31,157,97,.9); }
.vs-th[data-st="warn"] .vs-th-st { background: rgba(224,148,0,.95); }
.vs-th[data-st="crit"] .vs-th-st { background: #FF3B3F; }

.vs-right { padding: 18px; display: grid; gap: 12px; align-content: start; background: linear-gradient(180deg, #FBFAF7, #F5F3EE); }
.vs-alarm { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.vs-alarm.on { border-color: #FF3B3F; box-shadow: 0 0 0 3px rgba(229,72,77,.12); }
.vs-alarm > .sim-h { margin-bottom: 10px; }
.vs-alarm-empty { display: flex; gap: 12px; align-items: center; }
.vs-alarm-empty > span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(31,157,97,.12); color: #1F9D61; font-weight: 800; flex: none; }
.vs-alarm-empty b { display: block; font-size: 15px; }
.vs-alarm-empty small { font-size: 13px; color: var(--muted); }
.vs-snap canvas { display: block; width: 100%; height: auto; border-radius: 10px; }
.vs-alarm-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.vs-alarm-kv > div { padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.vs-alarm-kv span { display: block; font-size: 11.5px; color: var(--muted); }
.vs-alarm-kv b { display: block; font-size: 13.5px; margin-top: 2px; }
.vs-probs { display: grid; gap: 4px; }
.vs-prob, .vs-prob-h { display: grid; grid-template-columns: 1fr 76px 76px; gap: 8px; align-items: center; }
.vs-prob { padding: 7px 8px; border-radius: 9px; border: 1px solid transparent; background: var(--bg); cursor: pointer; text-align: left; color: inherit; }
.vs-prob.sel { border-color: var(--ink); }
.vs-prob[data-st="crit"] { background: rgba(229,72,77,.09); }
.vs-prob-n { font-size: 12px; color: var(--muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-prob-n b { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink); }
.vs-pb { position: relative; height: 16px; border-radius: 5px; background: var(--alt); overflow: hidden; }
.vs-pb i { position: absolute; left: 0; top: 0; bottom: 0; background: #FF5E0E; border-radius: 5px; transition: width .2s; }
.vs-pb.smoke i { background: #62666E; }
.vs-pb i::after { content: attr(data-v); position: absolute; left: 6px; top: 1px; font-family: var(--mono); font-size: 10.5px; color: var(--ink); white-space: nowrap; }
.vs-prob-h { padding: 6px 8px 0; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.vs-actions .act { height: 36px; font-size: 13px; padding: 0 12px; }
.vs-actions .act-fix { margin-left: 0; }
.vs-log { margin: 0 18px 18px; }

@media (max-width: 1080px) {
  .vs-body { grid-template-columns: 1fr; }
  .vs-left { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .vs-left, .vs-right { padding: 12px; }
  .vs-hud-row { grid-template-columns: 1fr 1fr; padding: 6px 8px 0; }
  .vs-hud-st { grid-column: 1 / -1; font-size: 11px; }
  .vs-hud-ev { display: none; }
  .vs-hud-top { padding: 6px 8px; gap: 8px; }
  .vs-hud-top [data-h="cam"] { display: none; }
  .vs-hud-bot { display: none; }
  .vs-thumbs { gap: 5px; }
  .vs-th-l { font-size: 9px; }
  .vs-th-l b { display: none; }
  .vs-log { margin: 0 12px 12px; }
}
.vs-sim .sim-kpis { flex-wrap: nowrap; }
.vs-sim .sim-kpis div { min-width: 0; padding: 8px 10px; }
.vs-sim .sim-kpis span { font-size: 11px; white-space: nowrap; }
.vs-hud-bot span { background: rgba(10,22,44,.7); padding: 3px 8px; border-radius: 6px; }
@media (max-width: 1080px) { .vs-sim .sim-kpis { flex-wrap: wrap; } }
.fl-cmp-ic.tmp.on { background: #F0A000; color: #fff; }
.fl-learn { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fl-chart-gas canvas, .fl-detail .chart canvas { height: 170px; }
