/* ═══════════════════════════════════════════════════════════
   Hourly Insights page  (local/offline only, see Layout/hourly-insights.js)
   Same language as the Target page: 3px black outline, navy title bar
   with an amber divider, soft tinted panels. Red = a problem keeps
   repeating, green = good performance keeps repeating, black = structure.
   Every rule is scoped to .hourly-insights-panel so no other page moves.
   ═══════════════════════════════════════════════════════════ */

.hourly-insights-panel {
  --hi-ink: #0b1220;
  --hi-ink-2: #475569;
  --hi-ink-3: #64748b;
  --hi-line: #111827;
  --hi-hair: #d5dce6;
  --hi-soft: #eef2f7;
  --hi-page: #f4f6fa;
  --hi-navy: #0b2e59;
  --hi-amber: #f59e0b;
  --hi-accent: #5138ce;
  --hi-red: #b91c28;
  --hi-red-ink: #a3171f;
  --hi-red-soft: #fdeef0;
  --hi-red-line: #efb3ba;
  --hi-red-dot: #b91c28;
  --hi-green: #14783a;
  --hi-green-ink: #0f6a31;
  --hi-green-soft: #e8f6ee;
  --hi-green-line: #a6d9b8;
  --hi-green-dot: #8ccfa3;
  --hi-rule: #111827;
  --hi-ease: cubic-bezier(.22, 1, .36, 1);
  flex: 1; min-width: 0; overflow-x: clip;
  background: var(--hi-page); color: var(--hi-ink);
  font: 14px/1.45 var(--sans);
}
.hourly-insights-panel[hidden] { display: none; }
.hourly-insights-panel *, .hourly-insights-panel *::before, .hourly-insights-panel *::after { box-sizing: border-box; }
.hourly-insights-panel button, .hourly-insights-panel input, .hourly-insights-panel select { font: inherit; color: inherit; }
.hourly-insights-panel button { cursor: pointer; }
.hourly-insights-panel ::selection { background: #d9d0ff; color: var(--hi-ink); }
.hourly-insights-panel :is(button, input, select, summary):focus-visible { outline: 3px solid var(--hi-accent); outline-offset: 2px; }
.hourly-insights-panel .hi-ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hourly-insights-panel .hi-num { font-variant-numeric: tabular-nums; }
.hi-boot { margin: 0; padding: 40px; color: var(--hi-ink-2); }

/* ── page frame ───────────────────────────────────────────── */
.hi-page { zoom: var(--ui-zoom, 1); display: grid; gap: 18px; padding: 18px clamp(14px, 1.6vw, 28px) 44px; }
.hi-card {
  container-type: inline-size;
  border: 3px solid var(--hi-line); border-radius: 12px; background: #fff; overflow: hidden;
  box-shadow: 0 12px 28px -22px rgba(11, 46, 89, .7);
}
.hi-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 14px 18px; background: var(--hi-navy); border-bottom: 4px solid var(--hi-amber); color: #fff;
}
.hi-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hi-title-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.5); }
.hi-title h1 { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.hi-title p { margin: 3px 0 0; max-width: 78ch; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.86); }
.hi-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hi-chips li {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border: 1.5px solid rgba(255,255,255,.55); border-radius: 999px; background: rgba(255,255,255,.08);
  font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap;
}
.hi-chips li b { font-weight: 850; font-variant-numeric: tabular-nums; }
.hi-chips li.warn { background: #fff3d6; border-color: var(--hi-amber); color: #5b3b00; }

/* ── controls ─────────────────────────────────────────────── */
.hi-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 22px;
  padding: 12px 18px; background: #f3f6fb; border-bottom: 2px solid var(--hi-line);
}
.hi-field { display: grid; gap: 5px; min-width: 0; }
.hi-label { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--hi-ink); }
.hi-seg { display: inline-flex; border: 2px solid var(--hi-line); border-radius: 10px; overflow: hidden; background: #fff; max-width: 100%; overflow-x: auto; }
.hi-seg button {
  flex: none; padding: 8px 14px; border: 0; border-left: 1.5px solid var(--hi-line); background: #fff;
  font-size: 13px; font-weight: 750; white-space: nowrap; transition: background-color 140ms, color 140ms;
}
.hi-seg button:first-child { border-left: 0; }
.hi-seg button:hover { background: var(--hi-soft); }
.hi-seg button[aria-pressed="true"] { background: var(--mtd, #2563eb); color: #fff; }
.hi-search { flex: 1 1 280px; max-width: 520px; }
.hi-input { position: relative; display: block; }
.hi-input .hi-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--hi-ink-2); pointer-events: none; }
.hi-input input, .hi-field select {
  width: 100%; height: 38px; border: 2px solid var(--hi-line); border-radius: 10px; background: #fff;
  font-size: 14px; font-weight: 650; padding: 0 12px;
}
.hi-input input { padding-left: 36px; }
.hi-input input::placeholder { color: var(--hi-ink-3); font-weight: 550; }
.hi-field select { padding-right: 8px; min-width: 190px; }

/* ── scoreboard ───────────────────────────────────────────── */
.hi-board { display: grid; grid-template-columns: 4fr 2fr 1.15fr; gap: 14px; padding: 14px 18px 18px; }
@container (max-width: 1180px) { .hi-board { grid-template-columns: 1fr; } }
.hi-group { border: 2px solid var(--hi-line); border-radius: 12px; padding: 10px 10px 12px; }
.hi-group--risk { background: var(--hi-red-soft); }
.hi-group--good { background: var(--hi-green-soft); }
.hi-group-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 9px; }
.hi-group-head .hi-chipic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; }
.hi-group--risk .hi-chipic { background: var(--hi-red); }
.hi-group--good .hi-chipic { background: var(--hi-green); }
.hi-group-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.hi-group-head p { margin: 0; font-size: 12px; font-weight: 600; color: var(--hi-ink-2); }
/* fixed columns: the 5 risk tiles and the 3 good tiles always stay on one line, at any zoom */
.hi-tiles { display: grid; gap: 10px; }
.hi-tiles--risk { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hi-tiles--good { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hi-tile {
  position: relative; display: grid; align-content: start; gap: 5px; min-height: 124px; padding: 10px 12px 11px;
  text-align: left; background: #fff; border: 2px solid var(--hi-line); border-radius: 10px;
  transition: transform 170ms var(--hi-ease), box-shadow 170ms var(--hi-ease), background-color 170ms, color 170ms;
}
.hi-tile-top { display: flex; align-items: center; gap: 8px; }
.hi-tile-top .hi-chipic { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; }
.hi-group--risk .hi-tile-top .hi-chipic { background: var(--hi-red-soft); color: var(--hi-red); border: 1.5px solid var(--hi-red-line); }
.hi-group--good .hi-tile-top .hi-chipic { background: var(--hi-green-soft); color: var(--hi-green); border: 1.5px solid var(--hi-green-line); }
.hi-tile-label { font-size: 13px; font-weight: 800; line-height: 1.2; }
.hi-tile-mid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.hi-tile-num { font-size: 32px; line-height: 1; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hi-tile-num[data-tone="bad"] { color: var(--hi-red); }
.hi-tile-num[data-tone="good"] { color: var(--hi-green); }
.hi-tile-num[data-tone="none"] { color: var(--hi-ink-3); }
.hi-tile-meaning { font-size: 11.5px; font-weight: 600; line-height: 1.35; color: var(--hi-ink-2); }
.hi-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 16px -12px rgba(11, 18, 32, .55); }
.hi-tile:active { transform: translateY(0) scale(.985); }
/* the chosen tile is filled with its own signal colour: red = problem, green = good / clear, slate = nothing yet */
.hi-tile[data-tone="bad"] { --tile: var(--hi-red); --tile-ink: var(--hi-red-ink); }
.hi-tile[data-tone="good"] { --tile: var(--hi-green); --tile-ink: var(--hi-green-ink); }
.hi-tile[data-tone="none"] { --tile: #64748b; --tile-ink: #334155; }
.hi-tile[aria-pressed="true"] { background: var(--tile, var(--mtd, #2563eb)); color: #fff; }
.hi-tile[aria-pressed="true"] .hi-tile-meaning { color: rgba(255,255,255,.95); }
.hi-tile[aria-pressed="true"] .hi-tile-num[data-tone] { color: #fff; }
.hi-tile[aria-pressed="true"] .hi-tag { background: #fff; color: var(--tile-ink, var(--hi-ink)); border-color: #fff; }
.hi-tile[aria-pressed="true"] .hi-tile-top .hi-chipic { background: #fff; border-color: #fff; color: var(--tile-ink, var(--hi-ink)); }

.hi-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800; line-height: 1.5; white-space: nowrap; color: #fff;
}
.hi-tag--bad { background: var(--hi-red); }
.hi-tag--good { background: var(--hi-green); }
.hi-tag--none { background: #e2e8f0; color: var(--hi-ink-2); }
.hi-tag--ink { background: #fff; color: var(--hi-ink); border: 1.5px solid var(--hi-line); }
.hi-tag--soft-bad { background: var(--hi-red-soft); color: var(--hi-red-ink); border: 1px solid var(--hi-red-line); }
.hi-tag--soft-good { background: var(--hi-green-soft); color: var(--hi-green-ink); border: 1px solid var(--hi-green-line); }
.hi-tag--soft-ink { background: var(--hi-soft); color: var(--hi-ink); border: 1px solid var(--hi-hair); }

@container (min-width: 1181px) and (max-width: 1500px) {
  .hi-tile-mid { flex-direction: column; align-items: flex-start; }
  .hi-tile { padding: 9px 9px 10px; gap: 4px; }
  .hi-tile-top { gap: 6px; }
  .hi-tile-label { font-size: 12.5px; }
  .hi-tile-num { font-size: 30px; }
  .hi-tile-meaning { font-size: 11px; }
}

/* ── results card ─────────────────────────────────────────── */
.hi-results-head { padding: 13px 18px 12px; background: var(--hi-navy); border-bottom: 4px solid var(--hi-amber); color: #fff; }
.hi-results-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hi-results-title h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.hi-results-head p { margin: 5px 0 0; max-width: 118ch; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.88); }
.hi-results-head p.hi-use { margin-top: 3px; font-weight: 800; color: #fff; }
.hi-results-title .hi-tag { font-size: 12px; padding: 3px 10px; }
.hi-body { display: grid; grid-template-columns: minmax(0, 1fr) 352px; }
@container (max-width: 1180px) { .hi-body { grid-template-columns: minmax(0, 1fr); } .hi-rail { border-left: 0 !important; border-top: 2px solid var(--hi-line); } .hi-rail-in { position: static; max-height: none; } }
.hi-main { container-type: inline-size; min-width: 0; }

/* list header + rows share one grid */
.hi-cols, .hi-row-main {
  display: grid; align-items: stretch; column-gap: 0;
  grid-template-columns: 44px minmax(180px, 1.1fr) minmax(250px, 1.6fr) minmax(190px, 330px) minmax(110px, .7fr) 44px;
}
.hi-cols > span { padding: 0 12px; text-align: center; }
.hi-cols > span:not(:first-child):not(:last-child) { border-left: 1px solid var(--hi-rule); }
.hi-cols {
  padding: 9px 14px; background: var(--hi-soft); border-bottom: 2px solid var(--hi-line);
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--hi-ink);
}
.hi-cols[hidden], .hi-pager[hidden] { display: none; }
.hi-list { margin: 0; padding: 0; list-style: none; }
/* every RSM/ASM group has its own light colour: band, state band under it, and its rows */
.hi-c0 { --band: #ffb8bf; --sub: #ffd3d7; --row: #fff3f4; --hover: #ffe3e5; --open: #ffd0d4; }   /* most rows: light red */
.hi-c1 { --band: #ffc98a; --sub: #ffdfb5; --row: #fff7ec; --hover: #ffe8c8; --open: #ffdcae; }   /* light orange */
.hi-c2 { --band: #ffe69a; --sub: #fff0bf; --row: #fffbea; --hover: #fff3c4; --open: #ffefb5; }   /* light yellow */
.hi-c3 { --band: #cfe0f7; --sub: #e0ebfa; --row: #f6f9fe; --hover: #e8f0fb; --open: #d9e7f9; }   /* light blue */
.hi-c4 { --band: #e2d8f6; --sub: #ece5f9; --row: #faf8fe; --hover: #f0eafa; --open: #e7dff7; }   /* light lavender: the 5th state */
.hi-c5 { --band: #dfe3ea; --sub: #ebeef3; --row: #f8f9fb; --hover: #eef0f4; --open: #e3e6ec; }   /* grey: not in the latest report */
.hi-c6 { --band: #a9e0bb; --sub: #c9eed6; --row: #f1fbf4; --hover: #ddf5e5; --open: #c2ebd0; }   /* most rows on a green tab: light green */
.hi-row { border-bottom: 1.5px solid var(--hi-rule); background: var(--row); }
/* one band per state (KA1, KA2, TN, KL, AP & TG), like the Hourly reports; click to hide / show its rows */
.hi-gh { background: var(--band); color: var(--hi-ink); border-top: 1.5px solid var(--hi-line); border-bottom: 1.5px solid var(--hi-line); }
.hi-gh-btn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; width: 100%; padding: 12px 16px; border: 0; background: none; text-align: left; transition: background-color 140ms; }
.hi-gh-btn:hover { background: rgba(255, 255, 255, .35); }
.hi-gh--sub { background: var(--sub); border-top: 1px solid var(--hi-rule); }
.hi-gh--sub .hi-gh-btn { padding: 9px 16px 9px 40px; }
.hi-gh--sub .hi-gh-name { font-size: 19px; }
.hi-gh--sub .hi-gh-zone { font-size: 13px; font-weight: 650; }
.hi-gh--sub .hi-gh-chev { width: 22px; height: 22px; }
.hi-gh--sub .hi-gh-count { font-size: 13px; padding: 2px 12px; }
.hi-gh-chev { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--hi-line); border-radius: 50%; background: #fff; transition: transform 220ms var(--hi-ease); }
.hi-gh[data-folded="true"] .hi-gh-chev { transform: rotate(-90deg); }
.hi-gh-name { font-size: 24px; line-height: 1.1; font-weight: 850; letter-spacing: .01em; }
.hi-gh-zone { font-size: 14px; font-weight: 700; color: var(--hi-ink); }
.hi-gh-more { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.hi-field[hidden], .hi-rail[hidden] { display: none; }
.hi-body--wide { grid-template-columns: minmax(0, 1fr); }
.hi-level-hint { display: flex; flex-wrap: wrap; gap: 3px 16px; padding: 9px 16px; background: #fff; border-bottom: 1px solid var(--hi-rule); font-size: 13px; font-weight: 650; color: var(--hi-ink-2); }
.hi-level-hint b { font-weight: 850; color: var(--hi-ink); }
.hi-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 16px; background: #fff; border-bottom: 2px solid var(--hi-line); font-size: 12.5px; font-weight: 700; color: var(--hi-ink-2); }
.hi-key { padding: 2px 11px; border: 1.5px solid var(--hi-line); border-radius: 999px; background: var(--band); color: var(--hi-ink); font-size: 12px; font-weight: 750; }
.hi-gh-count { margin-left: auto; padding: 3px 14px; border: 1.5px solid var(--hi-line); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 850; }
.hi-gh--risk .hi-gh-count { color: var(--hi-red); }
.hi-gh--good .hi-gh-count { color: var(--hi-green); }
.hi-listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 7px 14px; background: #fff; border-bottom: 1px solid var(--hi-rule); font-size: 12.5px; font-weight: 650; color: var(--hi-ink-2); }
.hi-listbar[hidden] { display: none; }
.hi-listbar-btns { display: inline-flex; gap: 8px; }
.hi-listbar .hi-btn { padding: 4px 12px; font-size: 12px; }
.hi-row-main { width: 100%; padding: 12px 14px; border: 0; background: transparent; text-align: left; transition: background-color 130ms; }
.hi-row-main:hover { background: var(--hover); }
.hi-row[data-open="true"] > .hi-row-main { background: var(--open); }
.hi-row-main > span { display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; padding: 0 12px; text-align: center; }
.hi-row-main > span:not(.hi-rank):not(.hi-toggle) { border-left: 1px solid var(--hi-rule); }
.hi-pattern > * { width: 100%; }
.hi-find, .hi-who { width: 100%; }
.hi-rank { font-size: 13px; font-weight: 800; color: var(--hi-ink-3); font-variant-numeric: tabular-nums; text-align: center; }
.hi-name { font-size: 15px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.hi-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px 8px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--hi-ink-2); }
.hi-find-big { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 4px 9px; }
.hi-big { font-size: 24px; line-height: 1.05; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hi-big[data-tone="bad"] { color: var(--hi-red); }
.hi-big[data-tone="good"] { color: var(--hi-green); }
.hi-since { margin-top: 3px; font-size: 11.5px; font-weight: 700; color: var(--hi-ink-2); }
.hi-big--word { font-size: 19px; line-height: 1.15; }
.hi-cap { font-size: 12px; font-weight: 700; color: var(--hi-ink-2); }
.hi-line { margin-top: 3px; font-size: 12.5px; font-weight: 550; color: var(--hi-ink); line-height: 1.4; }
.hi-team { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.hi-team small { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 600; color: var(--hi-ink-3); }
.hi-team-inline { display: none; }
.hi-row-main > .hi-toggle { padding: 0; justify-self: center; align-self: center; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--hi-line); border-radius: 50%; background: #fff; transition: transform 220ms var(--hi-ease), background-color 140ms, color 140ms; }
.hi-row-main:hover .hi-toggle { background: var(--mtd, #2563eb); border-color: var(--mtd, #2563eb); color: #fff; }
.hi-row[data-open="true"] .hi-toggle { transform: rotate(180deg); background: var(--mtd, #2563eb); border-color: var(--mtd, #2563eb); color: #fff; }

/* the date strip: one block per saved report, oldest to newest */
.hi-strip { display: flex; gap: 3px; align-items: center; justify-content: center; }
.hi-dot { flex: 1 1 0; min-width: 5px; max-width: 14px; height: 22px; border-radius: 3px; }
.hi-dot--bad { background: var(--hi-red-dot); }
.hi-dot--ok { background: var(--hi-green-dot); }
.hi-dot--good { background: var(--hi-green); }
.hi-dot--off { background: #d5dce6; }
.hi-chipv { display: inline-flex; flex-direction: column; align-items: center; min-width: 54px; padding: 3px 6px 4px; border-radius: 7px; font-size: 13px; font-weight: 850; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hi-chipv small { font-size: 10.5px; font-weight: 700; opacity: .85; }
.hi-chipv--bad { background: var(--hi-red-soft); color: var(--hi-red-ink); border: 1.5px solid var(--hi-red-line); }
.hi-chipv--ok { background: var(--hi-green-soft); color: var(--hi-green-ink); border: 1.5px solid var(--hi-green-line); }
.hi-strip--values { flex-wrap: wrap; }
.hi-grow { display: grid; gap: 4px; width: 100%; }
.hi-grow-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 800; color: var(--hi-ink); font-variant-numeric: tabular-nums; }
.hi-grow-bar { display: block; height: 9px; border-radius: 5px; background: #e6ebf2; overflow: hidden; border: 1.5px solid var(--hi-line); }
.hi-grow-bar i { display: block; height: 100%; transform-origin: left center; }
.hi-grow-bar .before { background: #94a3b8; }
.hi-grow-bar .after { background: var(--hi-green); }
.hi-grow-bar .me { background: var(--hi-red); }
.hi-grow-bar .co { background: #94a3b8; }

/* expanded detail */
.hi-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms var(--hi-ease); }
.hi-row[data-open="true"] > .hi-detail { grid-template-rows: 1fr; }
.hi-detail > div { overflow: hidden; min-height: 0; }
.hi-detail-in {
  display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px 24px;
  padding: 14px 18px 18px 68px; border-top: 1px dashed var(--hi-hair);
}
.hi-row--good .hi-detail-in { background: var(--hi-green-soft); }
.hi-row--risk .hi-detail-in { background: var(--hi-red-soft); }
.hi-detail h3 { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--hi-ink); }
.hi-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.hi-facts dt { font-weight: 700; color: var(--hi-ink-2); }
.hi-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.hi-table-wrap { max-height: 300px; overflow: auto; border: 2px solid var(--hi-line); border-radius: 10px; background: #fff; }
.hi-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hi-table th { position: sticky; top: 0; z-index: 1; padding: 8px 12px; background: #dbe5f3; color: var(--hi-ink); box-shadow: inset 0 -2px 0 var(--hi-line); font-size: 11.5px; font-weight: 800; letter-spacing: .03em; text-align: left; white-space: nowrap; }
.hi-table td:first-child { white-space: nowrap; }
.hi-table td { padding: 7px 12px; border-top: 1px solid var(--hi-hair); font-weight: 650; font-variant-numeric: tabular-nums; vertical-align: middle; }
.hi-table tbody tr:first-child td { border-top: 0; }
.hi-table td.neg { color: var(--hi-red-ink); font-weight: 800; }
.hi-meter { position: relative; display: inline-block; width: 110px; height: 9px; vertical-align: middle; margin-right: 8px; border: 1.5px solid var(--hi-line); border-radius: 5px; background: #fff; overflow: hidden; }
.hi-meter i { position: absolute; inset: 0 auto 0 0; background: var(--hi-red); transform-origin: left center; }
.hi-meter i.ok { background: var(--hi-green); }
.hi-meter b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--hi-line); }
.hi-prev { margin-left: 8px; padding: 1px 8px; border: 1px solid var(--hi-line); border-radius: 999px; background: #fff3c4; font-size: 11px; font-weight: 750; white-space: nowrap; }
.hi-note { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: var(--hi-ink-2); }

/* empty state */
.hi-empty { display: grid; justify-items: start; gap: 8px; margin: 18px; padding: 20px 22px; border: 2px solid var(--hi-line); border-radius: 12px; background: var(--hi-soft); }
.hi-empty--clear { background: var(--hi-green-soft); }
.hi-empty-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--mtd, #2563eb); color: #fff; }
.hi-empty--clear .hi-empty-ic { background: var(--hi-green); }
.hi-empty h3 { margin: 0; font-size: 17px; font-weight: 800; }
.hi-empty p { margin: 0; max-width: 70ch; font-size: 13.5px; font-weight: 550; color: var(--hi-ink-2); }
.hi-btn { padding: 7px 14px; border: 2px solid var(--hi-line); border-radius: 9px; background: #fff; font-size: 13px; font-weight: 750; transition: background-color 140ms, color 140ms; }
.hi-btn:hover:not(:disabled) { background: #dbe5f3; }
.hi-btn:disabled { opacity: .4; cursor: not-allowed; }

/* pager */
.hi-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 10px 14px; background: #f3f6fb; border-top: 2px solid var(--hi-line); font-size: 13px; font-weight: 650; }
.hi-pager-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hi-pager select { height: 32px; padding: 0 6px; border: 2px solid var(--hi-line); border-radius: 8px; background: #fff; font-weight: 700; }

/* ── right rail ───────────────────────────────────────────── */
.hi-rail { padding: 14px; background: #f6f8fb; border-left: 2px solid var(--hi-line); }
.hi-rail-in { position: sticky; top: 12px; display: grid; align-content: start; gap: 14px; max-height: calc(var(--ui-vh, 100dvh) - 24px); overflow-y: auto; padding: 3px; margin: -3px; }
.hi-panel { border: 2px solid var(--hi-line); border-radius: 12px; background: #fff; overflow: hidden; }
.hi-panel > header { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1.5px solid var(--hi-line); }
.hi-panel > header .hi-chipic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1.5px solid currentColor; }
.hi-panel > header h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--hi-ink); }
.hi-panel > header p { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--hi-ink-2); }
.hi-panel--state > header { background: #eaf3ff; color: #1d4ed8; }
.hi-panel--team > header { background: #f2efff; color: var(--hi-accent); }
.hi-panel--read > header { background: #fff5e6; color: #9a5b00; }
.hi-panel--checks > header { background: #eef2f7; color: var(--hi-ink); }
.hi-panel-body { padding: 10px 12px 12px; }
.hi-teams { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hi-team-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; width: 100%; padding: 7px 9px 8px; border: 1.5px solid var(--hi-hair); border-radius: 9px; background: #fff; text-align: left; transition: border-color 140ms, background-color 140ms; }
.hi-team-btn:hover { border-color: var(--hi-line); background: #f7f9fc; }
.hi-team-btn[aria-pressed="true"] { border-color: var(--hi-line); box-shadow: inset 0 0 0 1.5px var(--hi-line); }
.hi-team-name { font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.hi-team-right { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.hi-team-of { font-size: 11.5px; font-weight: 700; color: var(--hi-ink-2); }
.hi-panel > header p { max-width: 36ch; line-height: 1.35; }
.hi-team-count { font-size: 17px; font-weight: 850; font-variant-numeric: tabular-nums; }
.hi-team-count[data-tone="bad"] { color: var(--hi-red); }
.hi-team-count[data-tone="good"] { color: var(--hi-green); }
.hi-team-count[data-tone="none"] { color: var(--hi-ink-3); }
.hi-track { grid-column: 1 / -1; height: 9px; border-radius: 5px; background: #e6ebf2; overflow: hidden; }
.hi-track i { display: block; height: 100%; border-radius: 5px; transform-origin: left center; }
.hi-track i.bad { background: var(--hi-red); }
.hi-track i.good { background: var(--hi-green); }
.hi-read { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--hi-ink); }
.hi-read li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; }
.hi-read .hi-strip { gap: 2px; }
.hi-read .hi-big { font-size: 15px; }
.hi-read .hi-dot { flex: none; width: 10px; height: 18px; }
.hi-checks summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: 13px; font-weight: 750; cursor: pointer; list-style: none; }
.hi-checks summary::-webkit-details-marker { display: none; }
.hi-checks summary .hi-ic { transition: transform 220ms var(--hi-ease); }
.hi-checks[open] summary .hi-ic { transform: rotate(180deg); }
.hi-checks .hi-panel-body { max-height: 340px; overflow: auto; border-top: 1.5px solid var(--hi-line); }
.hi-checks h4 { margin: 12px 0 5px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.hi-checks h4:first-child { margin-top: 0; }
.hi-checks ul { margin: 0; padding-left: 18px; font-size: 12.5px; font-weight: 550; line-height: 1.45; }
.hi-checks li { margin-bottom: 5px; }
.hi-checks li small { display: block; color: var(--hi-ink-3); font-weight: 600; }

/* ── motion: only to show a state change, never decoration ─── */
@keyframes hi-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hi-pop { from { opacity: 0; transform: scaleY(.25); } to { opacity: 1; transform: none; } }
@keyframes hi-grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes hi-fade { from { opacity: 0; } to { opacity: 1; } }
.hi-anim .hi-row { animation: hi-rise 380ms var(--hi-ease) both; animation-delay: calc(min(var(--i, 0), 12) * 34ms); }
.hi-anim .hi-gh { animation: hi-fade 300ms ease-out both; }
.hi-anim .hi-dot { transform-origin: bottom; animation: hi-pop 320ms var(--hi-ease) both; animation-delay: calc(120ms + var(--k, 0) * 22ms); }
.hi-anim .hi-chipv { animation: hi-pop 320ms var(--hi-ease) both; animation-delay: calc(140ms + var(--k, 0) * 70ms); }
.hi-anim .hi-grow-bar i, .hi-anim .hi-track i, .hi-anim .hi-meter i { animation: hi-grow 650ms var(--hi-ease) both; animation-delay: 160ms; }
.hi-anim .hi-empty { animation: hi-rise 380ms var(--hi-ease) both; }
.hi-anim-head { animation: hi-fade 300ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .hi-anim .hi-row, .hi-anim .hi-gh, .hi-anim .hi-dot, .hi-anim .hi-chipv, .hi-anim .hi-grow-bar i, .hi-anim .hi-track i, .hi-anim .hi-meter i, .hi-anim .hi-empty, .hi-anim-head { animation: none; }
  .hi-detail, .hi-toggle, .hi-tile { transition: none; }
  .hi-tile:hover { transform: none; }
}

/* ── narrower rows (by the width of the list, not the screen) ─ */
@container (max-width: 1100px) {
  .hi-cols { display: none; }
  .hi-row-main { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1.2fr) 32px; grid-template-areas: "rank who find tog" ". strip strip ."; row-gap: 10px; }
  .hi-row-main > span, .hi-row-main > span:not(.hi-rank):not(.hi-toggle) { border-left: 0; padding: 0; }
  .hi-row-main > .hi-rank { grid-area: rank; }
  .hi-row-main > .hi-who { grid-area: who; }
  .hi-row-main > .hi-find { grid-area: find; }
  .hi-row-main > .hi-pattern { grid-area: strip; }
  .hi-row-main > .hi-team { display: none; }
  .hi-row-main > .hi-toggle { grid-area: tog; }
  .hi-team-inline { display: inline; }
  .hi-detail-in { padding-left: 18px; }
}
@container (max-width: 680px) {
  .hi-row-main { grid-template-columns: 28px minmax(0, 1fr) 32px; grid-template-areas: "rank who tog" ". find find" ". strip strip"; }
  .hi-detail-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hi-seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; border-radius: 0; background: none; overflow: visible; }
  .hi-seg button, .hi-seg button:last-child { border: 2px solid var(--hi-line); border-radius: 9px; padding: 7px 12px; }
  .hi-table th, .hi-table td { padding: 7px 9px; }
  .hi-page { padding: 12px 10px 30px; gap: 12px; }
  .hi-head { padding: 12px; }
  .hi-controls { padding: 10px 12px; }
  .hi-search { flex-basis: 100%; max-width: none; }
  .hi-field select { width: 100%; }
  .hi-board { padding: 10px 10px 12px; }
  .hi-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hi-tile { min-height: 110px; }
  .hi-results-head { padding: 12px; }
  .hi-rail { padding: 10px; }
}

/* tooltip box (one shared element, positioned by the script) */
.hi-tip { position: fixed; z-index: 1000; max-width: 330px; padding: 9px 12px; border: 1.5px solid var(--hi-line); border-radius: 9px; background: #fff; color: var(--hi-ink); font: 600 12.5px/1.4 var(--sans); box-shadow: 0 12px 26px -12px rgba(11, 18, 32, .5); pointer-events: none; }
.hi-tip[hidden] { display: none; }
.hourly-insights-panel [data-tip]:not(button):not(.hi-gh-count) { cursor: help; }

/* RSM/ASM-wise and State-wise rows: coloured by performance, with clear black lines between the rows and the columns */
.hi-lead { margin-top: 5px; font-size: 14px; font-weight: 850; line-height: 1.3; color: var(--hi-ink); }
.hi-row--lv { background: var(--sub); border-bottom: 2.5px solid var(--hi-line); }
.hi-row--lv > .hi-row-main:hover, .hi-row--lv[data-open="true"] > .hi-row-main { background: var(--band); }
.hi-row--lv .hi-detail-in { background: #fff; border-top: 2px solid var(--hi-line); }
.hi-go { margin-top: 12px; }
.hi-go:hover { background: var(--mtd, #2563eb); border-color: var(--mtd, #2563eb); color: #fff; }
.hi-cols--lv { border-top: 2px solid var(--hi-line); border-bottom: 3px solid var(--hi-line); }
@container (min-width: 1101px) {
  .hi-cols--lv { padding: 0; }
  .hi-cols--lv > span { padding: 10px 12px; }
  .hi-cols--lv > span:not(:first-child):not(:last-child) { border-left: 2px solid var(--hi-line); }
  .hi-cols--lv > span:nth-last-child(2) { border-right: 2px solid var(--hi-line); }
  .hi-row--lv > .hi-row-main { padding: 0; }
  .hi-row--lv > .hi-row-main > span:not(.hi-toggle) { padding: 14px 12px; }
  .hi-row--lv > .hi-row-main > span:not(.hi-rank):not(.hi-toggle) { border-left: 2px solid var(--hi-line); }
  .hi-row--lv > .hi-row-main > .hi-team { border-right: 2px solid var(--hi-line); }
}

/* easy-to-read numbers next to the small bars: the label sits above its bar */
.hi-row--lv .hi-grow { gap: 9px; }
.hi-row--lv .hi-grow-row { grid-template-columns: minmax(0, 1fr); gap: 3px; font-size: 14px; line-height: 1.25; }
.hi-row--lv .hi-grow-bar { height: 12px; border-radius: 6px; }
.hi-row--lv .hi-sub, .hi-row--lv .hi-team small, .hi-row--lv .hi-cap { color: var(--hi-ink); font-weight: 700; }
.hi-row--lv .hi-rank { color: var(--hi-ink); }

/* who to talk to first, and what to do */
.hi-focus { padding: 10px 14px 12px; background: rgba(255, 255, 255, .62); border-top: 1.5px solid var(--hi-line); }
.hi-focus--card { margin: 0; background: #fff; border-top: 0; border-bottom: 2px solid var(--hi-line); }
.hi-focus-head { margin: 0 0 7px; font-size: 12.5px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; color: var(--hi-ink); }
.hi-fl { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.hi-fc { display: grid; grid-template-columns: 28px minmax(130px, .7fr) minmax(0, 1.4fr) minmax(0, 1.4fr); gap: 4px 14px; align-items: start; padding: 9px 11px; background: #fff; border: 1.5px solid var(--hi-line); border-radius: 9px; }
.hi-fc-n { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--hi-line); border-radius: 50%; background: #fff; font-size: 12.5px; font-weight: 850; }
.hi-fc-who b { display: block; font-size: 15px; font-weight: 850; line-height: 1.2; overflow-wrap: anywhere; }
.hi-fc-who small { display: block; margin-top: 2px; font-size: 12px; font-weight: 650; color: var(--hi-ink-2); }
.hi-fc-t { font-size: 13.5px; font-weight: 650; line-height: 1.4; color: var(--hi-ink); }
.hi-fc-t i { display: block; margin-bottom: 1px; font-style: normal; font-size: 10.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: var(--hi-ink-2); }
@container (max-width: 1100px) { .hi-fc { grid-template-columns: 28px minmax(0, 1fr); } .hi-fc-t { grid-column: 2; } }
.hi-plan-h { margin-top: 14px !important; }
.hi-plan { margin: 0 0 6px; font-size: 13px; font-weight: 650; line-height: 1.45; color: var(--hi-ink); }
.hi-plan--do { font-weight: 800; }
.hi-fc--lv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@container (max-width: 1100px) { .hi-fc--lv { grid-template-columns: minmax(0, 1fr); } .hi-fc--lv .hi-fc-t { grid-column: 1; } }
.hi-level-hint .hi-btn { margin-left: auto; padding: 3px 12px; font-size: 12px; }
.hi-chips li.live { background: #e8f6ee; border-color: #6fcf97; color: #0b4a22; }
.hi-chips li.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .25); }

/* the Action plan tile and card */
.hi-controls[hidden] { display: none; }
.hi-group--plan { background: #eef0ff; }
.hi-group--plan .hi-group-head .hi-chipic { background: var(--hi-accent); }
.hi-group--plan .hi-tile-top .hi-chipic { background: #eef0ff; color: var(--hi-accent); border: 1.5px solid #c9c2f5; }
.hi-tiles--plan { grid-template-columns: minmax(0, 1fr); }
.hi-tile[data-tone="plan"] { --tile: var(--hi-accent); --tile-ink: #3b2a9e; }
.hi-tile-num[data-tone="plan"] { color: var(--hi-accent); }
.hi-ap-row { padding: 16px 18px 18px; border-bottom: 3px solid var(--hi-line); }
.hi-ap-row--risk { background: #ffe9ea; }
.hi-ap-row--good { background: #dcf3e4; }
.hi-ap-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.hi-ap-n { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--hi-line); border-radius: 50%; background: #fff; font-size: 16px; font-weight: 850; }
.hi-ap-title { font-size: 21px; font-weight: 850; letter-spacing: -.01em; }
.hi-ap-count { padding: 3px 13px; border: 2px solid var(--hi-line); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 850; }
.hi-ap-head .hi-go { margin: 0 0 0 auto; padding: 7px 16px; font-size: 14px; }
.hi-ap-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.45fr) minmax(0, 1fr); gap: 12px; }
.hi-ap-box { padding: 12px 15px 14px; border: 2px solid var(--hi-line); border-radius: 11px; background: #fff; }
.hi-ap-label { margin-bottom: 7px; padding-bottom: 6px; border-bottom: 1.5px solid var(--hi-hair); font-size: 12.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: var(--hi-ink-2); }
.hi-ap-big { margin: 0 0 6px; font-size: 17px; font-weight: 850; line-height: 1.35; }
.hi-ap-small { margin: 0; font-size: 14.5px; font-weight: 650; line-height: 1.4; color: var(--hi-ink-2); }
.hi-ap-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.hi-ap-steps li { font-size: 15.5px; font-weight: 700; line-height: 1.45; }
.hi-ap-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hi-ap-chip { display: inline-flex; flex-direction: column; padding: 6px 13px; border: 2px solid var(--hi-line); border-radius: 10px; background: #f4f6fa; line-height: 1.2; }
.hi-ap-chip b { font-size: 16px; font-weight: 850; }
.hi-ap-chip small { font-size: 12.5px; font-weight: 700; color: var(--hi-ink-2); }
@container (max-width: 1100px) { .hi-ap-grid { grid-template-columns: minmax(0, 1fr); } }
