*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: #f8f9fb;
  color: #111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px 56px;
}

/* ── Header ── */
header {
  padding: 28px 0 18px;
  border-bottom: 3px solid #111;
  margin-bottom: 24px;
  background: #fff;
}
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.site-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0a0a0a;
}
.site-tagline {
  margin-top: 4px;
  color: #555;
  font-size: 14px;
}

/* ── Section titles ── */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

/* ── Scan input ── */
.scan-box {
  padding: 20px 22px;
  margin-bottom: 16px;
  border: 1px solid #d0d7de;
  border-top: 3px solid #0969da;
  background: #fff;
}
.scan-box label {
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #333;
}
.input-row { display: flex; gap: 8px; }
.input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: #111;
  outline: none;
}
.input-row input:focus {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,.14);
}
.input-row button {
  padding: 10px 20px;
  background: #0969da;
  color: #fff;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.input-row button:hover { background: #0757b8; }
.input-row button:disabled { opacity: 0.5; cursor: not-allowed; }
.status-line { margin-top: 7px; min-height: 17px; font-size: 13px; color: #555; }
.status-line.error { color: #cf222e; }
.status-line.ok    { color: #1a7f37; }

/* ── Table section header ── */
.table-section-header {
  padding-bottom: 10px;
  border-bottom: 2px solid #111;
  margin-bottom: 10px;
}
.table-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.table-section-title i { color: #0969da; margin-right: 2px; }

/* ── Toolbar ── */
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.toolbar-left, .toolbar-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.toolbar-left input[type="search"],
.toolbar-left select {
  padding: 7px 10px;
  border: 1px solid #d0d7de;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: #111;
  outline: none;
}
.toolbar-left input[type="search"] { width: 260px; }
.toolbar-left input[type="search"]:focus,
.toolbar-left select:focus {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,.12);
}
.meta-text, .page-num { color: #555; font-size: 13px; }
.page-btn {
  padding: 5px 11px;
  border: 1px solid #d0d7de;
  background: #fff;
  font: inherit;
  font-size: 12px;
  color: #333;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) { background: #f0f3f6; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #d0d7de;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 9px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #444;
  border-bottom: 1px solid #d0d7de;
  white-space: nowrap;
  background: #f6f8fa;
  vertical-align: middle;
}
thead .group-row th {
  font-size: 12px;
  font-weight: 800;
  border-bottom: 2px solid #d0d7de;
  letter-spacing: 0.04em;
}

/* Group header tints */
.grp-verdict      { background: #fff8f0 !important; color: #7d4e00 !important; border-top: 2px solid #f0a060 !important; }
.grp-repo         { background: #eef5ff !important; color: #1a3a7a !important; border-top: 2px solid #6ea8fe !important; }
.grp-skill-assess { background: #fdf5e8 !important; color: #5c3d00 !important; border-top: 2px solid #e0a840 !important; }
.grp-skill, .grp-meta { background: #f6f8fa !important; }

/* Column header tints */
thead tr:not(.group-row) th.col-verdict { background: #fff8f0; }
thead tr:not(.group-row) th.col-repo    { background: #eef5ff; }
thead tr:not(.group-row) th.col-skill   { background: #fdf5e8; }

/* Data rows */
tbody tr { border-bottom: 1px solid #eaecef; cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f6f8fa; }
tbody tr.selected-row { box-shadow: inset 3px 0 0 0 #555; }
tbody td { padding: 9px 12px; vertical-align: top; }

/* Column data tints */
td.verdict-cell { background: #fffdf8; }
td.repo-cell    { background: #f8fbff; }
td.skill-cell   { background: #fdf9f4; }

.loading-cell { text-align: center; color: #666; padding: 32px !important; background: #fff !important; }

.cell-skill a { color: #0969da; text-decoration: none; font-weight: 600; }
.cell-skill a:hover { text-decoration: underline; }
.path {
  display: block;
  color: #666;
  font-size: 11px;
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, "Liberation Mono", monospace;
}
.path-muted { color: #999; font-style: italic; }
.badge { display: inline-block; padding: 2px 6px; font-size: 11px; font-weight: 600; }
.badge-domain { background: #ddf4ff; color: #0550ae; }
.badge-root   { background: #fff3cd; color: #7d4e00; }

/* ── Score labels ── */
.score-pill, .overall-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.score-pill small { font-size: 10px; font-weight: 500; margin-left: 4px; opacity: 0.8; }
.score-empty { color: #888; font-size: 12px; }

.tone-good  { background: #d8f0e2; color: #1a7f37; }
.tone-ok    { background: #eaf5e0; color: #3a7017; }
.tone-warn  { background: #fff2c8; color: #7d4e00; }
.tone-bad   { background: #fde0e0; color: #b91c1c; }
.tone-muted { background: #ebebeb; color: #555; }

.verdict-benign     { background: #d8f0e2; color: #1a7f37; }
.verdict-uncertain  { background: #fff2c8; color: #7d4e00; }
.verdict-suspicious { background: #ffecd5; color: #9a4800; }
.verdict-high-risk  { background: #fde0e0; color: #b91c1c; }

.ts { color: #666; font-size: 12px; white-space: nowrap; }

/* ── Legend ── */
.score-legend {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #eaecef;
  font-size: 12px;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.leg-good { color: #1a7f37; font-weight: 600; }
.leg-warn { color: #7d4e00; font-weight: 600; }
.leg-bad  { color: #b91c1c; font-weight: 600; }
.overall-stats { margin-top: 8px; font-size: 12px; color: #666; }

/* ── Generic panel box ── */
.panel-box {
  margin-top: 20px;
  border: 1px solid #d0d7de;
  border-top: 3px solid #111;
  background: #fff;
}
.panel-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid #d0d7de;
}
.panel-subtitle { color: #666; font-size: 13px; font-weight: 400; margin-left: 8px; }

/* Results section: toolbar inside panel-box-header; table-wrap needs no outer border */
.results-section .table-wrap { border-left: none; border-right: none; border-bottom: none; }
.results-section .score-legend { padding: 9px 18px; }
.results-section .overall-stats { padding: 0 18px 12px; }

/* ── Distribution chart ── */
.overall-dist-panel { padding-bottom: 16px; }
.dist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid #eaecef;
  margin-bottom: 0;
}
.dist-cell {
  padding: 12px 8px 8px;
  border-right: 1px solid #eaecef;
}
.dist-cell:last-child { border-right: none; }
.dist-cell-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #444;
  margin-bottom: 6px;
}
.dist-ref-note { font-size: 11px; font-weight: 400; color: #888; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.dist-chart-el { height: 200px; width: 100%; }
.chart-legend { padding: 8px 18px 0; color: #666; font-size: 12px; }
.chart-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: #666;
  font-size: 13px;
  border: 1px dashed #d0d7de;
}

/* legacy aliases kept for compatibility */
.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.01em;
}

/* ── Report detail panel ── */
.report-collapsible {
  margin-top: 20px;
  border: 1px solid #d0d7de;
  border-top: 3px solid #111;
  background: #fff;
}
.report-collapsible summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  background: #fff;
}
.report-collapsible summary::-webkit-details-marker { display: none; }
.report-collapsible summary::after { content: 'Show'; color: #0969da; font-size: 12px; font-weight: 600; }
.report-collapsible[open] summary::after { content: 'Hide'; }
.report-collapsible[open] summary { border-bottom: 1px solid #d0d7de; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; }
.detail-card { padding: 16px 18px; }
.repo-card { border-right: 1px solid #d0d7de; background: #f8fbff; }
.skill-card-panel { background: #fdf9f4; }
.detail-card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #444;
}
.detail-verdict { margin-bottom: 12px; }
.detail-note { margin: 6px 0 0; color: #555; font-size: 13px; line-height: 1.4; }
.detail-stats { display: grid; gap: 4px; margin: 0; }
.detail-stats > div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 8px;
  background: rgba(255,255,255,0.8);
  border: 1px solid #eaecef;
}
.detail-stats dt { font-size: 12px; font-weight: 600; color: #444; }
.detail-stats dd { margin: 0; font-size: 13px; }
.cisco-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.cisco-findings {
  display: grid;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cisco-findings li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid #eaecef;
}
.cisco-severity { font-size: 11px; font-weight: 700; color: #555; }
.cisco-remediation { margin-top: 2px; color: #666; font-size: 12px; }

/* ── Info button + modal ── */
.info-btn {
  min-width: 86px;
  height: 36px;
  padding: 0 12px;
  background: #0969da;
  border: 1px solid #0757b7;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-shrink: 0;
}
.info-btn:hover { background: #0757b7; }
.info-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.info-modal {
  position: relative;
  background: #fff;
  max-width: 680px;
  width: calc(100% - 40px);
  max-height: 80vh;
  overflow-y: auto;
  padding: 26px 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  border: 1px solid #d0d7de;
  border-top: 3px solid #0969da;
}
.info-modal h2 { margin-top: 0; font-size: 20px; font-weight: 800; }
.info-modal h3 { margin-top: 18px; font-size: 14px; font-weight: 700; border-bottom: 1px solid #eaecef; padding-bottom: 4px; }
.info-modal p, .info-modal li { color: #333; font-size: 13px; margin: 4px 0; }
.info-repo-link {
  margin: 12px 0 18px !important;
}
.info-repo-link a {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  color: #0969da;
  text-decoration: none;
  font-weight: 700;
}
.info-repo-link a:hover { background: #eaecef; }
.info-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 20px; cursor: pointer; color: #666; line-height: 1; }
.info-close:hover { color: #111; }

footer {
  margin-top: 36px;
  padding-top: 12px;
  border-top: 1px solid #d0d7de;
  font-size: 12px;
  color: #777;
}
footer a { color: #0969da; text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 1000px) {
  .detail-grid { grid-template-columns: 1fr; }
  .repo-card { border-right: none; border-bottom: 1px solid #d0d7de; }
}
@media (max-width: 720px) {
  .page { padding: 0 12px 28px; }
  .input-row { flex-direction: column; }
  .toolbar-left, .toolbar-right { flex-direction: column; align-items: stretch; }
  .toolbar-left input[type="search"] { width: 100%; }
  thead th, tbody td { padding: 7px 8px; }
  #overall-chart { height: 260px; }
  .score-chart-tabs { width: 100%; }
  .chart-tab-btn { flex: 1; }
}
