:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --border: #e4e4e7;
  --accent: #2563eb;
  --card: #fff;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --covered: #22c55e;
  --uncovered: #ef4444;
  --partial: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

.tc-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 120px;
}

.tc-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tc-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.tc-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.tc-version {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 4px;
}

.tc-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.tc-meta code {
  background: #f1f1f1;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--mono);
}

.tc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tc-links a {
  font-size: 13px;
  background: #eff6ff;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #dbeafe;
}
.tc-links a:hover {
  background: #dbeafe;
}

.tc-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.tc-content h2 {
  margin-top: 0;
}

/* coverage badges */
.tc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tc-badge.covered {
  background: #dcfce7;
  color: #15803d;
}
.tc-badge.uncovered {
  background: #fee2e2;
  color: #b91c1c;
}
.tc-badge.partial {
  background: #fef3c7;
  color: #92400e;
}
.tc-badge.product {
  background: #ede9fe;
  color: #6d28d9;
}

/* per-product tags inside coverage table — one distinct hue per product */
.tc-product-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 4px 4px 0;
  white-space: nowrap;
}
.tc-product-chat        { background: #dbeafe; color: #1d4ed8; }
.tc-product-concierge   { background: #fce7f3; color: #be185d; }
.tc-product-distro      { background: #ffedd5; color: #c2410c; }
.tc-product-agents      { background: #cffafe; color: #0e7490; }
.tc-product-orchestrator{ background: #ede9fe; color: #6d28d9; }
.tc-product-chilical    { background: #dcfce7; color: #15803d; }
.tc-product-ecosystem   { background: #fef3c7; color: #92400e; }
.tc-product-edge-api    { background: #fee2e2; color: #b91c1c; }
.tc-product-handoff     { background: #f3e8ff; color: #7e22ce; }
.tc-product-shared      { background: #f1f5f9; color: #475569; }

/* product sections on index */
.tc-product {
  margin-top: 28px;
}
.tc-product h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.tc-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.tc-page-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.tc-page-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.1);
}
.tc-page-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f4f4f5;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  line-height: 0;
}
.tc-page-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.tc-page-card-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}
.tc-page-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tc-page-card-title {
  font-weight: 600;
  font-size: 14px;
}
.tc-page-card-path {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}
.tc-page-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* per-page coverage layout */
.tc-page-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .tc-page-split {
    grid-template-columns: 1fr;
  }
}

/* Per-page layout v2: viewport-locked, screenshot on top, scrollable table below.
   No outer page scroll — image stays visible while user scrolls element rows. */
body.tc-page-body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
}
.tc-page-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  gap: 10px;
  max-width: none;
  box-sizing: border-box;
}
.tc-page-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}
.tc-back-inline {
  margin-bottom: 0;
}
.tc-page-h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.tc-page-url {
  font-family: var(--mono);
  font-size: 12px;
  background: #f1f1f1;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--muted);
}
.tc-page-stats {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.tc-page-stats strong {
  color: var(--fg);
  font-family: var(--mono);
}
.tc-page-pct {
  font-weight: 700;
  font-family: var(--mono);
  color: var(--fg);
}
.tc-page-details {
  width: 100%;
}
.tc-page-details summary {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.tc-page-details summary:hover {
  text-decoration: underline;
}
.tc-page-details-body {
  padding: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tc-page-details-body p {
  margin: 0;
}
.tc-page-details-body code {
  background: #f1f1f1;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--mono);
}
.tc-page-open-btn {
  align-self: flex-start;
  font-size: 13px;
  background: #eff6ff;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #dbeafe;
}
.tc-page-open-btn:hover {
  background: #dbeafe;
}

.tc-screenshot-section {
  background: #f4f4f5;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.tc-screenshot-section .tc-screenshot-wrap {
  position: relative;
  display: block;
  max-height: 50vh;
  max-width: 100%;
  line-height: 0;
}
.tc-screenshot-section .tc-screenshot-wrap img {
  display: block;
  max-height: 50vh;
  max-width: 100%;
  height: auto;
  width: auto;
  border-radius: 4px;
}

.tc-table-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tc-table-section .tc-coverage-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Legacy hub-page screenshot styles (left intact for the per-page-grid cards). */
.tc-screenshot {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f4f4f5;
  position: sticky;
  top: 16px;
}
.tc-screenshot-wrap {
  position: relative;
  display: block;
  line-height: 0;
}
.tc-screenshot-wrap img {
  display: block;
  width: 100%;
  height: auto;
}
.tc-hotspot {
  position: absolute;
  border: 2px solid rgba(239, 68, 68, 0.95);
  background: rgba(239, 68, 68, 0.18);
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7) inset;
}
.tc-hotspot.covered {
  border-color: rgba(34, 197, 94, 0.95);
  background: rgba(34, 197, 94, 0.18);
}
.tc-hotspot.active {
  opacity: 1;
}
.tc-coverage-table tbody tr {
  cursor: pointer;
}
.tc-coverage-table tbody tr:hover {
  background: #f8fafc;
}
.tc-coverage-table tbody tr.uncovered:hover {
  background: #fee2e2;
}

.tc-coverage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tc-coverage-table th,
.tc-coverage-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.tc-coverage-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  background: #fafafa;
}
.tc-coverage-table code {
  font-family: var(--mono);
  font-size: 12px;
  background: #f1f1f1;
  padding: 1px 6px;
  border-radius: 4px;
  word-break: break-all;
}
.tc-coverage-table tr.uncovered td {
  background: #fef2f2;
}

.tc-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.tc-summary-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.tc-summary-cell .num {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
}
.tc-summary-cell .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 4px;
}

.tc-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 20px 0 8px;
}

.tc-back {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}
.tc-back:hover {
  text-decoration: underline;
}

.tc-empty {
  color: var(--muted);
  font-style: italic;
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: 13px;
}
