/*
 * Omahvisual TV dashboard - "Modern Light Enterprise".
 * Visual spec: docs/tv-display-layout.md.
 * Scaling: JS sets html font-size = 10px * s, s = min(vw/2560, vh/1440).
 * Every size below is baseline px / 10 in rem (24px -> 2.4rem). No transform: scale
 * of the page. Design canvas 2560x1440 ("75%" density): s = 1.5 on a 4K TV (primary),
 * 0.75 at 1920x1080, ~0.53 at 1366x768.
 * Compatibility: Chromium >= 70 (no flex gap, no aspect-ratio, no inset, no :is/:where,
 * no container queries, no backdrop-filter).
 *
 * Baseline layout (2560x1440):
 *   header 2560x76 (full width) | body at x24 y100, 2512x1316
 *   columns 480 | 20 | 1352 | 20 | 640      (24+480+20+1352+20+640+24 = 2560)
 *   rows    76 + 24 + 1316 + 24 = 1440
 *   left column: B1 480x596, gap 20, B2 480x700
 */

/* ---------- Font: Plus Jakarta Sans (OFL, self-hosted, latin subset) ---------- */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  /* Neutral */
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F7F9FB;
  --border: #E2E7EE;
  --border-2: #CFD7E1;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #64748B;
  --title: #1E293B;
  --accent: #1E3A8A;
  --accent-tint: #E4EAF6;
  --idle: #334155;

  /* Status: token = text, -bg = pill background, -line = pill border, -solid = solid fill */
  --ok: #166534;
  --ok-bg: #ECFDF3;
  --ok-line: #BBE5C8;
  --ok-solid: #16A34A;
  --ok-strong: #15803D; /* solid badge background (white text 5.0:1) */
  --running-tint: #F4FBF6;
  --upcoming: #1E40AF;
  --upcoming-bg: #EEF3FE;
  --upcoming-line: #C9D8FA;
  --upcoming-solid: #2563EB;
  --stale: #92400E;
  --stale-bg: #FFF7E6;
  --stale-line: #F5CF85;
  --stale-solid: #D97706;
  --error: #991B1B;
  --error-bg: #FEF1F1;
  --error-line: #F4AFAF;
  --error-solid: #DC2626;
  --neutral: #475569;
  --neutral-bg: #F1F5F9;
  --neutral-solid: #94A3B8;

  /* Derived (non-semantic) */
  --skeleton: #E7ECF2;
  --overlay: rgba(255, 255, 255, 0.95);
  --shadow-panel: 0 0.1rem 0.2rem rgba(15, 23, 42, 0.04);
  --shadow-float: 0 0.2rem 0.8rem rgba(15, 23, 42, 0.10);

  --font: "Plus Jakarta Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[hidden] { display: none !important; }

html {
  font-size: 10px; /* overwritten by js/app.js */
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum" 1;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.is-idle,
html.is-idle * {
  cursor: none !important;
}

*, *::before, *::after { box-sizing: border-box; }

h1, h2 { margin: 0; }

/* Inline icons: one stroke style everywhere */
svg.ph-icon,
svg.msg-icon,
svg.fs-icon,
svg.ev-pin,
.d-msg-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Canvas ---------- */

.canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 256rem;
  height: 144rem;
  margin-left: -128rem;
  margin-top: -72rem;
  overflow: hidden;
}

.body {
  position: absolute;
  left: 2.4rem;
  top: 10rem;
  width: 251.2rem;
  height: 131.6rem;
  display: grid;
  grid-template-columns: 48rem 135.2rem 64rem;
  grid-template-rows: 131.6rem;
  grid-column-gap: 2rem;
}

.panel {
  background: var(--surface);
  border: 0.1rem solid var(--border);
  border-radius: 1.2rem;
  box-shadow: var(--shadow-panel);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.panel-head {
  display: flex;
  align-items: center;
  height: 3.2rem;
  min-width: 0;
}

.ph-icon {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  margin-right: 1rem;
  color: var(--text-3);
}

.panel-title {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 2.4rem;
  line-height: 3.2rem;
  font-weight: 700;
  color: var(--title);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-head .badge-stale { margin-left: auto; }

.badge-stale {
  display: inline-block;
  flex: none;
  max-width: 100%;
  height: 2.8rem;
  padding: 0 1rem;
  border: 0.1rem solid var(--stale-line);
  border-radius: 1.4rem;
  background: var(--stale-bg);
  color: var(--stale);
  font-size: 2rem;
  line-height: 2.6rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skeleton,
.sk-line {
  background: var(--skeleton);
  border-radius: 0.8rem;
  animation: ov-skel 2s ease-in-out infinite;
}

@keyframes ov-skel {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Short fade when a value or card changes (added by js/app.js) */
.fx-fade { animation: ov-fade 0.6s ease-out; }

@keyframes ov-fade {
  from { opacity: 0.25; }
  to { opacity: 1; }
}

/* ---------- A - Header (2560 x 76) ---------- */

.header {
  position: absolute;
  left: 0;
  top: 0;
  width: 256rem;
  height: 7.6rem;
  padding: 0 2.4rem;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 0.1rem solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-logo {
  display: block;
  flex: none;
  width: 5.2rem;
  height: 5.2rem;
  margin: 0 1.2rem 0 -0.6rem; /* the artwork has ~5px built-in padding */
}

.header-title {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 2.8rem;
  line-height: 3.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-spacer { flex: 1 1 auto; min-width: 2.4rem; }

.indicators {
  display: flex;
  align-items: center;
  flex: none;
}

/* Status pill: dot + muted category label + value */
.ind {
  display: flex;
  align-items: center;
  height: 4rem;
  margin-left: 1rem;
  padding: 0 1.6rem 0 1.4rem;
  border: 0.1rem solid var(--border);
  border-radius: 2rem;
  background: var(--surface);
  white-space: nowrap;
  -webkit-transition: background-color 0.4s ease, border-color 0.4s ease;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.ind:first-child { margin-left: 0; }

.ind-dot {
  position: relative;
  display: inline-block;
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-right: 1rem;
  border-radius: 50%;
  background: var(--neutral-solid);
  -webkit-transition: background-color 0.4s ease;
  transition: background-color 0.4s ease;
}

.ind-label {
  margin-right: 0.8rem;
  font-size: 2rem;
  line-height: 2.4rem;
  font-weight: 500;
  color: var(--text-3);
  -webkit-transition: color 0.4s ease;
  transition: color 0.4s ease;
}

.ind-text {
  font-size: 2.2rem;
  line-height: 2.4rem;
  font-weight: 600;
  color: var(--text);
  -webkit-transition: color 0.4s ease;
  transition: color 0.4s ease;
}

.ind--neutral { background: var(--surface-2); }
.ind--neutral .ind-text { color: var(--text-2); font-weight: 500; }

.ind--ok .ind-dot { background: var(--ok-solid); }

.ind--plain .ind-dot { background: var(--ok-solid); }
.ind--plain .ind-text { color: var(--text-2); }

.ind--live { background: var(--ok-bg); border-color: var(--ok-line); }
.ind--live .ind-dot { background: var(--ok-solid); }
.ind--live .ind-label { color: var(--ok); }
.ind--live .ind-text { color: var(--ok); font-weight: 700; letter-spacing: 0.02em; }

/* LIVE: one soft ring every 2.4 s (opacity + transform only) */
.ind--live .ind-dot::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--ok-solid);
  opacity: 0;
  animation: ov-pulse 2.4s ease-out infinite;
}

@keyframes ov-pulse {
  0% { opacity: 0.55; -webkit-transform: scale(1); transform: scale(1); }
  70% { opacity: 0; -webkit-transform: scale(2.4); transform: scale(2.4); }
  100% { opacity: 0; -webkit-transform: scale(2.4); transform: scale(2.4); }
}

.ind--stale { background: var(--stale-bg); border-color: var(--stale-line); }
.ind--stale .ind-dot { background: var(--stale-solid); }
.ind--stale .ind-label,
.ind--stale .ind-text { color: var(--stale); }
.ind--stale .ind-text { font-weight: 700; }

.ind--error { background: var(--error-bg); border-color: var(--error-line); }
.ind--error .ind-dot { background: var(--error-solid); }
.ind--error .ind-label,
.ind--error .ind-text { color: var(--error); }
.ind--error .ind-text { font-weight: 700; }

/*
 * Date + clock block, vertically centred on the pills' centre line:
 * [ Minggu            ]  |  10:24:01
 * [ 15 November 2026  ]
 * two-line date (20, right-aligned) | thin divider | time 36/700 tabular.
 */
.clock {
  flex: none;
  display: flex;
  align-items: center;
  height: 4.8rem;
  margin-left: 3.2rem;
  white-space: nowrap;
}

.clock-date {
  text-align: right;
}

.clock-day {
  font-size: 2rem;
  line-height: 2.4rem;
  font-weight: 600;
  color: var(--text);
}

.clock-dmy {
  font-size: 2rem;
  line-height: 2.4rem;
  font-weight: 500;
  color: var(--text-2);
}

.clock-sep {
  flex: none;
  width: 0.1rem;
  height: 4rem;
  margin: 0 2rem;
  background: var(--border-2);
}

.clock-time {
  font-size: 3.6rem;
  line-height: 4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.fs-btn {
  flex: none;
  width: 4.4rem;
  height: 4.4rem;
  margin: 0 0 0 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.1rem solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  -webkit-transition: background-color 0.2s ease, color 0.2s ease;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.fs-btn:hover { background: var(--surface-2); color: var(--text); }
.fs-btn:focus { outline: 0.2rem solid var(--accent); outline-offset: 0.2rem; }
.fs-icon { width: 2.4rem; height: 2.4rem; display: block; stroke-width: 2; }
.fs-icon--exit { display: none; }
.is-fullscreen .fs-icon--enter { display: none; }
.is-fullscreen .fs-icon--exit { display: block; }
html.is-idle .fs-btn { visibility: hidden; }

/* ---------- Left column ---------- */

.col-left {
  display: grid;
  grid-template-rows: 59.6rem 70rem;
  grid-row-gap: 2rem;
  min-width: 0;
  min-height: 0;
}

/* ---------- Shared swatches (B1 rows/bar + map legend), mirroring the markers ---------- */

.sw-move { background: var(--ok-solid); }
.sw-engine { background: #FFFFFF; box-shadow: inset 0 0 0 0.3rem var(--ok-solid); }
.sw-idle { background: var(--idle); }
.sw-offline { background: var(--neutral-solid); }
.sw-other { background: #CBD5E1; }
.sw-nogps { background: #FFFFFF; box-shadow: inset 0 0 0 0.2rem var(--neutral-solid); }
.sw-stale { background: rgba(148, 163, 184, 0.45); box-shadow: 0 0 0 0.2rem #FFFFFF, 0 0 0 0.35rem var(--stale-solid); }

/* ---------- B1 - Jumlah Kendaraan (480 x 596) ---------- */

.b1 {
  display: flex;
  flex-direction: column;
  padding: 2.2rem 2.2rem 2.2rem 2.6rem;
}

.b1 .panel-head,
.b1-hero,
.b1-bar { flex: none; }

.b1-hero {
  display: flex;
  align-items: flex-end;
  height: 11.2rem;
  margin-top: 2.4rem;
}

.b1-value {
  flex: none;
  font-size: 12rem;
  line-height: 11.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.b1-skeleton {
  display: none;
  flex: none;
  width: 11rem;
  height: 8.6rem;
  margin-bottom: 1.2rem;
}

.b1-side {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 1.8rem;
  padding-bottom: 1.3rem;
}

.b1-side .badge-stale { margin-bottom: 0.8rem; vertical-align: top; }

.b1-sub {
  max-width: 15rem;
  font-size: 2.2rem;
  line-height: 2.8rem;
  font-weight: 500;
  color: var(--text-2);
}

.b1[data-state="loading"] .b1-value { display: none; }
.b1[data-state="loading"] .b1-skeleton { display: block; }
/* No data: a short, light dash (a 120px em dash would read as a skeleton bar) */
.b1[data-state="nodata"] .b1-value {
  font-size: 7.2rem;
  font-weight: 400;
  color: var(--neutral-solid);
  padding-bottom: 1.2rem;
}

/* Segmented bar: one segment per state, width proportional to the count (flex-grow) */
.b1-bar {
  display: flex;
  height: 1.6rem;
  margin-top: 2.8rem;
  border-radius: 0.8rem;
  overflow: hidden;
  background: var(--skeleton);
}

.seg {
  display: block;
  flex: 0 1 0px;
  min-width: 0;
  height: 100%;
  border-right: 0.3rem solid #FFFFFF;
  -webkit-transition: flex-grow 0.6s ease;
  transition: flex-grow 0.6s ease;
}

.seg.sw-engine { box-shadow: inset 0 0 0 0.25rem var(--ok-solid); background: #DCF5E4; }
.seg.sw-nogps { box-shadow: inset 0 0 0 0.2rem var(--neutral-solid); }
.b1-bar .seg:first-child { border-top-left-radius: 0.8rem; border-bottom-left-radius: 0.8rem; }

.b1-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 2.4rem;
}

.b1-row,
.b1-div { flex: none; }

/* B1 budget (worst case, 7 rows incl. Lainnya + Stale):
   22 + 32 + 24 + 112 + 28 + 16 + 24 + 7 x 38 + 13 + 22 = 559 <= 596 */
.b1-row {
  display: flex;
  align-items: center;
  height: 3.8rem;
}

.b1-row .sw {
  display: inline-block;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 1.2rem;
  border-radius: 50%;
}

.b1-row-l {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 2.2rem;
  line-height: 3rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b1-row-n {
  flex: none;
  min-width: 4rem;
  padding-left: 1.2rem;
  font-size: 2.4rem;
  line-height: 3rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.b1-row.is-zero .b1-row-n { color: var(--text-3); font-weight: 600; }
.b1-row.is-stale .b1-row-l,
.b1-row.is-stale .b1-row-n { color: var(--stale); }
.b1-row.is-stale .b1-row-l { font-weight: 600; }

/* Stale flag sits at the bottom of the panel, below a divider */
.b1-div {
  height: 0.1rem;
  margin: auto 0 0.5rem;
  background: var(--border);
}

.b1-list-skel { display: none; margin-top: 2rem; }
.b1-list-skel .sk-line { display: block; height: 2.2rem; margin-bottom: 1.2rem; }
.b1-list-skel .sk-line:nth-child(1) { width: 80%; }
.b1-list-skel .sk-line:nth-child(2) { width: 65%; }
.b1-list-skel .sk-line:nth-child(3) { width: 72%; }
.b1-list-skel .sk-line:nth-child(4) { width: 55%; }

.b1[data-state="loading"] .b1-bar { animation: ov-skel 2s ease-in-out infinite; }
.b1[data-state="loading"] .b1-list { display: none; }
.b1[data-state="loading"] .b1-list-skel { display: block; }
.b1[data-state="nodata"] .b1-list { display: none; }

/* ---------- B2 - Kalender Event (480 x 700) ---------- */

.b2 { padding: 2rem 2.2rem; }

.b2-month-row {
  display: flex;
  align-items: center;
  height: 2.8rem;
  margin-top: 0.6rem;
}

.b2-month {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 2.2rem;
  line-height: 2.8rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b2-month-row .badge-stale { margin-left: 1rem; }

.b2-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 2.8rem;
  margin-top: 1.2rem;
}

.b2-weekdays span {
  font-size: 2rem;
  line-height: 2.8rem;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
}

/* Cells ~62 x 84: number in a 42 px circle (today = filled), indicator line below it,
   ~14 px clear space before the next row. */
.b2-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 8.4rem);
  height: 50.4rem;
  margin-top: 0.6rem;
}

.cal-cell {
  position: relative;
  margin: 0.1rem;
  border-radius: 0.8rem;
  -webkit-transition: background-color 0.4s ease;
  transition: background-color 0.4s ease;
}

.cal-num {
  position: absolute;
  left: 50%;
  top: 0.9rem;
  width: 4.2rem;
  height: 4.2rem;
  margin-left: -2.1rem;
  border-radius: 50%;
  font-size: 2.4rem;
  line-height: 4.2rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  -webkit-transition: background-color 0.4s ease, color 0.4s ease;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Indicator line under the number: dot (1 event) or count pill (2+ events) */
.cal-ind {
  position: absolute;
  left: 0;
  right: 0;
  top: 5.7rem;
  height: 2.2rem;
  text-align: center;
  font-size: 0;
  line-height: 0;
}

.cal-dot {
  display: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

.cal-count {
  display: none;
  min-width: 2.8rem;
  height: 2.2rem;
  padding: 0 0.7rem;
  border-radius: 1.1rem;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 2rem;
  line-height: 2.2rem;
  font-weight: 700;
}

.cal-cell.has-one .cal-dot { display: inline-block; }
.cal-cell.has-many .cal-count { display: inline-block; }

.cal-cell.is-past .cal-num { color: var(--text-3); font-weight: 500; }
.cal-cell.is-past .cal-dot { background: #A3B1C6; }
.cal-cell.is-past .cal-count { background: #E5E9EF; color: var(--text-2); }

/* Today: filled dark circle behind the number (its indicator keeps the normal colours) */
.cal-cell.is-today .cal-num { background: var(--text); color: #FFFFFF; font-weight: 800; }

.cal-cell.is-out { visibility: hidden; }

.b2-foot {
  height: 2.8rem;
  margin-top: 1.6rem;
}

.b2-legend {
  display: flex;
  align-items: center;
  height: 2.8rem;
  white-space: nowrap;
}

.lg-item {
  display: inline-flex;
  align-items: center;
  margin-right: 1.8rem;
  font-size: 2rem;
  line-height: 2.6rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.lg-item:last-child { margin-right: 0; }

.lg-dot {
  display: inline-block;
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0 0.8rem 0 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.lg-count {
  display: inline-block;
  flex: none;
  min-width: 2.6rem;
  height: 2rem;
  margin-right: 0.8rem;
  padding: 0 0.6rem;
  border-radius: 1rem;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 2rem;
  line-height: 2rem;
  font-weight: 700;
  text-align: center;
}

.lg-today {
  display: inline-block;
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  margin-right: 0.8rem;
  border-radius: 50%;
  background: var(--text);
}

.b2-msg {
  font-size: 2.2rem;
  line-height: 2.8rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- C - Map (1352 x 1316; map area ~1350 x 1251 below a 64 px title row) ---------- */

.c {
  display: flex;
  flex-direction: column;
}

.c-head {
  flex: none;
  display: flex;
  align-items: center;
  height: 6.4rem;
  padding: 0 2.4rem 0 2.2rem;
  border-bottom: 0.1rem solid var(--border);
}

.c-head .panel-head { flex: 0 1 auto; }

.c-updated-wrap {
  margin-left: auto;
  padding-left: 1.6rem;
  display: flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
}

.c-updated-wrap .badge-stale { margin-right: 1.2rem; }

.c-updated {
  font-size: 2.2rem;
  line-height: 3.2rem;
  font-weight: 500;
  color: var(--text-2);
}

.c-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.c-map {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-2);
}

.c .leaflet-container {
  background: var(--surface-2);
  font-family: var(--font);
  font-size: 2rem;
  line-height: 1.2;
  outline: none;
}

/* Calm basemap so the status-coloured markers carry the colour (static, no animation) */
.c .leaflet-tile-pane {
  -webkit-filter: saturate(0.55) brightness(1.03);
  filter: saturate(0.55) brightness(1.03);
}

/*
 * Fractional zoom (16 Nov) scales the 256 px tiles, and Chromium can leave hairline gaps
 * between them. Each tile is drawn 1 px larger so neighbours overlap; Leaflet's own fix
 * (mix-blend-mode: plus-lighter, Chrome 100+ only) is switched off because it would turn
 * that overlap into a bright line - and the Android TV browser (Chromium 70) lacks it.
 */
.c .leaflet-container img.leaflet-tile {
  mix-blend-mode: normal;
  width: 257px !important;
  height: 257px !important;
}

.c.tiles-failed .leaflet-tile-pane { visibility: hidden; }

.c-msgs {
  position: absolute;
  left: 2rem;
  right: 2rem;
  top: 50%;
  margin-top: -3rem;
  z-index: 1000;
  text-align: center;
  pointer-events: none;
}

.c-msg {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 1rem;
  padding: 1.2rem 2.2rem 1.2rem 1.8rem;
  background: var(--surface);
  border: 0.1rem solid var(--border);
  border-radius: 1.2rem;
  box-shadow: var(--shadow-float);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.c-msgs .c-msg,
.c-banner .c-msg { display: table; margin-left: auto; margin-right: auto; }

.c-banner {
  position: absolute;
  left: 2rem;
  right: 2rem;
  top: 1.6rem;
  z-index: 1000;
  pointer-events: none;
}

.msg-icon {
  display: inline-block;
  width: 2.4rem;
  height: 2.4rem;
  margin-right: 1rem;
  vertical-align: -0.4rem;
  color: var(--text-3);
}

.c-msg-t {
  font-size: 2.4rem;
  line-height: 3.2rem;
  font-weight: 600;
  color: var(--text-2);
}

.c-legend {
  position: absolute;
  left: 1.6rem;
  bottom: 1.6rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  height: 4.4rem;
  padding: 0 1.6rem;
  background: var(--overlay);
  border: 0.1rem solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-panel);
}

.lg-m {
  display: inline-block;
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.8rem;
  border-radius: 50%;
}

.c-legend .lg-m.sw-stale { margin-left: 0.3rem; margin-right: 1.1rem; }

.c .leaflet-bottom .leaflet-control { margin-bottom: 1.6rem; }
.c .leaflet-right .leaflet-control { margin-right: 1.6rem; }

.c .leaflet-control-attribution {
  font-size: 2rem;
  line-height: 2.8rem;
  padding: 0.8rem 1.2rem;
  background: var(--overlay);
  color: var(--text-2);
  border: 0.1rem solid var(--border);
  border-radius: 1rem;
}

/* Vehicle markers (L.divIcon, iconSize null -> anchor at the element origin) */
.vm-icon {
  width: 0;
  height: 0;
  background: none;
  border: 0;
}

.vm {
  position: absolute;
  left: 0;
  top: 0;
}

.vm-dot {
  position: absolute;
  left: -1.8rem;
  top: -1.8rem;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  border: 0.3rem solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  background: var(--neutral-solid);
  box-shadow: 0 0.1rem 0.4rem rgba(15, 23, 42, 0.35);
  -webkit-transition: background-color 0.4s ease, opacity 0.4s ease;
  transition: background-color 0.4s ease, opacity 0.4s ease;
}

.vm-dot svg { width: 1.9rem; height: 1.9rem; display: block; }

.vm--move .vm-dot { background: var(--ok-solid); }
.vm--engine .vm-dot {
  background: #FFFFFF;
  color: var(--ok-solid);
  box-shadow: inset 0 0 0 0.3rem var(--ok-solid), 0 0.1rem 0.4rem rgba(15, 23, 42, 0.35);
}
.vm--idle .vm-dot { background: var(--idle); }
.vm--offline .vm-dot,
.vm--other .vm-dot { background: var(--neutral-solid); }

.vm-ring {
  display: none;
  position: absolute;
  left: -2.6rem;
  top: -2.6rem;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 50%;
  border: 0.3rem dashed var(--stale-solid);
}

.vm--stale .vm-dot { opacity: 0.55; }
.vm--stale .vm-ring { display: block; }

/*
 * Name badge: name (22/600) + speed only while moving (22/700, green; amber when the
 * position is stale). Since 16 Nov every vehicle can carry one (also diam/offline and
 * compact icons): map.js picks a side (top / right / left / bottom) that touches no
 * other badge or icon and sets left/top in px relative to the icon centre; --nx / --ny
 * are the notch position along the top/bottom / left/right edge, so the notch always
 * points at the icon (or, for a group's list badge, at the group's centre).
 */
.vm-label {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  border: 0.1rem solid rgba(15, 23, 42, 0.16);
  border-radius: 0.8rem;
  box-shadow: 0 0.1rem 0.4rem rgba(15, 23, 42, 0.16);
  white-space: nowrap;
  font-size: 2.2rem;
  line-height: 2.6rem;
}

.vm--lab .vm-one,
.vm--glab .vm-group { visibility: visible; }

/* List badge of a same-spot group (e.g. the depot): one row per vehicle, the dot repeats
   the vehicle's marker colour (stale: faded + amber outline). */
.vm-row { display: block; }
.vm-row + .vm-row { margin-top: 0.2rem; }
.vm-row-dot {
  display: inline-block;
  vertical-align: top;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.7rem 0.8rem 0 0;
  border-radius: 50%;
  background: var(--neutral-solid);
}
.vm-row-dot.st-move { background: var(--ok-solid); }
.vm-row-dot.st-engine { background: #FFFFFF; box-shadow: inset 0 0 0 0.25rem var(--ok-solid); }
.vm-row-dot.st-idle { background: var(--idle); }
.vm-row-dot.is-stale { opacity: 0.55; box-shadow: 0 0 0 0.2rem var(--stale-solid); }

.vm-label::before,
.vm-label::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-color: transparent;
}

/* badge above the icon: notch on the bottom edge, pointing down */
.vm--lab-top .vm-label::before,
.vm--lab-bottom .vm-label::before { left: 50%; left: var(--nx, 50%); margin-left: -0.8rem; }
.vm--lab-top .vm-label::after,
.vm--lab-bottom .vm-label::after { left: 50%; left: var(--nx, 50%); margin-left: -0.7rem; }

.vm--lab-top .vm-label::before { bottom: -0.8rem; border-width: 0.8rem 0.8rem 0; border-top-color: rgba(15, 23, 42, 0.18); }
.vm--lab-top .vm-label::after { bottom: -0.65rem; border-width: 0.7rem 0.7rem 0; border-top-color: #FFFFFF; }

/* badge below the icon: notch on the top edge, pointing up */
.vm--lab-bottom .vm-label::before { top: -0.8rem; border-width: 0 0.8rem 0.8rem; border-bottom-color: rgba(15, 23, 42, 0.18); }
.vm--lab-bottom .vm-label::after { top: -0.65rem; border-width: 0 0.7rem 0.7rem; border-bottom-color: #FFFFFF; }

/* badge right of the icon: notch on the left edge, pointing left */
.vm--lab-right .vm-label::before { left: -0.8rem; top: 50%; top: var(--ny, 50%); margin-top: -0.8rem; border-width: 0.8rem 0.8rem 0.8rem 0; border-right-color: rgba(15, 23, 42, 0.18); }
.vm--lab-right .vm-label::after { left: -0.65rem; top: 50%; top: var(--ny, 50%); margin-top: -0.7rem; border-width: 0.7rem 0.7rem 0.7rem 0; border-right-color: #FFFFFF; }

/* badge left of the icon: notch on the right edge, pointing right */
.vm--lab-left .vm-label::before { right: -0.8rem; top: 50%; top: var(--ny, 50%); margin-top: -0.8rem; border-width: 0.8rem 0 0.8rem 0.8rem; border-left-color: rgba(15, 23, 42, 0.18); }
.vm--lab-left .vm-label::after { right: -0.65rem; top: 50%; top: var(--ny, 50%); margin-top: -0.7rem; border-width: 0.7rem 0 0.7rem 0.7rem; border-left-color: #FFFFFF; }

.vm-name {
  display: inline-block;
  vertical-align: top;
  max-width: 24rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.vm-speed {
  display: inline-block;
  vertical-align: top;
  margin-left: 0.8rem;
  padding-left: 0.8rem;
  border-left: 0.1rem solid var(--border);
  font-weight: 700;
  color: var(--ok);
}

.vm--stale .vm-speed { color: var(--stale); }

/* Hover/click tooltip (vehicle fields only) */
.leaflet-tooltip.vm-tip {
  padding: 1.2rem 1.6rem 1.3rem;
  background: var(--surface);
  border: 0.1rem solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 0.4rem 1.6rem rgba(15, 23, 42, 0.16);
  color: var(--text);
  font-family: var(--font);
  font-size: 2rem;
  line-height: 2.8rem;
  white-space: nowrap;
}

.leaflet-tooltip-top.vm-tip::before { border-top-color: var(--surface); }
.leaflet-tooltip-bottom.vm-tip::before { border-bottom-color: var(--surface); }
.leaflet-tooltip-right.vm-tip::before { border-right-color: var(--surface); }
.leaflet-tooltip-left.vm-tip::before { border-left-color: var(--surface); }

.vt-name {
  font-size: 2.2rem;
  line-height: 3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.vt-row { display: block; }

.vt-k {
  display: inline-block;
  min-width: 13rem;
  font-weight: 500;
  color: var(--text-3);
}

.vt-v { font-weight: 600; color: var(--text); }

.vt-flag {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0 1rem;
  border: 0.1rem solid var(--stale-line);
  border-radius: 1.4rem;
  background: var(--stale-bg);
  color: var(--stale);
  font-weight: 700;
}

/*
 * COMPACT marker (set by map.js layout(): crowded or same-spot vehicles): 22 px avatar
 * (~60 %), same state colour, smaller stale ring, no badge. The badge stays laid out
 * (visibility only) so the layout pass can still measure it. Name via the tooltip.
 */
.vm--compact .vm-dot {
  left: -1.1rem;
  top: -1.1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-width: 0.2rem;
  box-shadow: 0 0.1rem 0.3rem rgba(15, 23, 42, 0.35);
}

.vm--compact .vm-dot svg { width: 1.2rem; height: 1.2rem; }

.vm--compact.vm--engine .vm-dot {
  box-shadow: inset 0 0 0 0.2rem var(--ok-solid), 0 0.1rem 0.3rem rgba(15, 23, 42, 0.35);
}

.vm--compact .vm-ring {
  left: -1.6rem;
  top: -1.6rem;
  width: 3.2rem;
  height: 3.2rem;
  border-width: 0.2rem;
}


/* ---------- D - Event Berjalan & Mendatang (640 x 1316: 8 cards x 134 + 7 x 10 + footer) ---------- */

.d { padding: 2rem; }

.d .panel-head { padding-left: 0.2rem; }

.d-summary {
  height: 2.8rem;
  margin-top: 0.6rem;
  padding-left: 3.8rem; /* aligned with the panel title, past the icon */
  font-size: 2.2rem;
  line-height: 2.8rem;
  font-weight: 700;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d-summary .sum-run { color: var(--ok); }
.d-summary .sum-sep { color: var(--text-3); font-weight: 500; }
.d-summary .sum-up { color: var(--upcoming); }

.d-list {
  position: relative;
  height: 114.2rem;
  margin-top: 2.4rem;
}

.ev-card {
  position: relative;
  height: 13.4rem;
  margin-bottom: 1rem;
  padding: 1.3rem 1.6rem;
  background: var(--surface);
  border: 0.1rem solid var(--border);
  border-left: 0.4rem solid var(--neutral-solid);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center; /* cards without a location line stay balanced */
  -webkit-transition: background-color 0.4s ease, border-color 0.4s ease;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.ev-card:last-child { margin-bottom: 0; }

/* RUNNING: tinted card + solid badge. UPCOMING: white card + light badge. */
.ev-card.is-running {
  background: var(--running-tint);
  border-color: #D3EBDB;
  border-left-color: var(--ok-solid);
}

.ev-card.is-upcoming { border-left-color: #8FB0F3; }

.ev-top {
  flex: none;
  display: flex;
  align-items: center;
  height: 3.2rem;
  white-space: nowrap;
}

.ev-badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 3rem;
  padding: 0 1.2rem 0 1rem;
  border: 0.1rem solid var(--border-2);
  border-radius: 1.5rem;
  background: var(--neutral-bg);
  color: var(--neutral);
  font-size: 2rem;
  line-height: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ev-badge-dot {
  display: inline-block;
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-right: 0.8rem;
  border-radius: 50%;
  background: currentColor;
}

.ev-card.is-running .ev-badge {
  background: var(--ok-strong);
  border-color: var(--ok-strong);
  color: #FFFFFF;
}

.ev-card.is-upcoming .ev-badge {
  background: var(--upcoming-bg);
  border-color: var(--upcoming-line);
  color: var(--upcoming);
}

.ev-card.is-upcoming .ev-badge-dot {
  background: transparent;
  box-shadow: inset 0 0 0 0.2rem currentColor;
}

.ev-led-wrap {
  margin-left: auto;
  padding-left: 1.2rem;
  min-width: 0;
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}



.ev-led {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.ev-led-num {
  font-size: 3.2rem;
  line-height: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ev-led-unit {
  margin-left: 0.4rem;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-2);
}

.ev-led.is-empty {
  font-size: 2.2rem;
  line-height: 3.2rem;
  font-weight: 600;
  color: var(--text-3);
}

.ev-led.is-empty .ev-led-num {
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
  letter-spacing: 0;
}

/*
 * Card rows (600 x 134, inner 563 x 108; content block vertically centred):
 *   1  badge ............................ 105 m²     (32)
 *   2  title (ellipsis) .............. 10–13 Nov     (36, baseline-aligned)
 *   3  pin + location (only when the title is jenis_event)   (30)
 * The LED value and the date form the right-hand column.
 */
.ev-main {
  flex: none;
  display: flex;
  align-items: baseline;
  height: 3.6rem;
  margin-top: 0.4rem;
  min-width: 0;
}

.ev-date {
  flex: none;
  margin-left: 1.6rem;
  font-size: 2.2rem;
  line-height: 3.6rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.ev-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 2.8rem;
  line-height: 3.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-sub {
  flex: none;
  display: flex;
  align-items: center;
  height: 3rem;
  margin-top: 0.2rem;
  min-width: 0;
}

.ev-pin {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  margin: 0 0.8rem 0 -0.1rem;
  color: var(--text-3);
}

.ev-sub-t {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 2.4rem;
  line-height: 3rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-card.is-skeleton {
  border-left-color: var(--border);
  justify-content: center;
}

.ev-card.is-skeleton .sk-line { display: block; }
.sk-1 { width: 32%; height: 2.6rem; }
.sk-2 { width: 74%; height: 3rem; margin-top: 1.4rem; }
.sk-3 { width: 48%; height: 2.4rem; margin-top: 1.2rem; }

/* Empty / not-available state, centred in the list area */
.d-msg {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: -9rem;
  text-align: center;
}

.d-msg-icon {
  display: block;
  width: 8rem;
  height: 8rem;
  margin: 0 auto 2rem;
  padding: 2.2rem;
  border-radius: 50%;
  background: var(--neutral-bg);
  color: var(--text-3);
}

.d-msg-icon svg { display: block; width: 3.6rem; height: 3.6rem; }

.d-msg-t {
  display: block;
  font-size: 2.4rem;
  line-height: 3.2rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d-foot {
  height: 2.8rem;
  margin-top: 1.6rem;
  padding-left: 0.2rem;
  font-size: 2.2rem;
  line-height: 2.8rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  /* layout §8: every animation and transition stops under reduced motion */
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
