/* halohalo dashboard — Carbon g100 tokens */
:root {
  --bg: #161616; --panel: #262626; --panel2: #323232; --line: #393939;
  --text: #f4f4f4; --dim: #c6c6c6; --faint: #8d8d8d;
  --blue: #0f62fe; --teal: #009d9a; --green: #24a148; --amber: #f1c21b; --red: #fa4d56;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; }
.hidden { display: none !important; }
h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: .2px; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
h3 { font-size: 11px; margin: 0 0 8px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--faint); font-weight: 600; }
.sub { color: var(--dim); font-size: 12px; }

/* header */
.top { display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: #1d1d1d; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo { font-size: 22px; color: var(--teal); }
.statusline { display: flex; gap: 8px; }
.pill { font-size: 11px; padding: 3px 10px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--dim); font-family: var(--mono); }
.pill.live { color: var(--green); border-color: var(--green); }
.pill.live.paused { color: var(--amber); border-color: var(--amber); }

/* tabs */
.tabs { display: flex; gap: 2px; padding: 0 24px; background: #1d1d1d;
  border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 12px 18px; cursor: pointer; color: var(--dim); font-size: 13px;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); background: #202020; }
.tab.active { color: var(--text); border-bottom-color: var(--blue); font-weight: 600; }
.tab .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 8px; background: var(--faint); }

/* layout */
.view { padding: 20px 24px 60px; }
.grid { display: grid; gap: 16px; }
.grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cols-2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); padding: 16px; }
.card h3 { margin-bottom: 12px; }

/* meters */
.meters { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.meter { background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; }
.meter .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--faint); }
.meter .val { font-size: 26px; font-weight: 600; margin: 6px 0 10px;
  font-family: var(--mono); }
.meter .val small { font-size: 12px; color: var(--faint); font-weight: 400; }
.bar { height: 6px; background: var(--panel2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); }
.bar.green > i { background: var(--green); }
.bar.teal > i { background: var(--teal); }
.bar.amber > i { background: var(--amber); }

/* overview */
.overview-grid { display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.gamecard { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease;
  border-color: var(--game, var(--line)); }
.gamecard:hover { border-color: var(--game, var(--line));
  box-shadow: 0 0 0 1px var(--game, var(--line)); }
.gamecard-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; min-height: 52px; margin-bottom: 16px; }
.gamecard .gc-id { flex: 1 1 auto; min-width: 0; text-align: left; }
.gamecard .gtitle { font-size: 16px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gamecard .sub { margin-top: 9px; font-family: var(--mono); font-size: 11.5px;
  line-height: 1.3; color: var(--dim); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.gamecard .gbig { flex: none; margin-left: auto; line-height: 1.1;
  font-family: var(--mono); font-size: 24px; color: var(--green); }
.minimeters { display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px 16px; }
.mini .mlbl { display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--faint); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 5px; }
.mini .mlbl b { color: var(--text); font-family: var(--mono); font-size: 12px; }
.mini .msub { font-size: 10.5px; color: var(--faint); font-family: var(--mono);
  margin-top: 4px; }

/* charts */
/* tables */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.legend span { font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; display: inline-block; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .7px; color: var(--faint); padding: 8px 10px;
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
td { padding: 7px 10px; border-bottom: 1px solid #2e2e2e; font-family: var(--mono); }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--panel2); }
.badge { font-size: 10.5px; padding: 2px 8px; border-radius: 10px;
  font-family: var(--sans); font-weight: 600; }
.badge.perfect { background: rgba(36,161,72,.15); color: var(--green); }
.badge.imperfect { background: rgba(241,194,27,.15); color: var(--amber); }
.badge.missing, .badge.unknown { background: rgba(141,141,141,.15); color: var(--faint); }

/* function table */
.tablebar { display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 10px; }
.filter { flex: 1; min-width: 0; background: #1d1d1d; color: var(--text);
  border: 1px solid var(--line); padding: 7px 10px; font-family: var(--mono);
  font-size: 12px; outline: none; }
.filter:focus { border-color: var(--blue); }
.tcount { font-size: 10.5px; color: var(--faint); font-family: var(--mono);
  white-space: nowrap; }
.fntable td:nth-child(3), .fntable th:nth-child(3) { text-align: right; }
.faint { color: var(--faint); font-size: 10px; }
.sectable { font-size: 11.5px; }
.sectable td { padding: 5px 8px; }
.sectable td.sbar { width: 20%; }
.sectable .bar { height: 4px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 11px; padding: 4px 10px; background: var(--panel2);
  border: 1px solid var(--line); font-family: var(--mono); color: var(--dim); }
.chip b { color: var(--text); font-weight: 600; }

/* events */
.event { display: flex; gap: 14px; padding: 12px 4px; border-bottom: 1px solid #2e2e2e; }
.event .rev { font-family: var(--mono); color: var(--teal); font-size: 12px; }
.event .body { flex: 1; }
.event .files { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.event .files span { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.event time { color: var(--faint); font-size: 11px; font-family: var(--mono); }

/* charts */
.chart text { font-family: var(--mono); fill: var(--faint); }
.chart .axis { stroke: var(--line); }
.chart .area { fill: rgba(0,157,154,.25); stroke: var(--teal); stroke-width: 1.5; }
.chart .bar-c { fill: var(--blue); }
.chart .grid-l { stroke: #2e2e2e; }

/* viewer */
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; }
.viewer-card { background: var(--panel); border: 1px solid var(--line);
  width: 100%; height: 100%; display: flex; flex-direction: column; }
.viewer-head { display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line); }
.viewer-body { flex: 1; display: flex; flex-direction: column; gap: 1px;
  background: var(--line); min-height: 0; }
.pane { background: var(--panel); padding: 16px; overflow: auto; min-height: 0; }
.diffpane { flex: 1.3; }
.srcpane { flex: 1; }

/* asm diff — ours vs target, aligned on instruction bytes */
.diff { width: 100%; border-collapse: collapse; font-family: var(--mono);
  font-size: 12px; line-height: 1.55; }
.diff td { vertical-align: top; padding: 0 10px; white-space: pre-wrap;
  word-break: break-all; width: 50%; }
.diff td.l { border-right: 1px solid var(--line); }
.diff td.void { background: repeating-linear-gradient(45deg,
  transparent, transparent 6px, #202020 6px, #202020 12px); }
.diff tr.chg td { background: rgba(241, 194, 27, .09); }
.diff tr.chg td.l { box-shadow: inset 3px 0 0 var(--amber); }
.diff tr.chg td.r { box-shadow: inset -3px 0 0 var(--blue); }
.diff tr:hover td { background: var(--panel2); cursor: pointer; }
.diff .off { color: var(--faint); }
.diff .by { color: var(--teal); }
.diff .mk { display: inline-block; width: 1.5em; color: var(--amber);
  font-weight: 600; }
.diff .ann { color: #6f6f6f; margin-left: 1.2em; }
.diff.solo td.r.solo { width: 100%; border-right: 0; }
.diff.solo tr.noterow td { background: transparent; }
.diff.solo tr.noterow:hover td { background: transparent; cursor: default; }
.diff.solo tr.noterow .note { padding: 4px 0 12px; margin: 0; }

/* source pane — function lines highlighted, click-linked from the diff */
.sline { padding: 0 10px; white-space: pre-wrap; font-family: var(--mono);
  font-size: 12px; line-height: 1.55; color: var(--faint); border-left: 3px solid transparent; }
.sline .gut { display: inline-block; width: 3.2em; text-align: right;
  margin-right: 14px; color: #5e5e5e; user-select: none; }
.sline.fn { background: rgba(15, 98, 254, .12); color: var(--text);
  border-left-color: var(--blue); }
.sline.cur { background: rgba(241, 194, 27, .25); color: var(--text);
  border-left-color: var(--amber); }
.ghost { background: none; border: 1px solid var(--line); color: var(--dim);
  padding: 6px 14px; cursor: pointer; font-family: var(--sans); }
.ghost:hover { border-color: var(--text); color: var(--text); }

/* heat map image */
img.heat { width: 100%; display: block; background: #000;
  image-rendering: pixelated; image-rendering: crisp-edges; }

/* data-change transition: short, subtle fade */
.fade-in { animation: fadein .18s ease-out; }
@keyframes fadein { from { opacity: .55; } to { opacity: 1; } }

/* misc */
.empty { color: var(--faint); padding: 28px 8px; text-align: center;
  border: 1px dashed var(--line); }
.note { font-size: 11.5px; color: var(--faint); margin-top: 10px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 12px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; font-family: var(--mono); }
