:root {
  --agency-blue: #174bce;
  --agency-ink: #222222;
  --agency-paper: #f7f2e9;
}

.agency-mode-navigation {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: #ffffff;
}

.agency-filter-heading span {
  color: #38f452;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.agency-mode-switch {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 2px;
  border: 1px solid rgba(255, 250, 243, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.agency-mode-switch button {
  min-width: 84px;
  min-height: 28px;
  padding: 5px 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: rgba(255, 250, 243, 0.66);
  font: inherit;
  font-size: 0.53rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.agency-mode-switch button:first-child {
  min-width: 112px;
}

.agency-mode-switch button.is-active {
  background: #38f452;
  color: #111111;
}

.agency-mode-switch button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.agency-portfolio-filters {
  margin: 22px 0 0;
  padding: 16px 18px;
  border: 1px solid #c8c1b8;
  border-left: 5px solid #38f452;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  grid-template-columns: minmax(245px, 1.45fr) repeat(5, minmax(115px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.agency-filter-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: center;
}

.agency-filter-heading strong {
  font-size: 13px;
}

.agency-portfolio-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 3px;
  color: #67625d;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
}

.agency-portfolio-scope span {
  color: #222222;
  font-size: 10px;
  letter-spacing: 0;
}

.agency-portfolio-scope b {
  font-size: 11px;
}

.agency-portfolio-scope small {
  width: 100%;
  color: #77716a;
  font-size: 9px;
  line-height: 1.35;
}

.agency-portfolio-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agency-portfolio-filters label > span {
  color: #67625d;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.agency-portfolio-filters select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid #b7b0a7;
  border-radius: 5px;
  background: #ffffff;
  color: #222222;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.agency-portfolio-filters select:disabled {
  background: #f0ece5;
  color: #6f6a64;
}

.agency-reset-filters {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #222222;
  border-radius: 5px;
  background: #ffffff;
  color: #222222;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.agency-tag {
  display: inline-flex;
  width: max-content;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #222222;
  color: #ffffff;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  align-self: center;
  justify-self: start;
  flex: none;
  cursor: pointer;
  opacity: 0.78;
  filter: saturate(0.72);
  transition: opacity 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}

.agency-tag:hover,
.agency-tag:focus-visible {
  opacity: 1;
  filter: saturate(1) brightness(1.05);
  box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.3);
  outline: none;
}

.agency-tag.agency-zenith {
  background: #6f00ff;
}

.agency-tag.agency-starcom {
  background: #006bdc;
}

.agency-tag.agency-spark-foundry {
  background: #f06d00;
}

.agency-tag.agency-performics {
  background: #008f3f;
}

.agency-tag.agency-publicis {
  background: #e00032;
}

.agency-tag.agency-essencemediacom { background: #e62939; }
.agency-tag.agency-wavemaker { background: #6b35d4; }
.agency-tag.agency-wpp { background: #007ea8; }
.agency-tag.agency-mindshare { background: #e85d04; }
.agency-tag.agency-t-p { background: #14866d; }
.agency-tag.agency-carat { background: #003f88; }
.agency-tag.agency-dentsu-x { background: #c1121f; }
.agency-tag.agency-iprospect { background: #6a994e; }
.agency-tag.agency-dentsu { background: #7b2cbf; }
.agency-tag.agency-mediaplus { background: #005f73; }
.agency-tag.agency-salestube { background: #9b2226; }
.agency-tag.agency-value-media { background: #ca6702; }
.agency-tag.agency-group-one { background: #3a0ca3; }
.agency-tag.agency-arena-media { background: #4361ee; }
.agency-tag.agency-havas-media { background: #d00000; }
.agency-tag.agency-havas { background: #2a9d8f; }
.agency-tag.agency-initiative { background: #8338ec; }
.agency-tag.agency-kinesso { background: #ff006e; }
.agency-tag.agency-um { background: #fb8500; }
.agency-tag.agency-interpublic { background: #0077b6; }
.agency-tag.agency-hearts-science { background: #d62828; }
.agency-tag.agency-media-direction-omd { background: #3a86ff; }
.agency-tag.agency-omd { background: #8338ec; }
.agency-tag.agency-phd { background: #008000; }
.agency-tag.agency-omnicom { background: #b5179e; }

.signal-advertiser-heading .agency-tag {
  width: auto;
  flex: 0 0 auto;
  padding: 3px 7px;
  font-size: 8.5px;
  opacity: 0.92;
}

.drawer-hero h2 .agency-tag {
  position: relative;
  top: -4px;
  color: #ffffff !important;
  font-size: 8px;
}

.drawer-hero .agency-tag {
  color: #ffffff !important;
}

.drawer-hero .agency-profile-tag {
  margin: 10px 0 0;
  padding: 6px 10px;
  color: #ffffff !important;
  font-size: 11px;
  opacity: 0.95;
}

.scatter-dot > .agency-tag {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 4;
  max-width: 116px;
  margin: 0;
  padding: 2px 6px;
  overflow: hidden;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
  text-shadow: none;
}

#agencyDataScope {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: #222;
}

#agencyDataScope[hidden] { display: none; }
.agency-scope-stats {
  display: block;
}
.agency-scope-stats span {
  color: #222;
  font-size: 10px;
  font-weight: 750;
  text-transform: none;
}
.agency-scope-cities {
  margin: 0;
  max-width: 100%;
  color: #5f5b55;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: none;
}
.agency-scope-cities b { color: #222; }

.agency-view-portfolio [data-toggle-shortlist] { display: none !important; }
.agency-mockup .benchmark-panel > .panel-subtitle { padding-inline: 32px; }
.agency-mockup [data-open-advertiser],
.agency-mockup .table-link,
.agency-mockup .bar-row { cursor: pointer; }
.agency-mockup [data-open-advertiser]:hover strong { color: #9c4f14; }

.agency-profile-chart { display: grid; gap: 12px; }
.agency-profile-chart article { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; }
.agency-profile-chart article > strong { padding-top: 8px; font-size: 10px; }
.agency-profile-chart article > div { display: grid; gap: 5px; }
.agency-profile-chart button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  min-height: 29px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid #d4cec4;
  border-radius: 3px;
  background: #f3efe8;
  text-align: left;
}
.agency-profile-chart button > span { position: absolute; inset: 0 auto 0 0; background: rgba(56, 244, 82, 0.3); }
.agency-profile-chart button > b,
.agency-profile-chart button > small { position: relative; z-index: 1; min-width: 0; font-size: 9px; }
.agency-profile-chart button > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.agency-view-portfolio #contextPrompt,
.agency-view-portfolio #contextSummary {
  display: none !important;
}

.agency-view-portfolio .own-metric {
  display: none;
}

.agency-view-portfolio .app-shell {
  padding-top: 1px;
}

.agency-view-portfolio .control-strip {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
}

.agency-view-portfolio .context-export-control {
  margin-left: auto;
}

@media (min-width: 1151px) {
  .campaign-layout {
    grid-template-columns: minmax(0, 0.82fr) minmax(760px, 1.18fr);
  }

  .campaign-table-head,
  .campaign-table-row {
    grid-template-columns:
      minmax(145px, 1.08fr)
      minmax(180px, 1.3fr)
      minmax(92px, 0.5fr)
      minmax(128px, 0.72fr)
      minmax(150px, 0.92fr);
    gap: 13px;
  }

  .campaign-table-head .sortable-header {
    align-items: flex-start;
    white-space: normal;
    line-height: 1.12;
  }
}

@media (max-width: 1250px) {
  .agency-portfolio-filters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .agency-filter-heading {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .agency-mode-switch button {
    min-width: 70px;
  }

  .agency-mode-switch button:first-child {
    min-width: 96px;
  }

  .agency-portfolio-filters {
    grid-template-columns: 1fr;
  }
}
