﻿@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0f12; --bg-card: #13161b; --bg-row: #0f1318; --bg-alt: #111519;
  --border: #1e2229;
  --text: #c9d1d9; --dim: #6b7785; --bright: #e6edf3;
  --blue: #2a8aff; --green: #3fb950; --orange: #f0883e; --purple: #a371f7;
  --red: #f85149; --vue: #42b883;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
}

body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.6;
  padding: 36px 28px; max-width: 1020px; margin: 0 auto;
}

/* Header */
.hdr { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 24px; }
.eye { font-family: var(--mono); font-size: 11px; color: var(--blue); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.title { font-size: 21px; font-weight: 600; color: var(--bright); letter-spacing: -.02em; }
.subtitle { color: var(--dim); font-size: 13px; margin-top: 5px; }

/* Stats bar */
.stats {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px; padding: 10px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: 12px;
}
.stat { color: var(--dim); white-space: nowrap; }
.stat span { color: var(--bright); font-weight: 600; }
.stat-div { color: var(--border); }

/* Filter bar */
.filters { display: flex; gap: 8px; margin-bottom: 24px; align-items: center; flex-wrap: wrap; }
.filter-label { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-right: 4px; }
.btn {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 5px 12px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--dim); transition: all .15s; letter-spacing: .04em;
}
.btn:hover { border-color: #2a3340; color: var(--text); }
.btn.active-all    { background: rgba(42,138,255,.12); color: var(--blue);   border-color: rgba(42,138,255,.3); }
.btn.active-ng     { background: rgba(221,0,49,.1);    color: #f47;          border-color: rgba(221,0,49,.25); }
.btn.active-rx     { background: rgba(97,218,251,.08); color: #61dafb;       border-color: rgba(97,218,251,.2); }
.btn.active-both   { background: rgba(240,136,62,.1);  color: var(--orange); border-color: rgba(240,136,62,.25); }
.btn.active-vue    { background: rgba(66,184,131,.1);  color: var(--vue);    border-color: rgba(66,184,131,.25); }
.btn.active-rx-vue { background: rgba(66,184,131,.08); color: #7ec5b3;       border-color: rgba(126,197,179,.30); }

/* Group */
.group { margin-bottom: 10px; }
.group-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 4px 4px 0 0;
  cursor: pointer; user-select: none;
}
.group-hdr:hover { border-color: #2a3340; }
.group.collapsed .group-hdr { border-radius: 4px; }
.g-num {
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  background: #161b22; border: 1px solid var(--border);
  width: 24px; height: 24px; display: flex; align-items: center;
  justify-content: center; border-radius: 3px; flex-shrink: 0;
}
.g-title { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--bright); flex: 1; min-width: 0; }
.g-count { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; }
.g-caret { font-family: var(--mono); font-size: 10px; color: var(--dim); transition: transform .18s; flex-shrink: 0; }
.group.collapsed .g-caret { transform: rotate(-90deg); }

/* Table */
.tbl { border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; display: block; min-width: 0; overflow: hidden; }
.group.collapsed .tbl { display: none; }

/* Desktop table layout */
.row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 82px 1fr 90px;
  border-bottom: none;
  transition: background .1s;
  min-width: 0;
}
.row:last-child { border-bottom: none; }


.row-wrap.hidden { display: none !important; }

.col {
  padding: 10px 14px; font-size: 12.5px;
  display: flex; align-items: flex-start;
  line-height: 1.5;
}
/* desc col: override flex to block so inline code tags flow normally in text */
.col.col-desc { display: block; }
.col-file {
  font-family: var(--mono); font-size: 11.5px; color: var(--blue);
  border-right: 1px solid var(--border);
  word-break: break-word; overflow-wrap: anywhere;
  align-items: flex-start;
}
.col-tag {
  border-right: 1px solid var(--border);
  justify-content: center; align-items: flex-start;
  padding-top: 11px;
}
.col-desc { color: var(--text); line-height: 1.55; display: block; }
.col-desc code {
  font-family: var(--mono); font-size: 11px; color: var(--blue);
  background: rgba(42,138,255,.08); padding: 1px 4px; border-radius: 2px;
  display: inline; word-break: break-word; white-space: nowrap;
}
.col-chunk {
  color: var(--dim); font-family: var(--mono); font-size: 11px;
  justify-content: center; align-items: flex-start;
  border-left: 1px solid var(--border); padding-top: 11px;
}

/* Table header */
.tbl-head {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 82px 1fr 90px;
  background: #0a0d10; border-bottom: 1px solid var(--border);
}
.th {
  padding: 6px 14px; font-family: var(--mono); font-size: 10px;
  color: var(--dim); text-transform: uppercase; letter-spacing: .08em;
  white-space: nowrap;
}
.th:not(:last-child) { border-right: 1px solid var(--border); }


/* ── Search ─────────────────────────────────────── */
.search-wrap {
  position: relative; margin-bottom: 16px;
}
.search-input {
  width: 100%; padding: 10px 40px 10px 36px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; color: var(--bright);
  font-family: var(--mono); font-size: 13px;
  outline: none; transition: border-color .15s;
  box-sizing: border-box;
}
.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--dim); }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--dim); font-size: 14px; pointer-events: none;
  font-family: var(--mono);
}
.search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--dim); cursor: pointer; font-size: 16px; line-height: 1;
  display: none; background: none; border: none; padding: 2px 4px;
  border-radius: 2px;
}
.search-clear:hover { color: var(--text); background: #1e2229; }
.search-meta {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  margin-top: 6px; min-height: 16px; max-height: 32px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.search-meta .miss {
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-meta .hit  { color: var(--green); }
.search-meta .miss { color: var(--red); }
/* Highlight matched text */
.hl { background: rgba(240,184,0,.22); color: #f0d060; border-radius: 2px; padding: 0 1px; }
/* Group hidden when no search matches */
.group.search-empty { opacity: .4; }
.group.search-empty .group-hdr { cursor: default; pointer-events: none; }



/* ── V2 Detail Panel ────────────────────────────────────────── */
.dv2-header{display:flex;align-items:center;gap:10px;padding:7px 16px;background:#0d1117;border-bottom:1px solid var(--border);min-width:0}
.dv2-filename{font-family:var(--mono);font-size:11px;color:var(--dim);flex-shrink:0}
.dv2-hint{font-family:var(--mono);font-size:10px;color:#3a4656;margin-left:auto;min-width:0;text-align:right}
.ann-block{
  font-family:var(--mono);font-size:12px;padding:4px 0;
  max-width:100%;min-width:0;overflow-x:auto;
  border:1px solid var(--border);border-radius:3px;background:#090b0e;
}
.ann-plain{display:block;padding:3px 18px;color:var(--dim);line-height:1.6;min-width:0;overflow-wrap:anywhere;word-break:break-word}
.ann-sub{padding-left:10px;min-width:0}
.ann-sub .ann-plain{color:var(--text);padding-left:30px}
.ann-sub .k{color:var(--blue)}.ann-sub .str{color:var(--green)}.ann-sub .num{color:var(--orange)}
.ann-field{border-left:3px solid transparent;transition:border-color .12s;min-width:0}
.ann-field.active{border-left-color:var(--blue)}
.ann-line{
  display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr) auto;
  column-gap:12px;align-items:start;
  padding:3px 15px;cursor:pointer;transition:background .1s;line-height:1.6;min-width:0;
}
.ann-field:hover .ann-line{background:rgba(42,138,255,.04)}
.ann-field.active .ann-line{background:rgba(42,138,255,.09)}
.ann-lhs{white-space:nowrap;min-width:0}
.ann-comment{
  color:#3fb95060;font-style:italic;font-size:11px;padding-left:0;
  white-space:normal;word-break:break-word;overflow-wrap:anywhere;min-width:0;
  transition:color .1s;
}
.ann-field.active .ann-comment{color:var(--green);opacity:.9}
.ann-field:hover .ann-comment{color:#3fb95090}
.ann-toggle{color:var(--dim);font-size:8px;flex-shrink:0;display:inline-block;transition:transform .15s,color .12s;justify-self:end;padding-top:2px}
.ann-field.active .ann-toggle{transform:rotate(90deg);color:var(--blue)}
.k{color:var(--blue)}.str{color:var(--green)}.kw{color:var(--purple)}
.num{color:var(--orange)}.sym{color:var(--dim)}.cm{color:#3a4656;font-style:italic}
.ann-expand{
  display:none;margin:2px 16px 8px 16px;padding:11px 14px;background:#0c1018;
  border:1px solid var(--border);border-left:3px solid var(--blue);border-radius:0 3px 3px 0;
  font-size:12.5px;color:var(--text);line-height:1.6;
  max-width:calc(100% - 32px);overflow-wrap:anywhere;word-break:break-word;
}
.ann-expand.visible{display:block}
.ann-expand code{font-family:var(--mono);font-size:11px;color:var(--blue);word-break:break-word}
.ann-expand strong{color:var(--bright)}
.warn-inline{color:var(--orange);font-family:var(--mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;display:block;margin-bottom:5px}
.ann-diff{margin-top:9px;border:1px solid var(--border);border-radius:3px;overflow:hidden}
.adr{display:grid;grid-template-columns:80px 1fr 1fr 1fr;border-bottom:1px solid var(--border)}
.adr:last-child{border-bottom:none}
.adr.hdr .adc{background:#0a0c10;font-family:var(--mono);font-size:9px;color:var(--dim);text-transform:uppercase;letter-spacing:.06em;font-weight:600}
.adc{padding:6px 10px;border-right:1px solid var(--border);line-height:1.5;font-size:11.5px}
.adc:last-child{border-right:none}
.adc code{font-family:var(--mono);font-size:10.5px;color:var(--blue)}
.ng-t{color:#f47}.rx-t{color:#61dafb}.vue-t{color:#42b883}
.dv2-extras{border-top:1px solid var(--border)}
.dv2-extra{border-bottom:1px solid var(--border)}
.dv2-extra:last-child{border-bottom:none}
.dv2-extra-hdr{display:flex;align-items:center;gap:8px;padding:7px 16px;cursor:pointer;user-select:none;font-family:var(--mono);font-size:10px;color:var(--dim);transition:color .1s}
.dv2-extra-hdr:hover{color:var(--text)}
.ex-caret{font-size:8px;transition:transform .15s}
.dv2-extra.open .ex-caret{transform:rotate(90deg)}
.dv2-extra-body{display:none;padding:12px 16px;font-size:12.5px;color:var(--dim);line-height:1.6;background:#0a0c10}
.dv2-extra.open .dv2-extra-body{display:block}
.dv2-extra-body code{font-family:var(--mono);font-size:11px;color:var(--blue)}
.ci{display:flex;gap:8px;margin-bottom:5px;font-size:12.5px}
.ci:last-child{margin-bottom:0}
.carr{color:var(--green);font-family:var(--mono);flex-shrink:0}
@media(max-width:700px){
  .adr{grid-template-columns:1fr}
  .adr.hdr{display:none}
  .adc{border-right:none;border-bottom:1px solid var(--border)}
  .adc:last-child{border-bottom:none}
  .ann-comment{display:none}
  .ann-line{padding-right:10px}
}

/* ── Row expansion ──────────────────────────────────────── */
.row-wrap { display: block; border-bottom: 1px solid var(--border); min-width: 0; }
.row-wrap:last-child { border-bottom: none; }
.row-wrap:last-child:not(.expanded) > .row { border-radius: 0 0 4px 4px; }
.row-wrap .row { border-bottom: none; cursor: pointer; }
.row-wrap:nth-child(even) .row { background: var(--bg-alt); }
.row-wrap .row:hover { background: #161c24; }
.row-wrap:nth-child(even) .row:hover { background: #161c24; }
.row-wrap.expanded .row { background: #161c24 !important; border-bottom: 1px solid var(--border-hi); }
.row-wrap.expanded { border-color: var(--border-hi); overflow: hidden; }
.row-detail {
  display: none; padding: 22px 22px 26px; background: #0c0f13;
  border-top: 1px dashed var(--border); min-width: 0; max-width: 100%;
}
.row-wrap.expanded .row-detail { display: block; }
.row-exp-icon { font-size: 9px; color: var(--dim); margin-right: 6px; display: inline-block; transition: transform .15s; }
.row-wrap.expanded .row-exp-icon { transform: rotate(90deg); color: var(--blue); }
/* placeholder */
.detail-placeholder { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--dim); padding: 4px 0; }
.ph-icon { color: var(--orange); font-size: 16px; }
.detail-placeholder code { color: var(--blue); }
.detail-placeholder strong { color: var(--text); }
/* ── Detail content styles (from chunk2) ─────────────────── */
.slabel { font-family: var(--mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; margin-top: 22px; }
.slabel:first-child { margin-top: 0; }
.desc { color: var(--text); font-size: 13px; line-height: 1.65; }
.desc code { font-family: var(--mono); font-size: 11.5px; color: var(--blue); display: inline; }
.desc strong { color: var(--bright); display: inline; }
.sp { height: 14px; }
.fg { border: 1px solid var(--border); border-radius: 3px; overflow: hidden; margin-top: 0; }
.fg-title { background: #0a0c10; padding: 7px 14px; font-family: var(--mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--border); }
.fr { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); border-bottom: 1px solid var(--border); min-width: 0; }
.fr:last-child { border-bottom: none; }
.fk { padding: 10px 14px; font-family: var(--mono); font-size: 11.5px; color: var(--blue); background: #0d1117; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.fv { font-family: var(--mono); font-size: 10px; color: var(--green); }
.fv.warn { color: var(--orange); }
.fd { padding: 10px 14px; color: var(--text); line-height: 1.55; font-size: 13px; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.fd code { font-family: var(--mono); font-size: 11px; color: var(--blue); }
.fd strong { color: var(--bright); }
.badge { display: inline-block; font-family: var(--mono); font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 2px; letter-spacing: .04em; vertical-align: middle; margin-left: 4px; }
.b-ng  { background: rgba(221,0,49,.1);    color: #f47;           border: 1px solid rgba(221,0,49,.2); }
.b-rx  { background: rgba(97,218,251,.08); color: #61dafb;        border: 1px solid rgba(97,218,251,.15); }
.b-vue { background: rgba(66,184,131,.1);  color: var(--vue,#42b883); border: 1px solid rgba(66,184,131,.2); }
.b-warn{ background: rgba(240,136,62,.1);  color: var(--orange);  border: 1px solid rgba(240,136,62,.2); }
.metaphor { background: #0f1318; border: 1px solid var(--border); border-left: 3px solid var(--orange); padding: 12px 14px; border-radius: 2px; font-size: 13px; color: var(--dim); line-height: 1.65; }
.metaphor .ml { color: var(--orange); font-family: var(--mono); font-size: 10px; text-transform: uppercase; display: block; margin-bottom: 6px; letter-spacing: .08em; font-weight: 600; }
.warn-box { background: #0f1318; border: 1px solid var(--border); border-left: 3px solid var(--red); padding: 12px 14px; border-radius: 2px; font-size: 13px; color: var(--dim); line-height: 1.65; }
.warn-box .wl { color: var(--red); font-family: var(--mono); font-size: 10px; text-transform: uppercase; display: block; margin-bottom: 6px; letter-spacing: .08em; font-weight: 600; }
.warn-box code { font-family: var(--mono); font-size: 11px; color: var(--blue); }
.conn-box { background: #0d1117; border: 1px solid var(--border); border-radius: 2px; padding: 12px 14px; }
.ci { display: flex; gap: 10px; font-size: 12.5px; color: var(--dim); margin-bottom: 6px; line-height: 1.55; }
.ci:last-child { margin-bottom: 0; }
.arr { color: var(--green); font-family: var(--mono); flex-shrink: 0; }
.ci code { font-family: var(--mono); font-size: 11px; color: var(--blue); }
.diff { border: 1px solid var(--border); border-radius: 3px; overflow: hidden; font-size: 12.5px; }
.diff-row { display: grid; grid-template-columns: 100px 1fr 1fr 1fr; border-bottom: 1px solid var(--border); }
.diff-row:last-child { border-bottom: none; }
.diff-hdr .dc { background: #0a0c10; font-family: var(--mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.dc { padding: 8px 12px; border-right: 1px solid var(--border); line-height: 1.5; }
.dc:last-child { border-right: none; }
.dc code { font-family: var(--mono); font-size: 11px; color: var(--blue); }
.dc .ng-t  { color: #f47; } .dc .rx-t { color: #61dafb; } .dc .vue-t { color: #42b883; }
pre.code { background: #090b0e; border: 1px solid var(--border); border-radius: 3px; padding: 14px 16px; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; overflow-x: auto; white-space: pre; margin-top: 0; }
.kw { color: #a371f7; } .str { color: #3fb950; } .k { color: #2a8aff; } .cm { color: #3a4656; font-style: italic; } .num { color: #f0883e; }
@media (max-width: 700px) {
  .fr { grid-template-columns: 1fr; }
  .fk { border-right: none; border-bottom: 1px solid var(--border); }
  .diff-row { grid-template-columns: 1fr; }
  .diff-hdr { display: none; }
  .dc { border-right: none; border-bottom: 1px solid var(--border); }
  .dc:last-child { border-bottom: none; }
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 700px) {
  body { padding: 20px 14px; }

  .hdr-title { font-size: 17px; }

  .stats { gap: 10px; }
  .stat-div { display: none; }

  /* Group header: truncate title on small screens */
  .g-title { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-count { font-size: 10px; }

  /* Hide table header on mobile */
  .tbl-head { display: none; }

  /* Switch from grid to card layout per row */
  .row-wrap .row {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  /* Mobile: filename row — full width, flex row with tag inline */
  .col-file {
    border-right: none;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    padding: 9px 12px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
  }

  /* Tag: hide in its own column, shown via JS appended clone inside col-file */
  .col-tag { display: none; }

  .col-desc {
    padding: 8px 12px 10px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }

  /* Hide "covered in" column on mobile — not critical info */
  .col-chunk { display: none; }

  /* Remove alternating bg on mobile cards — less visual noise */
  .row:nth-child(even) { background: transparent; }
  

  /* Tighten group header */
  .group-hdr { padding: 8px 12px; gap: 8px; }
  .g-num { width: 22px; height: 22px; font-size: 9px; }
}

/* Tags */
.tag { font-family: var(--mono); font-size: 9px; font-weight: 600; padding: 2px 5px; border-radius: 2px; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; display: inline-block; }
.both { background: rgba(240,136,62,.1); color: var(--orange); border: 1px solid rgba(240,136,62,.25); }
.ng   { background: rgba(221,0,49,.1);   color: #f47;          border: 1px solid rgba(221,0,49,.25); }
.rx     { background: rgba(97,218,251,.08); color: #61dafb;        border: 1px solid rgba(97,218,251,.2); }
.vue    { background: rgba(66,184,131,.1);   color: var(--vue);      border: 1px solid rgba(66,184,131,.3); }
.rx-vue { background: rgba(66,184,131,.07);  color: #61dafb;         border: 1px solid rgba(97,218,251,.2); white-space: nowrap; font-size: 9px; padding: 2px 5px; }

/* Chunk badge */
.chunk { font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 2px; background: #161b22; color: var(--dim); border: 1px solid var(--border); }
.chunk.critical {
  background: rgba(240,136,62,.13); color: #f0883e;
  border: 1px solid rgba(240,136,62,.25); font-weight: 600; letter-spacing: .04em;
}
.chunk.minor {
  background: rgba(150,100,255,.10); color: #9b72f5;
  border: 1px solid rgba(150,100,255,.22); font-weight: 600; letter-spacing: .04em; font-style: italic;
}

/* Footer */
.footer {
  margin-top: 28px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; font-family: var(--mono); font-size: 12px; color: var(--dim); line-height: 1.8;
}
.footer .ok { color: var(--green); }
.footer .chunk-plan { margin-top: 10px; }
.footer .cp-row { display: flex; gap: 12px; margin-bottom: 3px; }
.footer .cp-num { color: var(--blue); width: 70px; flex-shrink: 0; }

/* ── Tabs ─────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px; margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tab-btn {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 11px 20px; cursor: pointer; background: none;
  border: none; border-bottom: 2px solid transparent;
  color: var(--dim); letter-spacing: .08em; text-transform: uppercase;
  transition: color .15s, border-color .15s, background .15s;
  position: relative; top: 1px;
  display: flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--text); background: rgba(42,138,255,.04); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-btn .tab-icon { font-size: 12px; opacity: .8; }
.tab-pane { display: none; }
.tab-pane.active { display: block !important; visibility: visible !important; opacity: 1 !important; }

/* ── Graph view ───────────────────────────────────── */
/* The graph tab keeps its toolbar (filter + search) inside the centered
   body width — only the canvas itself breaks out to full viewport width.
   When active, the body is locked to viewport height so nothing scrolls. */
/* Graph mode: lock body to viewport so the canvas can fit exactly. */
body.graph-mode {
  overflow: hidden;
  height: 100vh;
  padding-bottom: 0;   /* allow canvas to reach the viewport bottom */
}
body.graph-mode .footer { display: none; }  /* footer belongs to list tab */

.graph-shell {
  background: transparent; border: none;
  border-radius: 0; padding: 0;
}
.graph-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.graph-toolbar .gt-label {
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  letter-spacing: .08em; text-transform: uppercase;
}
.gt-search {
  flex: 1; min-width: 220px;
  background: var(--bg-row); border: 1px solid var(--border);
  border-radius: 3px; padding: 7px 12px; color: var(--bright);
  font-family: var(--mono); font-size: 12px; outline: none;
  transition: border-color .15s;
}
.gt-search:focus { border-color: var(--blue); }
.gt-search::placeholder { color: var(--dim); }

/* Stage: full-width row = canvas + resize handle + side panel */
.graph-stage {
  --graph-panel-w: 360px;
  position: relative;
  display: flex;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: 400px;  /* placeholder — overridden by JS */
  overflow: hidden;
  background: #0a0c10;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.graph-stage.panel-collapsed .graph-resizer,
.graph-stage.panel-collapsed .graph-side {
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border: none;
}
body.graph-resizing { cursor: col-resize; user-select: none; }
body.graph-resizing .graph-canvas { cursor: col-resize !important; }

.graph-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none; border-radius: 0;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(42,138,255,.04) 0, transparent 60%),
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

.graph-resizer {
  flex: 0 0 18px;
  width: 18px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  background: transparent;
}
.graph-resizer::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: var(--border);
  transition: background .12s, width .12s, box-shadow .12s;
  pointer-events: none;
}
.graph-resizer:hover::before,
.graph-resizer.dragging::before {
  width: 5px;
  background: rgba(42,138,255,.55);
  box-shadow: -2px 0 10px rgba(42,138,255,.2);
}

.graph-side {
  flex: 0 0 var(--graph-panel-w);
  width: var(--graph-panel-w);
  min-width: 260px;
  max-width: 72vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  overflow: hidden;
}
.graph-side-hdr {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.graph-side-collapse {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
  color: var(--dim);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.graph-side-collapse:hover {
  color: var(--bright);
  border-color: #2a3340;
  background: #161b22;
}
.graph-panel-reopen {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 26px;
  height: 72px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 4px 0 0 4px;
  background: #0d1117;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: color .12s, background .12s, border-color .12s;
}
.graph-panel-reopen:hover {
  color: var(--blue);
  background: #161b22;
  border-color: rgba(42,138,255,.35);
}
.graph-stage.panel-collapsed .graph-panel-reopen { display: flex; }
.graph-side-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.graph-side-empty-inner {
  text-align: center;
  max-width: 220px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #4a5568;
  line-height: 1.6;
}
.graph-side-empty-inner p { margin: 0; }
.graph-side-empty-hint {
  margin-top: 10px;
  font-size: 10px;
  color: #3d4654;
  line-height: 1.5;
}
.graph-side.has-selection .graph-side-empty { display: none; }
.graph-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.graph-canvas.dragging { cursor: grabbing; }
.graph-canvas.over-node { cursor: pointer; }

/* Shared overlay panel look — used by legend, controls, stats, hint, info */
.gp-panel {
  background: rgba(11,13,17,.78);
  border: 1px solid rgba(40,48,60,.7);
  border-radius: 4px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Stats badge (top-left) ───────────────────────── */
.graph-stats {
  position: absolute; top: 16px; left: 16px;
  display: flex; gap: 10px; align-items: center;
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  padding: 6px 11px; letter-spacing: .08em; text-transform: uppercase;
  pointer-events: none;
}
.graph-stats .gs-val { color: var(--bright); font-weight: 600; }
.graph-stats .gs-sep { color: rgba(120,140,170,.35); }

/* ── Legend (bottom-left) ─────────────────────────── */
.graph-legend {
  position: absolute; bottom: 16px; left: 16px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-family: var(--mono); font-size: 9.5px; color: var(--dim);
  padding: 7px 12px; letter-spacing: .06em;
  pointer-events: auto; max-width: calc(100% - 32px);
}
.glg {
  display: inline-flex; align-items: center; gap: 5px;
  /* Reset properties so legend items can't be styled by collisions with
     framework-tag classes (.both, .ng, .rx, .vue, .rx-vue). */
  background: none !important; border: none !important; padding: 2px 4px !important;
  color: var(--dim); font-size: 9.5px; font-family: var(--mono);
  line-height: 1; letter-spacing: .06em;
  cursor: pointer; border-radius: 3px;
  transition: color .12s, background .12s;
  user-select: none;
}
.glg:hover { color: var(--text); background: rgba(42,138,255,.08) !important; }
.glg.active { color: var(--bright); background: rgba(42,138,255,.14) !important; }
.glg.active .glg-dot { transform: scale(1.35); }
.glg:focus-visible { outline: 1px solid var(--blue); outline-offset: 2px; }
.glg-dot { transition: transform .12s, box-shadow .12s; }
.glg-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.glg.l-proj  .glg-dot { background: #f0c049; box-shadow: 0 0 4px rgba(240,192,73,.6); }
.glg.l-group .glg-dot { background: #2a8aff; }
.glg.l-ng    .glg-dot { background: #f47; }
.glg.l-rx    .glg-dot { background: #61dafb; }
.glg.l-vue   .glg-dot { background: #42b883; }
.glg.l-both  .glg-dot { background: #f0883e; }
.glg.l-rxvue .glg-dot { background: #7ec5b3; }

/* ── Controls (top-right) — single horizontal row ─── */
.graph-controls {
  position: absolute; top: 16px; right: 16px;
  display: flex; gap: 1px;
  padding: 2px;
  overflow: hidden;
}
.gc-btn {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 6px 11px; min-width: 0;
  background: transparent; border: none;
  color: var(--dim); cursor: pointer;
  letter-spacing: .06em; text-transform: uppercase;
  transition: color .12s, background .12s;
  border-radius: 2px;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.gc-btn:hover { color: var(--bright); background: rgba(42,138,255,.10); }
.gc-btn:active { background: rgba(42,138,255,.18); }
.gc-btn .gc-ico {
  display: inline-block; min-width: 10px; text-align: center;
  color: var(--blue); font-weight: 700;
}
.gc-sep { width: 1px; background: rgba(40,48,60,.6); margin: 6px 0; }

/* ── Side inspector panel (full height) ───────────── */
.graph-info {
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  flex-direction: column;
  padding: 14px 16px 18px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text);
  line-height: 1.55;
  overflow-y: auto;
  overflow-x: hidden;
}
.graph-info.visible {
  display: flex;
}
.graph-info.has-code .gi-desc { max-height: 4.5em; }
.gi-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.gi-panel-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gi-close {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
  color: var(--dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .12s, border-color .12s, background .12s;
}
.gi-close:hover { color: var(--bright); border-color: #2a3340; background: #161b22; }
.gi-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.gi-code {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(40,48,60,.6);
  min-width: 0;
}
.gi-code .dv2-header { padding: 5px 12px; }
.gi-code .dv2-hint { font-size: 9px; }
.gi-code .ann-block { font-size: 11px; }
.gi-code .ann-line { cursor: pointer; }
.gi-code .ann-expand { display: none; margin-left: 12px; margin-right: 8px; font-size: 11.5px; }
.gi-code .ann-field.active .ann-expand.visible { display: block; }
.gi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gi-title-block { flex: 1; min-width: 0; }
.gi-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.gi-name { color: var(--bright); font-weight: 600; font-size: 12.5px; font-family: var(--mono); word-break: break-all; }
.gi-fw   { color: var(--blue); font-size: 9.5px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase;
           padding: 1px 6px; background: rgba(42,138,255,.10); border-radius: 2px; border: 1px solid rgba(42,138,255,.25); }
.gi-level.chunk { font-size: 10px; padding: 2px 8px; border-radius: 3px; cursor: default; }
.gi-level-hint {
  margin-top: 5px; font-size: 10px; line-height: 1.45; font-family: var(--mono);
}
.gi-level-hint::before { content: '↳ '; color: #4a5568; }
.gi-level-hint--critical { color: rgba(240,136,62,.9); }
.gi-level-hint--minor { color: rgba(155,114,245,.9); font-style: italic; }
.gi-grp  { color: #6b7785; font-size: 9.5px; font-family: var(--mono); letter-spacing: .04em; flex-shrink: 0; text-align: right; max-width: 42%; }
.gi-desc { color: var(--dim); margin-top: 7px; font-size: 11.5px; line-height: 1.55; max-height: 5.5em; overflow: hidden; }
.gi-desc code { font-family: var(--mono); font-size: 10.5px; color: var(--blue); background: rgba(42,138,255,.08); padding: 1px 4px; border-radius: 2px; }
.gi-conn { color: var(--dim); margin-top: 8px; font-size: 10.5px; font-family: var(--mono); padding-top: 7px; border-top: 1px solid rgba(40,48,60,.6); }
.gi-conn b { color: var(--green); font-weight: 600; letter-spacing: .04em; }
.gi-conn .gi-pill { display: inline-block; background: rgba(40,48,60,.5); border: 1px solid rgba(60,70,85,.6); border-radius: 2px; padding: 1px 6px; margin: 2px 2px 0 0; color: var(--text); font-size: 9.5px; }

/* ── Hint (bottom-right) — replaced by info on click ─ */
.graph-hint {
  position: absolute; bottom: 16px; right: 16px;
  font-family: var(--mono); font-size: 9.5px; color: #5a6878;
  padding: 6px 11px; letter-spacing: .04em;
  pointer-events: none;
}
.graph-hint .gh-sep { color: rgba(120,140,170,.3); margin: 0 6px; }
.graph-hint kbd {
  font-family: var(--mono); font-size: 9px;
  background: rgba(40,48,60,.5); border: 1px solid rgba(60,70,85,.6);
  border-radius: 2px; padding: 0 4px; color: var(--text);
  margin-right: 4px;
}
.graph-stage:has(.graph-side.has-selection) .graph-hint { display: none; }

@media (max-width: 700px) {
  .graph-legend { font-size: 9px; gap: 8px; padding: 6px 9px; }
  .gc-btn { font-size: 9px; padding: 5px 8px; min-width: 64px; }
  .tab-btn { padding: 9px 14px; font-size: 10px; }
}
