:root {
  --border: #dee2e6;
  --muted: #6c757d;
  --bg: #f8f9fa;
  --tech: #b2b9ff;
  --section: #bed3f0;
  --purple: #6f42c1;
}

/* ===============================
   TABS
   =============================== */
.tm-tabs {
  width: 98%;
  margin-bottom: 1rem;
}

.tm-tablist {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tm-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.tm-tab[aria-selected="true"] {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.tm-panel[hidden] {
  display: none !important;
}

/* ===============================
   MATRIX (shared)
   =============================== */
.tm-scroll-area {
  max-height: calc(100vh - 220px);
  overflow: auto;
  position: relative;
}

.header-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  column-gap: 1rem;
  margin-bottom: 1rem;
  width: 98%;
  position: sticky;
  top: 0;
  z-index: 20;
  /*background: rgba(255, 255, 255, 0.746);*/
  background: #ffffff;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

/* Search stays as ONE unit */
.search-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-group input[type="search"] {
  width: 100%;
}

/* Buttons align with table right edge */
.header-actions {
  display: flex;
  gap: 0.5rem;
  justify-self: end;
}

input[type="search"] {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  min-width: 260px;
}

.techno-button {
  padding: 0.45rem 0.7rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  cursor: pointer;
}

.techno-table {
  position: relative;
  width: 98% !important;
  display: table !important;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
}

.main-tech td {
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 0px;
  background: var(--tech) !important;
}

.section td {
  font-weight: 700;
  color: var(--muted);
  border-radius: 0px;
  background: var(--section) !important; 
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid var(--border);
  margin: 0.1rem 0.25rem 0.1rem 0;
}

.badge-v2 {
  background: #e2e3e5;
  color: #41464b;
}

.badge-v3 {
  background: #d1e7dd;
  color: #0f5132;
}

.badge-q {
  background: #e7f1ff;
  color: #084298;
  border-color: #b6d4fe;
}

.ext-name {
  font-weight: 600;
  margin-right: 0.35rem;
}

.platform-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.tech-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.main-tech .muted {
  color: #2f3a4a;
  font-weight: 400;
}

/* ===== Main technology header layout + doc icon ===== */
.main-tech-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.main-tech-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Book icon link → expandable pill */
.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 999px;
  color: var(--purple);
  text-decoration: none;
  flex: 0 0 auto;
  /*background: transparent;*/
  transition: background 0.15s ease, padding 0.15s ease;
  opacity: 1;
  background: #fff;
}

.doc-link svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

/* hide label until hover 
.doc-link .doc-label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width 0.18s ease, opacity 0.15s ease;
  font-weight: 600;
  font-size: 0.82rem;
}*/

.doc-link:hover {
  background: var(--purple);
  color: #fff;
}

/*.doc-link:hover .doc-label {
  max-width: 140px;
  opacity: 1;
}*/

/* ===== Modals (scoped per matrix root) ===== */
.tm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.tm-modal.hidden {
  display: none;
}

.tm-modal .box {
  width: 420px;
  max-height: 70vh;
  overflow: auto;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  background: #fff;
}

.tm-modal .box > div:first-child {
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tm-list {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
}

.tm-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.3rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.tm-list img {
  width: 18px;
  height: 18px;
}

.modal-tech-icon {
  width: 28px;
  height: 28px;
  vertical-align: middle;
}

/* ===== Modal close button ===== */
.modal-close {
  appearance: none;
  border: none;
  background: #f1f3f5;
  color: #495057;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:focus {
  outline: 2px solid #adb5bd;
  outline-offset: 2px;
}

.modal-close:hover {
  background: #ffe3e3;
  color: #c92a2a;
}

/* Category info icon */
.cat-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  color: #2f6fed;
  background: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
  /* ← ADD THIS */
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.cat-info-btn:hover {
  background: #2f6fed;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.cat-info-btn::before {
  display: none;
  content: none;
}

.cat-info-btn:hover::before {
  opacity: 1;
}

.cat-info-btn:hover::after {
  opacity: 1;
}

.cat-info-btn:hover {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* Tooltip preview */
.cat-info-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 130%;
  top: 50%;
  transform: translateY(-50%);
  background: #212529;
  color: #fff;
  padding: 0.55rem 0.65rem;
  border-radius: 0.4rem;
  font-size: 0.78rem;
  line-height: 1.35;
  width: 260px;
  white-space: pre-line;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
}

/*.cat-info-btn:hover::after {
    opacity: 1;
  }*/

/* Header tooltip should open to the LEFT */
.header-bar .header-info-btn::after {
  left: auto;
  right: 0;
  top: 130%;
  transform: none;
}

[data-role="global-count"] {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.version-any {
  color: var(--muted);
  font-style: italic;
}

.header-info-btn {
  cursor: help;
}

.platform-notice {
  width: 98%;
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;

  border-left: 4px solid #2f6fed;
  background: #eef4ff;

  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.platform-notice strong {
  font-weight: 700;
}

.platform-links {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.platform-links a {
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;

  border: 1px solid #2f6fed;
  color: #2f6fed;
  background: white;

  font-weight: 600;
}

.platform-links a:hover {
  background: #2f6fed;
  color: white;
}
.product-header {
  width: 98%;
  margin-bottom: 1.2rem;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;

  padding: 0.9rem 1rem;

  border-left: 4px solid #2f6fed;
  background: #eef4ff;
  border-radius: 8px;
}

.product-title {
  font-weight: 700;
  font-size: 1rem;
}

.product-description {
  font-size: 0.9rem;
  color: #495057;
}

.product-links {
  text-align: right;
}

.product-links-label {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 0.3rem;
}

.product-links-list {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.product-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;

  padding: 0.35rem 0.65rem;
  border-radius: 999px;

  border: 1px solid #2f6fed;
  color: #2f6fed;
  background: white;
}

.product-link:hover {
  background: #2f6fed;
  color: white;
}