/* ============================================================
   TRAFFIC — campus-wide traffic management overview
   simple: intro + stat strip + 4 capability cards + layer stack
   ============================================================ */
.tm-intro { max-inline-size: 52rem; margin: 0 0 var(--sp-4); font-size: var(--fs-lg); color: var(--text-muted); }
.tm-intro strong { color: var(--text); }

.tm-stats { list-style: none; margin: 0 0 var(--sp-5); padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: var(--radius-lg); overflow: hidden; background: var(--grad-navy); box-shadow: var(--shadow-2); }
.tm-stats li { padding: var(--sp-3) var(--sp-2); text-align: center; color: var(--text-on-navy-muted); font-size: var(--fs-xs); line-height: 1.35; border-inline-start: 1px solid rgba(255,255,255,.08); }
.tm-stats li:first-child { border-inline-start: 0; }
.tm-stats b { display: block; margin-block-end: .3rem; color: var(--amber); font: 800 1.9rem/1 var(--font-en); }

.tm-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.tm-caps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.tm-cap { padding: var(--sp-3); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s; }
.tm-cap:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tm-cap__ic { display: grid; place-items: center; inline-size: 2.6rem; block-size: 2.6rem; margin-block-end: .8rem; border-radius: 10px; background: var(--grad-navy); color: #fff; }
.tm-cap__ic svg { inline-size: 1.3rem; block-size: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tm-cap h3 { margin: 0 0 .4rem; font-size: var(--fs-base); }
.tm-cap ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; }
.tm-cap li { position: relative; padding-inline-start: 1rem; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.45; }
.tm-cap li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: .55em; inline-size: .4rem; block-size: .4rem; border-radius: 50%; background: var(--amber); }

.tm-stack { position: sticky; inset-block-start: 6rem; padding: var(--sp-3); border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.tm-stack__h { margin: 0 0 var(--sp-2); font: 700 var(--fs-xs)/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
[dir="rtl"] .tm-stack__h { font-family: var(--font-ar); letter-spacing: 0; }
.tm-layer { position: relative; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.tm-layer + .tm-layer { margin-block-start: 1.4rem; }
.tm-layer + .tm-layer::before { content: ""; position: absolute; inset-block-start: -1.4rem; inset-inline-start: 50%; inline-size: 2px; block-size: 1.4rem; background: repeating-linear-gradient(180deg, var(--amber) 0 4px, transparent 4px 8px); animation: tm-flow .8s linear infinite; }
@keyframes tm-flow { to { background-position: 0 8px; } }
.tm-layer b { display: block; font-size: var(--fs-sm); }
.tm-layer span { display: block; margin-block-start: .2rem; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; }
.tm-layer--core { background: var(--grad-navy); border-color: transparent; color: #fff; box-shadow: 0 14px 28px -14px rgba(40,73,144,.7); }
.tm-layer--core b { color: var(--amber); }
.tm-layer--core span { color: var(--text-on-navy-muted); }

@media (max-width: 1099px) { .tm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tm-stats li:nth-child(5) { border-inline-start: 0; } .tm-stats li:nth-child(n+5) { border-block-start: 1px solid rgba(255,255,255,.08); } }
@media (max-width: 899px) { .tm-grid { grid-template-columns: 1fr; } .tm-stack { position: static; } }
@media (max-width: 560px) { .tm-caps { grid-template-columns: 1fr; } .tm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tm-stats li:nth-child(odd) { border-inline-start: 0; } .tm-stats li:nth-child(n+3) { border-block-start: 1px solid rgba(255,255,255,.08); } }
@media (prefers-reduced-motion: reduce) { .tm-layer + .tm-layer::before { animation: none; } }
.tm-layer b span, .tm-layer b bdi { display: inline; margin: 0; font-size: inherit; color: inherit; }

/* ---------- AI seat-belt / phone camera strip, under the 3D scene (js/traffic-3d.js) ---------- */
.tai {
  position: absolute; z-index: 3; display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); column-gap: .75rem; row-gap: .1rem; align-items: center;
  padding: .35rem .55rem; border-radius: 12px; background: rgba(8, 13, 26, .85); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .14); border-inline-start: 3px solid #5fd0ff;
  color: #fff; font-size: .68rem; line-height: 1.25; pointer-events: none; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7);
}
.tai.is-bad { border-inline-start-color: #ff4d4d; }
.tai__snap { grid-row: 1 / span 4; display: block; inline-size: 100%; block-size: auto; border-radius: 6px; }
.tai__t { font: 800 .6rem/1.2 var(--font-mono); letter-spacing: .08em; color: #9aa3b2; text-transform: uppercase; }
.tai__row { display: flex; justify-content: space-between; gap: .5rem; }
.tai__row span { color: #8a96ad; }
.tai__row em { font-style: normal; font-weight: 800; }
.tai__row em.is-ok { color: #6ee59a; }
.tai__row em.is-bad { color: #ff7a7a; }
.tai__foot { color: #b8c0cc; font-size: .62rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tai.is-pop { animation: tai-pop .35s ease; }
@keyframes tai-pop { from { opacity: .4; } }
