:root {
  --ti-red: #cc0000;
  --ti-red-dark: #990000;
  --ti-black: #111111;
  --ti-ink: #202020;
  --ti-gray-900: #333333;
  --ti-gray-700: #555555;
  --ti-gray-500: #808080;
  --ti-gray-300: #d6d6d6;
  --ti-gray-200: #e9e9e9;
  --ti-gray-100: #f6f6f6;
  --ti-white: #ffffff;
  --ti-teal: #137f8c;
  --ti-blue: #1b5fa7;
  --ti-green: #2f7d32;
  --ti-amber: #9b6a00;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ti-ink);
  background: var(--ti-gray-100);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ti-black: #f4f6f8;
  --ti-ink: #e7ebf0;
  --ti-gray-900: #d5dae2;
  --ti-gray-700: #aeb6c2;
  --ti-gray-500: #7f8896;
  --ti-gray-300: #444c58;
  --ti-gray-200: #303742;
  --ti-gray-100: #141920;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  background: #10141a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ti-gray-100);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 5px solid var(--ti-red);
  background: var(--ti-white);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand:hover {
  filter: brightness(0.96);
}

.brand:hover h1,
.brand:focus-visible h1 {
  text-decoration: none;
}

.brand:focus-visible {
  outline: 3px solid rgba(204, 0, 0, 0.3);
  outline-offset: 6px;
}

.ti-mark {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--ti-red);
  font-size: clamp(30px, 4vw, 58px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

#sourceLine {
  margin-top: 5px;
  color: var(--ti-gray-700);
  font-size: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-button,
.reset-button,
.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: var(--ti-white);
  background: var(--ti-gray-900);
  font-weight: 700;
}

a.tool-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.tool-button:hover,
.reset-button:hover,
.segment:hover {
  filter: brightness(0.92);
}

.tool-button.primary {
  background: var(--ti-red);
}

.tool-button.theme-toggle {
  position: relative;
  width: 42px;
  min-width: 42px;
  padding: 0;
  background: var(--ti-teal);
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.theme-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -7px 0 -5px currentColor, 0 7px 0 -5px currentColor, 7px 0 0 -5px currentColor, -7px 0 0 -5px currentColor, 5px 5px 0 -5px currentColor, -5px -5px 0 -5px currentColor, 5px -5px 0 -5px currentColor, -5px 5px 0 -5px currentColor;
}

html[data-theme="dark"] .theme-icon::before {
  background: transparent;
  box-shadow: inset -5px -2px 0 1px currentColor;
}

.content-area {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.site-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  border-top: 4px solid var(--ti-red);
  padding: 13px 28px;
  color: #ffffff;
  background: #2b2b2b;
}

.footer-copyright {
  color: #c9c9c9;
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}

.footer-links a {
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  text-decoration: underline;
}

.workbench {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-width: 0;
}

.control-rail {
  overflow-y: auto;
  border-right: 1px solid var(--ti-gray-300);
  background: var(--ti-white);
  padding: 22px 18px;
}

.field,
.field-group {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.field span,
.field-group legend {
  color: var(--ti-gray-900);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field-group {
  padding: 0;
  border: 0;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--ti-gray-300);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--ti-ink);
  background: var(--ti-white);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(204, 0, 0, 0.24);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--ti-gray-300);
  border-radius: 8px;
  padding: 4px;
  background: var(--ti-gray-100);
}

.segment {
  min-height: 34px;
  padding: 0 8px;
  color: var(--ti-gray-900);
  background: transparent;
  font-size: 13px;
}

.segment.is-active {
  color: var(--ti-white);
  background: var(--ti-red);
}

.filter-stack {
  display: grid;
  gap: 0;
}

.reset-button {
  width: 100%;
  margin-top: 2px;
  background: var(--ti-gray-700);
}

.workspace {
  min-width: 0;
  overflow-y: auto;
  padding: 24px 26px 34px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  min-height: 78px;
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-top: 5px solid var(--kpi-color, var(--ti-red));
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--ti-white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  text-align: left;
}

.kpi span {
  display: block;
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 5px;
  color: var(--ti-black);
  font-size: 28px;
  line-height: 1;
}

.kpi.is-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.view-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.view-heading {
  display: grid;
  gap: 8px;
}

h2 {
  color: var(--ti-black);
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
}

.filter-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ti-gray-700);
  font-size: 13px;
  font-weight: 800;
}

.filter-status[hidden] {
  display: none;
}

.inline-clear {
  min-height: 28px;
  border: 1px solid var(--ti-red);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--ti-white);
  color: var(--ti-red);
  font-size: 12px;
  font-weight: 900;
}

.inline-clear:hover {
  background: var(--ti-red);
  color: var(--ti-white);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 720px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border: 1px solid var(--ti-gray-300);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--ti-white);
  color: var(--ti-gray-900);
  font-size: 12px;
  font-weight: 700;
}

.legend-item:hover {
  border-color: var(--ti-red);
  color: var(--ti-red);
}

.legend-item.is-active {
  border-color: var(--ti-red);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.14);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--legend-color);
}

.visualization {
  min-height: 540px;
  border: 1px solid var(--ti-gray-300);
  border-radius: var(--radius);
  background: var(--ti-white);
  box-shadow: var(--shadow);
}

@keyframes card-in {
  from {
    opacity: 0;
    translate: 0 6px;
  }
}

.empty-state {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: var(--ti-gray-700);
  font-weight: 700;
}

.board-frame {
  position: relative;
  padding: 22px 20px 44px 54px;
  min-height: 590px;
}

.y-axis {
  position: absolute;
  left: 16px;
  top: 52px;
  bottom: 52px;
  width: 3px;
  background: var(--ti-black);
}

.y-label {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  color: var(--ti-black);
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}

.x-axis {
  position: absolute;
  right: 28px;
  bottom: 36px;
  left: 54px;
  height: 3px;
  background: var(--ti-black);
}

.x-axis::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -7px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 17px solid var(--ti-black);
}

.board-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 18px;
}

.swimlanes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 235px);
  min-height: 470px;
}

.swimlane {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 3px 12px 16px;
  border-left: 2px dashed var(--ti-gray-300);
}

.swimlane:last-child {
  border-right: 2px dashed var(--ti-gray-300);
}

.lane-header {
  z-index: 1;
  display: grid;
  gap: 4px;
  min-height: 60px;
  align-content: start;
  border-bottom: 4px solid var(--ti-red);
  padding: 0 0 9px;
  background: var(--ti-white);
}

.swimlane-title {
  color: var(--ti-black);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.lane-count {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.module-card {
  display: grid;
  width: 100%;
  min-height: 74px;
  animation: card-in 160ms ease;
  gap: 4px;
  border: 4px solid var(--card-border, var(--ti-gray-900));
  border-left-width: 8px;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--card-color, var(--ti-gray-700));
  color: var(--ti-white);
  text-align: left;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.14);
}

.module-card:hover {
  transform: translateY(-1px);
}

.module-card .vendor {
  font-size: 13px;
  font-weight: 900;
}

.module-card .module-name {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.module-card .module-meta {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.matrix-wrap {
  overflow: auto;
  padding: 18px;
}

.matrix {
  display: grid;
  min-width: 760px;
  gap: 1px;
  background: var(--ti-gray-300);
  border: 1px solid var(--ti-gray-300);
}

.matrix-cell,
.matrix-header {
  min-height: 62px;
  background: var(--ti-white);
}

.matrix-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--ti-black);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.matrix-header.row-header {
  left: 0;
  z-index: 3;
  justify-items: start;
  text-align: left;
}

.matrix-cell {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  animation: card-in 160ms ease;
}

.cell-count {
  display: inline-flex;
  width: fit-content;
  min-width: 28px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--ti-white);
  background: var(--cell-color, var(--ti-gray-700));
  font-size: 12px;
  font-weight: 900;
}

.cell-modules {
  display: grid;
  gap: 4px;
}

.cell-module {
  border: 0;
  border-left: 4px solid var(--cell-color, var(--ti-red));
  border-radius: 4px;
  padding: 5px 7px;
  background: var(--ti-gray-100);
  color: var(--ti-black);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.cell-more {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 800;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 18px;
}

.partners-view {
  display: grid;
  gap: 0;
}

.company-card {
  display: grid;
  gap: 8px;
  min-height: 250px;
  align-content: start;
  border: 1px solid var(--ti-gray-300);
  border-top: 6px solid var(--company-color, var(--ti-red));
  border-radius: var(--radius);
  padding: 14px;
  background: var(--ti-white);
  color: var(--ti-black);
  text-align: left;
}

.company-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.company-card.is-active {
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.18);
}

.company-logo-wrap {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px solid var(--ti-gray-200);
  border-radius: 6px;
  background: var(--ti-gray-100);
}

.company-logo {
  display: block;
  width: 100%;
  max-width: 210px;
  max-height: 88px;
  object-fit: contain;
}

.company-card-title {
  color: var(--ti-black);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.company-card-meta {
  color: var(--ti-red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-card-line {
  color: var(--ti-gray-700);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.partner-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.partner-logo-card {
  min-height: 142px;
  place-items: center;
  padding: 12px;
}

.partner-logo-card .company-logo-wrap {
  width: 100%;
  min-height: 104px;
}

.partner-tier-badge {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
  object-fit: contain;
}

.partner-card-tier {
  max-width: 154px;
}

.partner-profile {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--ti-gray-300);
  padding: 18px;
  background: var(--ti-gray-100);
}

.partner-profile-head {
  display: grid;
  gap: 12px;
  align-content: start;
}

.partner-profile-logo {
  display: block;
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  border: 1px solid var(--ti-gray-300);
  border-radius: var(--radius);
  background: var(--ti-white);
}

.partner-profile-tier {
  max-width: 220px;
}

.partner-page-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ti-white);
  background: var(--ti-red);
  font-weight: 900;
  text-decoration: none;
}

.partner-soms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-content: start;
}

.partner-som {
  display: grid;
  gap: 5px;
  min-height: 76px;
  border: 1px solid var(--ti-gray-300);
  border-left: 6px solid var(--company-color, var(--ti-red));
  border-radius: 6px;
  padding: 10px;
  background: var(--ti-white);
  color: var(--ti-black);
  text-align: left;
}

.partner-som strong {
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.partner-som span {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.form-factors-view {
  display: grid;
  gap: 0;
}

.factor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  padding: 18px;
}

.factor-card {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px solid var(--ti-gray-300);
  border-top: 6px solid var(--factor-color, var(--ti-red));
  border-radius: var(--radius);
  padding: 12px;
  background: var(--ti-white);
}

.factor-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.factor-card.is-active {
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.18);
}

.factor-logo-wrap {
  display: grid;
  width: 100%;
  min-height: 112px;
  place-items: center;
  border: 1px solid var(--ti-gray-200);
  border-radius: 6px;
  background: var(--ti-gray-100);
}

.factor-logo {
  display: block;
  width: 100%;
  max-width: 210px;
  max-height: 96px;
  object-fit: contain;
}

.factor-profile {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--ti-gray-300);
  padding: 18px;
  background: var(--ti-gray-100);
}

.factor-profile-head {
  display: grid;
  align-content: start;
}

.factor-profile-logo {
  display: block;
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  border: 1px solid var(--ti-gray-300);
  border-radius: var(--radius);
  background: var(--ti-white);
}

.factor-soms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-content: start;
}

.factor-som {
  display: grid;
  gap: 5px;
  min-height: 76px;
  border: 1px solid var(--ti-gray-300);
  border-left: 6px solid var(--factor-color, var(--ti-red));
  border-radius: 6px;
  padding: 10px;
  background: var(--ti-white);
  color: var(--ti-black);
  text-align: left;
}

.factor-som strong {
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.factor-som span {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.map-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  padding: 18px;
}

.map-stage {
  display: grid;
  gap: 14px;
  align-content: start;
}

.world-map {
  display: block;
  width: 100%;
  max-height: 50vh;
  height: auto;
  aspect-ratio: 1000 / 520;
  border: 1px solid var(--ti-gray-300);
  border-radius: var(--radius);
  background: #f8fafb;
}

.map-base {
  pointer-events: none;
}

.map-region {
  cursor: pointer;
}

.map-region .map-pulse {
  fill: var(--region-color);
  opacity: 0.14;
}

.map-region .map-dot {
  fill: var(--region-color);
  stroke: var(--ti-white);
  stroke-width: 5;
}

.map-region.is-muted .map-pulse,
.map-region.is-muted .map-dot {
  opacity: 0.24;
}

.map-region.is-active .map-dot {
  stroke: var(--ti-black);
  stroke-width: 6;
}

.map-label-bg {
  fill: var(--ti-white);
  stroke: var(--ti-gray-300);
  stroke-width: 1;
}

.map-label {
  fill: var(--ti-black);
  font-size: 18px;
  font-weight: 900;
}

.map-count {
  fill: var(--ti-gray-700);
  font-size: 13px;
  font-weight: 800;
}

.map-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.map-panel h3 {
  color: var(--ti-black);
  font-size: 18px;
  line-height: 1.1;
}

.map-results {
  display: grid;
  gap: 10px;
  border-top: 4px solid var(--ti-red);
  padding-top: 12px;
}

.map-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.map-results-head h3 {
  color: var(--ti-black);
  font-size: 20px;
  line-height: 1.1;
}

.map-results-head span {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-result-section {
  display: grid;
  gap: 9px;
}

.map-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.map-section-head h4 {
  margin: 0;
  color: var(--ti-black);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-section-head span {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-partner-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.map-partner-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--ti-gray-300);
  border-left: 7px solid var(--company-color, var(--ti-red));
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--ti-white);
  color: var(--ti-black);
  text-align: left;
}

.map-partner-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.09);
}

.map-partner-logo-wrap {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid var(--ti-gray-200);
  border-radius: 6px;
  background: var(--ti-gray-100);
}

.map-partner-logo {
  display: block;
  max-width: 68px;
  max-height: 46px;
  object-fit: contain;
}

.map-partner-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.map-partner-body strong {
  color: var(--ti-black);
  font-size: 14px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.map-partner-body span {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.map-partner-tier {
  max-width: 142px;
  margin: 2px 0;
}

.map-result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.region-card {
  display: grid;
  gap: 6px;
  animation: card-in 160ms ease;
  border: 1px solid var(--ti-gray-300);
  border-left: 8px solid var(--region-color);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--ti-white);
  text-align: left;
}

.region-card.is-active {
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.18);
}

.region-card strong {
  color: var(--ti-black);
  font-size: 15px;
}

.region-card span {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 800;
}

.directory {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.directory-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, 0.8fr) repeat(5, minmax(92px, 0.6fr));
  animation: card-in 160ms ease;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--ti-gray-300);
  border-left: 8px solid var(--row-color, var(--ti-red));
  border-radius: var(--radius);
  padding: 12px;
  background: var(--ti-white);
}

.directory-row.is-header {
  border-left-color: var(--ti-black);
  color: var(--ti-gray-700);
  background: var(--ti-gray-100);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.directory-row button {
  justify-self: start;
  border: 0;
  padding: 0;
  color: var(--ti-red);
  background: transparent;
  font-weight: 900;
  text-align: left;
}

.badge {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--ti-white);
  background: var(--badge-color, var(--ti-gray-700));
  font-size: 12px;
  font-weight: 800;
}

.detail-drawer {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ti-white);
  transition: width 180ms ease;
}

.detail-drawer.is-open {
  width: min(420px, 35vw);
  overflow-y: auto;
  border-left: 5px solid var(--ti-red);
}

.drawer-inner {
  width: min(420px, 35vw);
  padding: 22px;
}

.drawer-close {
  float: right;
  min-height: 34px;
  margin-left: 16px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ti-white);
  background: var(--ti-gray-900);
  font-weight: 800;
}

.drawer-company {
  display: grid;
  min-height: 112px;
  place-items: center;
  border: 1px solid var(--ti-gray-300);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--ti-gray-100);
}

.drawer-logo {
  display: block;
  width: 100%;
  max-width: 260px;
  max-height: 104px;
  object-fit: contain;
}

.drawer-tier-badge {
  max-width: 230px;
  margin-top: 10px;
}

.drawer-title {
  margin: 18px 0 8px;
  color: var(--ti-red);
  font-size: 32px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.drawer-subtitle {
  color: var(--ti-gray-700);
  font-size: 15px;
  font-weight: 800;
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.detail-item {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--ti-gray-200);
  padding-bottom: 10px;
}

.detail-item dt {
  color: var(--ti-gray-700);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-item dd {
  margin: 0;
  color: var(--ti-black);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.drawer-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border-radius: 6px;
  padding: 0 16px;
  color: var(--ti-white);
  background: var(--ti-red);
  font-weight: 900;
  text-decoration: none;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell {
  background: #10141a;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .control-rail,
html[data-theme="dark"] .kpi,
html[data-theme="dark"] .visualization,
html[data-theme="dark"] .lane-header,
html[data-theme="dark"] .matrix-cell,
html[data-theme="dark"] .matrix-header,
html[data-theme="dark"] .company-card,
html[data-theme="dark"] .partner-som,
html[data-theme="dark"] .factor-card,
html[data-theme="dark"] .factor-som,
html[data-theme="dark"] .region-card,
html[data-theme="dark"] .map-partner-card,
html[data-theme="dark"] .directory-row,
html[data-theme="dark"] .detail-drawer,
html[data-theme="dark"] .legend-item,
html[data-theme="dark"] .inline-clear {
  background: #1b222b;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] .segmented,
html[data-theme="dark"] .partner-profile,
html[data-theme="dark"] .factor-profile,
html[data-theme="dark"] .drawer-company,
html[data-theme="dark"] .directory-row.is-header,
html[data-theme="dark"] .map-partner-logo-wrap,
html[data-theme="dark"] .cell-module {
  background: #121820;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select {
  color: var(--ti-black);
}

html[data-theme="dark"] .tool-button,
html[data-theme="dark"] .reset-button,
html[data-theme="dark"] .drawer-close {
  color: #ffffff;
  background: #343c48;
}

html[data-theme="dark"] .tool-button.theme-toggle {
  background: var(--ti-teal);
}

html[data-theme="dark"] .tool-button.primary,
html[data-theme="dark"] .segment.is-active,
html[data-theme="dark"] .partner-page-link,
html[data-theme="dark"] .drawer-link {
  color: #ffffff;
  background: var(--ti-red);
}

html[data-theme="dark"] .module-card {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .world-map {
  background: #f8fafb;
}

html[data-theme="dark"] .map-label {
  fill: #111111;
}

html[data-theme="dark"] .map-count {
  fill: #555555;
}

html[data-theme="dark"] .map-region.is-active .map-dot {
  stroke: #111111;
}

@media (max-width: 980px) {
  .workbench {
    grid-template-columns: 1fr;
  }

  .control-rail {
    border-right: 0;
    border-bottom: 1px solid var(--ti-gray-300);
  }

  .filter-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }

  .directory-row {
    grid-template-columns: 1fr 1fr;
  }

  .directory-row.is-header {
    display: none;
  }

  .map-view {
    grid-template-columns: 1fr;
  }

  .partner-profile {
    grid-template-columns: 1fr;
  }

  .factor-profile {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar,
  .workspace,
  .control-rail {
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand {
    align-items: flex-start;
  }

  .ti-mark {
    width: 44px;
    height: 44px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column-reverse;
    padding-right: 16px;
    padding-left: 16px;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .filter-stack,
  .kpis {
    grid-template-columns: 1fr;
  }

  .board-frame {
    padding-left: 42px;
  }

  .x-axis {
    left: 42px;
  }

  .y-label {
    font-size: 18px;
  }

  .world-map {
    min-height: 390px;
  }

  .detail-drawer.is-open {
    position: fixed;
    z-index: 40;
    inset: 0;
    width: 100vw;
    border-left: 0;
    border-top: 5px solid var(--ti-red);
  }

  .drawer-inner {
    width: 100%;
    padding: 18px 16px 28px;
  }

  .drawer-title {
    font-size: 28px;
  }

  .detail-item {
    grid-template-columns: minmax(108px, 38%) 1fr;
  }
}

@media print {
  .topbar {
    position: static;
  }

  .toolbar,
  .control-rail,
  .detail-drawer {
    display: none;
  }

  .workbench {
    display: block;
  }

  .workspace {
    padding: 0;
  }

  .visualization {
    box-shadow: none;
  }
}
