:root {
  --trimble-navy: #002d5b;
  --trimble-blue: #005596;
  --trimble-light-blue: #2f95d2;
  --trimble-sky: #e8f4fd;
  --trimble-gold: #ffc425;
  --trimble-gold-light: #ffd966;
  --trimble-green: #0fa05a;
  --trimble-check: #148c4b;

  --grey-dark: #b0b3b5;
  --grey-light: #d1d3d4;
  --surface: #ffffff;
  --border: #e0e4ea;
  --text: #1a2332;
  --text-secondary: #5a6577;
  --text-light: #8892a4;
  --shadow: 0 2px 12px rgba(0,0,0,.1);

  --card-side-margin: 30px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  background: linear-gradient(to bottom, var(--grey-light) 25vh, var(--grey-dark) 25vh);
  background-attachment: fixed;
}

/* ══════════════════════════════════════════════════════
   BLUE BADGE — fixed, overlaps white card
   ══════════════════════════════════════════════════════ */
.blue-badge {
  position: fixed;
  top: 0;
  right: calc(var(--card-side-margin) + 30px);
  width: 320px;
  background: var(--trimble-blue);
  padding: 20px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.blue-badge__logo {
  height: 40px;
}

.blue-badge__division {
  color: rgba(255,255,255,.85);
  font-size: .95rem;
  font-weight: 300;
  letter-spacing: .03em;
  margin-bottom: 4px;
}

.blue-badge__search {
  position: relative;
  width: 100%;
}

.blue-badge__search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.6);
  pointer-events: none;
}

.blue-badge__search-input {
  width: 100%;
  padding: 7px 28px 7px 28px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  font-size: .8rem;
  color: #fff;
  background: rgba(255,255,255,.15);
  outline: none;
  transition: border-color .15s, background .15s;
}

.blue-badge__search-input::placeholder {
  color: rgba(255,255,255,.5);
}

.blue-badge__search-input:focus {
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.25);
}

.blue-badge__search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 2px 4px;
  display: none;
  font-size: 1rem;
  line-height: 1;
}

.blue-badge__search-clear.visible { display: block; }
.blue-badge__search-clear:hover { color: #fff; }

/* ══════════════════════════════════════════════════════
   PAGE NAV — scrolls with content, sits in grey area
   ══════════════════════════════════════════════════════ */
.page-nav {
  padding: 28px var(--card-side-margin) 14px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.page-nav__link {
  padding: 0;
  border: none;
  background: none;
  color: var(--trimble-blue);
  font-size: 1.3rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  transition: color .15s ease;
  white-space: nowrap;
}

.page-nav__link:hover {
  color: var(--trimble-navy);
  text-decoration: underline;
}

.page-nav__link.active {
  color: var(--trimble-navy);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   WHITE CONTENT CARD
   ══════════════════════════════════════════════════════ */
.content-card {
  position: relative;
  margin: 0 var(--card-side-margin);
  background: var(--surface);
  min-height: 60vh;
  box-shadow: var(--shadow);
}

.card-header {
  padding: 36px 30px 30px;
}

.card-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--trimble-blue);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.card-subtitle {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 16px;
}

/* ── Toolbar: section toggles ────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-toggles {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.section-toggles__label {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-right: 4px;
}

.toggle-btn {
  padding: 8px 18px;
  border: 1px solid var(--trimble-light-blue);
  background: var(--surface);
  color: var(--trimble-blue);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

.toggle-btn:hover {
  border-color: #000;
  color: #000;
}

.toggle-btn.active {
  background: var(--trimble-blue);
  border-color: var(--trimble-blue);
  color: #fff;
}

.toggle-btn.active:hover {
  background: var(--trimble-navy);
  border-color: var(--trimble-navy);
}

.search-count {
  font-size: .78rem;
  color: var(--text-light);
  white-space: nowrap;
  margin-left: auto;
}

/* ── Table Scroll Area ───────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0 30px;
  padding-bottom: 30px;
}

/* ══════════════════════════════════════════════════════
   MATRIX TABLE
   ══════════════════════════════════════════════════════ */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  table-layout: fixed;
}
.matrix-table td:first-child,
.matrix-table th:first-child {
  width: 30%;
}

.matrix-table th,
.matrix-table td {
  padding: 0;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--trimble-navy);
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 10px 8px;
  font-size: .78rem;
  letter-spacing: .02em;
}

.matrix-table thead th:first-child {
  text-align: left;
  padding-left: 16px;
  position: sticky;
  left: 0;
  z-index: 12;
  background: var(--trimble-navy);
}

.tier-row th {
  padding: 6px 8px;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tier-row th:first-child { background: #fff !important; }
.tier-row th,
.icon-row th {
  border: none !important;
}
.tier-good { background: #d2eaf8 !important; color: var(--trimble-navy) !important; }
.tier-better { background: #9fd3f0 !important; color: var(--trimble-navy) !important; }
.tier-best { background: #5fb2df !important; color: #fff !important; }
.tier-specialty { background: #fdbc5d !important; color: var(--trimble-navy) !important; }

.icon-row th {
  padding: 8px;
  background: var(--surface) !important;
  border-bottom: none;
}

.icon-row th:first-child {
  background: var(--surface) !important;
}

.icon-row th img {
  height: 28px;
  opacity: .7;
}
.sub-table .icon-row th img {
  height: auto;
  width: 100%;
  max-width: 80px;
  opacity: 1;
}

.matrix-table.wf-table {
  table-layout: fixed;
}
.matrix-table.wf-table td:first-child,
.matrix-table.wf-table th:first-child {
  width: 25%;
}
.matrix-table.wf-table .icon-row th img {
  height: auto;
  width: 100%;
  max-width: 80px;
  opacity: 1;
}

.col-header-row th {
  background: #0e6ba9 !important;
  color: #fff !important;
  font-weight: 700;
  font-size: .78rem;
  padding: 10px 8px;
}

.col-header-row th:first-child {
  background: #0e6ba9 !important;
  color: #fff !important;
}

.matrix-table:not(.sub-table) .col-header-row th,
.matrix-table:not(.sub-table) .col-header-row th:first-child {
  background: #002d5b !important;
}

.section-header-row td {
  background: var(--trimble-sky);
  font-weight: 700;
  color: var(--trimble-navy);
  font-size: .82rem;
  padding: 10px 16px;
  border-bottom: 2px solid var(--trimble-light-blue);
}

.section-header-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--trimble-sky);
}

.matrix-table tbody tr {
  transition: background .1s;
}
.matrix-table tbody tr:hover {
  background: #f0f5ff;
}

.matrix-table tbody tr:hover td:first-child {
  background: #f0f5ff;
}

.matrix-table tbody td:first-child {
  text-align: left;
  padding: 6px 16px;
  font-weight: 400;
  color: var(--text);
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  border-right: 2px solid var(--border);
}

.matrix-table tbody td {
  text-align: center;
  padding: 6px 4px;
}

.check {
  color: var(--trimble-check);
  font-size: 1rem;
}

.check svg {
  width: 16px;
  height: 16px;
  fill: var(--trimble-check);
}

.matrix-table tbody td:nth-child(even) {
  background-color: rgba(0,85,150,.02);
}

.matrix-table tbody tr:hover td:nth-child(even) {
  background-color: transparent;
}

.section-group-row td:first-child {
  padding: 8px 16px;
  vertical-align: top;
}

.section-group-title {
  font-weight: 700;
  color: var(--trimble-navy);
  font-size: .82rem;
  margin-bottom: 4px;
}

.section-single-title {
  font-weight: 400;
  color: var(--trimble-navy);
  font-size: .82rem;
}

.section-group-category {
  font-style: italic;
  color: var(--trimble-blue);
  font-size: .78rem;
  margin-top: 4px;
  margin-bottom: 2px;
}

.section-group-item {
  font-size: .8rem;
  color: var(--text-secondary);
  padding-left: 12px;
  line-height: 1.6;
}

.col-good { background-color: rgba(0,45,91,.04) !important; }
.col-better { background-color: rgba(0,85,150,.04) !important; }
.col-best { background-color: rgba(47,149,210,.04) !important; }
.col-specialty { background-color: rgba(255,217,102,.06) !important; }

.matrix-table tbody tr.filtered-out {
  display: none;
}

.matrix-table tbody tr.search-highlight td:first-child {
  background: #fffde7;
}

/* ── Workflow Descriptions ───────────────────────────── */
.workflow-desc {
  padding: 20px 0;
}

.workflow-desc h3 {
  color: var(--trimble-blue);
  font-size: 1.1rem;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--trimble-gold);
}

.workflow-desc h3:first-child { margin-top: 0; }

.workflow-desc-intro {
  font-size: .9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.workflow-desc-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f5;
}

.workflow-desc-item strong {
  color: var(--trimble-blue);
  flex: 0 0 280px;
}

.workflow-desc-item span {
  color: var(--text-secondary);
}

/* ── Overview / Equivalencies (bracket diagram) ─────── */
.overview-content {
  padding: 32px 30px 30px;
}

.ov-entry {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.ov-left {
  font-weight: bold;
  color: var(--trimble-blue);
  font-size: 18px;
  position: relative;
  width: 42%;
  height: 30px;
  line-height: 30px;
  display: block;
  float: left;
  margin-left: 5%;
  background-image: linear-gradient(var(--trimble-gold), var(--trimble-gold));
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 50%;
}

.ov-left > span {
  background: var(--surface);
  padding-right: 20px;
  position: relative;
}

.ov-left > em {
  font-style: normal;
  color: var(--trimble-gold);
  font-size: 16px;
  float: right;
  margin-right: 0;
}

.ov-left > span > strong {
  font-size: 16px;
  font-weight: 400;
  color: var(--trimble-gold);
  position: absolute;
  top: -3px;
  right: -1px;
}

.ov-right {
  width: 40%;
  display: inline-block;
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.ov-right li {
  position: relative;
  padding: 0 0 0 10px;
  margin: 0;
  display: block;
  width: 100%;
  height: 30px;
  line-height: 30px;
  font-size: 16px;
  font-weight: 400;
}

.ov-line {
  color: var(--trimble-gold);
  position: absolute;
  top: 0;
  left: -50px;
  width: 50px;
  text-align: right;
  background-image: linear-gradient(var(--trimble-gold), var(--trimble-gold));
  background-repeat: no-repeat;
  background-size: 97% 2px;
  background-position: 0 50%;
}

.ov-line::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 50%;
  background-color: var(--trimble-gold);
}

.ov-tick {
  position: absolute;
  top: -15px;
  left: -50px;
  width: 50px;
  height: 30px;
  background: none;
}

.ov-tick::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background-color: var(--trimble-gold);
}

.ov-divider {
  display: block;
  width: 80%;
  height: 20px;
  border-bottom: 2px dashed #ddd;
  margin: 0 auto 20px auto;
  clear: both;
}

.ov-footnote {
  padding-left: 10%;
  font-weight: 400;
  font-size: .9rem;
  color: var(--text-secondary);
  margin-top: 16px;
  clear: both;
}

/* ── No results ──────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}

.no-results p { font-size: 1rem; margin-bottom: 4px; }
.no-results small { font-size: .85rem; }

/* ══════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════ */
.site-footer {
  margin: 0 var(--card-side-margin);
  text-align: center;
}

.site-footer__copyright {
  font-size: .75rem;
  color: var(--text-secondary);
  padding: 14px 0;
}

.footer-bar {
  display: flex;
  height: 28px;
}

.footer-bar__blue-left {
  flex: 1;
  background: var(--trimble-blue);
}

.footer-bar__gold {
  flex: 0 0 40%;
  background: var(--trimble-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-bar__top {
  color: var(--trimble-navy);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
}

.footer-bar__top:hover {
  text-decoration: underline;
}

.footer-bar__blue-right {
  flex: 0 0 var(--card-side-margin);
  background: var(--trimble-blue);
}

/* ══════════════════════════════════════════════════════
   LOADING STATE
   ══════════════════════════════════════════════════════ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-light);
  gap: 12px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--trimble-blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .blue-badge { width: 260px; }
  .card-title { font-size: 2.4rem; }
}

@media (max-width: 900px) {
  :root { --card-side-margin: 16px; }
  .blue-badge {
    width: 220px;
    right: calc(var(--card-side-margin) + 12px);
    padding: 14px 16px 16px;
  }
  .blue-badge__logo { height: 30px; }
  .blue-badge__division { font-size: .72rem; }
  .page-nav { gap: 16px; }
  .page-nav__link { font-size: .78rem; }
  .card-header { padding: 24px 16px 16px; }
  .card-title { font-size: 2rem; }
  .toolbar { flex-wrap: wrap; }
  .section-toggles { flex-wrap: wrap; }
}

@media (max-width: 600px) {
  :root { --card-side-margin: 8px; }
  .blue-badge {
    width: 170px;
    right: calc(var(--card-side-margin) + 6px);
    padding: 10px 10px 12px;
  }
  .blue-badge__division { font-size: .65rem; }
  .page-nav { gap: 12px; flex-wrap: wrap; }
  .page-nav__link { font-size: .72rem; }
  .card-header { padding: 16px 8px 12px; }
  .card-title { font-size: 1.6rem; }
  .card-subtitle { font-size: .9rem; }
  .workflow-desc { padding: 16px 0; }
}
