.plenti-story-page {
  --market-ink: #171a17;
  --market-muted: #606760;
  --market-soft: #f3f4f1;
  --market-line: #cfd3cc;
  --market-line-dark: #aeb5aa;
  --market-white: #ffffff;
  --market-green: #217346;
  --market-green-dark: #155a35;
  --market-green-soft: #e5f0e9;
  --market-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.plenti-story-page .market-workbench {
  min-width: 0;
  width: 100%;
  color: var(--market-ink);
  background: var(--market-white);
  border: 1px solid #9da69b;
  box-shadow: 14px 18px 0 #dfe2dc, 0 28px 70px rgba(28, 35, 29, .15);
}

.plenti-story-page .market-workbench *,
.plenti-story-page .market-workbench *::before,
.plenti-story-page .market-workbench *::after {
  box-sizing: border-box;
}

.plenti-story-page .market-workbench button:focus-visible,
.plenti-story-page .market-workbench input:focus-visible,
.plenti-story-page .market-workbench select:focus-visible,
.plenti-story-page .market-workbench summary:focus-visible {
  outline: 3px solid rgba(33, 115, 70, .35);
  outline-offset: 3px;
}

.plenti-story-page .workbench-topbar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  color: #eaf4ed;
  background: #1d5e3b;
  font: 600 10px/1.2 var(--market-mono);
}

.plenti-story-page .workbench-file,
.plenti-story-page .integrity-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plenti-story-page .workbench-file i {
  width: 11px;
  height: 14px;
  background: #fff;
  border-radius: 1px;
  box-shadow: inset 0 -4px #acd0b8;
}

.plenti-story-page .integrity-badge b {
  width: 7px;
  height: 7px;
  background: #9ce0b4;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(156, 224, 180, .18);
}

.plenti-story-page .workbench-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--market-line);
}

.plenti-story-page .workbench-heading p,
.plenti-story-page .workbench-heading h2 {
  margin: 0;
}

.plenti-story-page .workbench-heading p {
  color: var(--market-green-dark);
  font: 700 9px/1.2 var(--market-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.plenti-story-page .workbench-heading h2 {
  max-width: 480px;
  margin-top: 5px;
  color: var(--market-ink);
  font-size: clamp(23px, 2.2vw, 32px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.plenti-story-page .workbench-heading > span {
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--market-muted);
  background: var(--market-soft);
  border: 1px solid var(--market-line);
  font: 600 9px/1 var(--market-mono);
}

.plenti-story-page .workbench-controls {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 10px;
  padding: 16px 22px;
  background: #f6f7f4;
  border-bottom: 1px solid var(--market-line);
}

.plenti-story-page .workbench-controls label > span {
  display: block;
  margin-bottom: 6px;
  color: #4e564e;
  font: 700 9px/1.2 var(--market-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.plenti-story-page .workbench-controls select,
.plenti-story-page .workbench-controls input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--market-ink);
  background: var(--market-white);
  border: 1px solid var(--market-line-dark);
  border-radius: 0;
  font: 600 12px/1.2 Arial, Helvetica, sans-serif;
}

.plenti-story-page .workbench-status {
  margin: 0;
  padding: 11px 22px 0;
  color: var(--market-muted);
  font: 600 10px/1.4 var(--market-mono);
}

.plenti-story-page .market-bars {
  display: grid;
  gap: 2px;
  max-height: 330px;
  padding: 12px 22px 16px;
  overflow-y: auto;
}

.plenti-story-page .market-bar-row {
  display: grid;
  grid-template-columns: 22px minmax(112px, .72fr) minmax(100px, 1.28fr) 86px;
  gap: 10px;
  min-height: 43px;
  align-items: center;
  width: 100%;
  padding: 6px 8px;
  color: var(--market-ink);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
}

.plenti-story-page .market-bar-row:hover {
  background: var(--market-soft);
}

.plenti-story-page .market-bar-row.is-selected {
  background: var(--market-green-soft);
  border-color: #85ad94;
}

.plenti-story-page .market-bar-row > span:first-child {
  color: var(--market-muted);
  font: 600 10px/1 var(--market-mono);
}

.plenti-story-page .market-bar-row strong {
  overflow: hidden;
  color: var(--market-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plenti-story-page .market-bar-track {
  height: 9px;
  overflow: hidden;
  background: #e2e5df;
  border: 1px solid #d5d9d1;
}

.plenti-story-page .market-bar-track i {
  display: block;
  height: 100%;
  background: var(--market-green);
}

.plenti-story-page .market-bar-value {
  color: #303630;
  font: 700 10px/1 var(--market-mono);
  text-align: right;
}

.plenti-story-page .region-detail {
  margin: 0 22px 16px;
  border: 1px solid var(--market-line-dark);
  background: #fcfdfb;
}

.plenti-story-page .region-detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--market-line);
}

.plenti-story-page .region-detail-heading div:last-child {
  text-align: right;
}

.plenti-story-page .region-detail-heading span,
.plenti-story-page .region-detail-heading strong {
  display: block;
}

.plenti-story-page .region-detail-heading span,
.plenti-story-page .region-kpis span {
  color: var(--market-muted);
  font: 600 9px/1.2 var(--market-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.plenti-story-page .region-detail-heading strong {
  margin-top: 3px;
  font-size: 15px;
}

.plenti-story-page .region-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.plenti-story-page .region-kpis div {
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--market-line);
}

.plenti-story-page .region-kpis div:last-child {
  border-right: 0;
}

.plenti-story-page .region-kpis strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font: 700 13px/1 var(--market-mono);
  text-overflow: ellipsis;
}

.plenti-story-page .market-query-drawer {
  margin: 0 22px 14px;
  border-top: 1px solid var(--market-line);
}

.plenti-story-page .market-query-drawer summary {
  min-height: 44px;
  padding: 14px 0 10px;
  color: var(--market-green-dark);
  font: 700 10px/1.3 var(--market-mono);
  cursor: pointer;
}

.plenti-story-page .market-query-drawer pre {
  max-height: 210px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #dff1e5;
  background: #17231b;
  font: 500 11px/1.62 var(--market-mono);
  tab-size: 2;
}

.plenti-story-page .workbench-footnote {
  margin: 0;
  padding: 0 22px 18px;
  color: var(--market-muted);
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 800px) {
  .plenti-story-page .workbench-controls {
    grid-template-columns: 1fr;
  }

  .plenti-story-page .market-bars {
    max-height: 380px;
  }

  .plenti-story-page .market-bar-row {
    grid-template-columns: 22px minmax(110px, .8fr) minmax(90px, 1fr) 76px;
  }

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

  .plenti-story-page .region-kpis div:nth-child(2) {
    border-right: 0;
  }

  .plenti-story-page .region-kpis div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--market-line);
  }
}

@media (max-width: 580px) {
  .plenti-story-page .market-workbench {
    box-shadow: 7px 9px 0 #dfe2dc;
  }

  .plenti-story-page .workbench-topbar {
    min-height: 46px;
  }

  .plenti-story-page .integrity-badge {
    font-size: 8px;
  }

  .plenti-story-page .workbench-heading {
    flex-direction: column;
    padding: 18px 14px;
  }

  .plenti-story-page .workbench-controls,
  .plenti-story-page .market-bars {
    padding-right: 14px;
    padding-left: 14px;
  }

  .plenti-story-page .workbench-status {
    padding-left: 14px;
  }

  .plenti-story-page .market-bar-row {
    grid-template-columns: 20px minmax(92px, 1fr) 74px;
    gap: 7px;
    min-height: 44px;
  }

  .plenti-story-page .market-bar-track {
    display: none;
  }

  .plenti-story-page .market-bar-value {
    font-size: 9px;
  }

  .plenti-story-page .region-detail,
  .plenti-story-page .market-query-drawer {
    margin-right: 14px;
    margin-left: 14px;
  }

  .plenti-story-page .workbench-footnote {
    padding-right: 14px;
    padding-left: 14px;
  }

  .plenti-story-page .market-query-drawer summary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }
}
