.report-scope {
  min-inline-size: 0;
  background: var(--surface-raised);
  color: var(--fg1);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}

.report-frame__command-bar .report-scope {
  border: 0;
  border-radius: 0;
}

.report-scope__sheet[open] {
  position: static;
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  color: var(--fg1);
  overflow: visible;
}

.report-scope__toggle,
.report-scope__close {
  display: none;
}

.report-scope__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.report-scope__row,
.report-scope__choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.report-scope__offices,
.report-scope__seasons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 0;
}

.report-scope__offices--single .report-scope__chip {
  font-weight: 600;
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.report-scope__chip,
.report-scope summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-block-size: var(--density-chip);
  min-inline-size: var(--density-chip);
  max-inline-size: 100%;
  padding-inline: var(--space-3);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  font-size: var(--text-sm);
  color: var(--fg1);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.report-scope__pill--office {
  font-weight: 650;
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.report-scope__chip:hover,
.report-scope summary:hover {
  background: var(--surface-sunken);
}

.report-scope__chip[aria-current="true"],
.report-scope summary.report-scope__summary--active {
  border-color: var(--accent-text);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.report-scope__label {
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--fg2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-basis: 100%;
}

.report-scope__more {
  position: relative;
  flex-shrink: 0;
  max-inline-size: 100%;
}

.report-scope__more > summary::after {
  content: "▾";
  margin-inline-start: var(--space-1);
  font-size: var(--text-xs);
  color: var(--fg2);
}

.report-scope__more > summary::-webkit-details-marker {
  display: none;
}

.report-scope__popover {
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-lg);
}

@media (min-width: 48.0625rem) {
  .report-scope__bar {
    flex-wrap: wrap;
    align-items: center;
    row-gap: var(--space-2);
    min-block-size: 2.5rem;
  }
  .report-scope__row {
    display: contents;
  }
  .report-scope__offices {
    flex-shrink: 0;
  }
  .report-scope__seasons {
    flex: 0 1 auto;
  }
  .report-scope__label {
    flex-basis: auto;
    margin-inline-end: var(--space-1);
  }
  .report-scope__popover {
    position: absolute;
    inset-block-start: calc(100% + var(--space-1));
    inset-inline-start: 0;
    z-index: 40;
    inline-size: max-content;
    min-inline-size: 15rem;
    max-inline-size: min(24rem, 90vw);
  }
  .report-scope__more--end > .report-scope__popover {
    inset-inline-start: auto;
    inset-inline-end: 0;
  }
  .report-scope__more--flip-start > .report-scope__popover {
    inset-inline-start: 0;
    inset-inline-end: auto;
  }
  .report-scope__popover .report-scope__offices,
  .report-scope__popover .report-scope__seasons {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
  .report-scope__popover .report-scope__chip {
    justify-content: flex-start;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.report-scope__actions {
  margin-inline-start: auto;
  flex-shrink: 0;
}

.report-scope__csv {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-block-size: var(--density-chip);
  padding-inline: var(--space-3);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--fg1);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.report-scope__csv:hover {
  background: var(--surface-sunken);
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.report-scope__csv-icon {
  flex: none;
}

.report-scope__search,
.report-scope__comparison,
.report-scope__custom-dates {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
  margin-block: var(--space-1);
}

.report-scope__custom-dates {
  margin-block: 0;
}

.report-scope__custom-dates[hidden] {
  display: none;
}

.report-scope__custom-hint {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--fg2);
}

.report-scope__search input {
  min-inline-size: 0;
  inline-size: 100%;
}

.report-scope__choices {
  max-block-size: 18rem;
  overflow: auto;
  padding: var(--space-1);
}

.report-scope__choices [hidden] {
  display: none;
}

.report-scope__series-status {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--fg2);
  overflow-wrap: anywhere;
}

.report-scope__series-status:not(:empty) {
  margin-block: var(--space-2);
}

.report-frame__navigation {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
}

.report-frame__navigation > nav {
  min-inline-size: 0;
}

.report-frame__tools .report-frame__caveats {
  display: block;
  padding-inline-start: var(--space-4);
  list-style: disc;
}

.report-frame__tools:not([open]) > :not(summary),
.report-frame__about:not([open]) > :not(summary) {
  display: none;
}

.report-frame__tools {
  min-inline-size: 0;
}

.report-frame__tools li {
  min-inline-size: 0;
  max-inline-size: 100%;
}

.report-frame__tools a {
  overflow-wrap: anywhere;
  max-inline-size: 100%;
}

.report-frame__updated {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-xs);
}

.report-frame:has(.report-scope) :is(a, button, input, select, summary) {
  scroll-margin-block-start: calc(6.5rem + var(--safe-top));
}

@media (pointer: coarse) {
  .report-scope__chip,
  .report-scope summary,
  .report-scope__csv {
    min-block-size: var(--target-min);
  }
}

@media (max-width: 48rem) {
  .report-scope {
    position: sticky;
    inset-block-start: calc(4rem + var(--safe-top));
    z-index: 25;
  }
  .report-frame__command-bar .report-scope {
    position: static;
    z-index: auto;
  }
  .report-scope:has(.report-scope__sheet[open]) {
    position: static;
  }
  .report-scope__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    inline-size: 100%;
    min-block-size: var(--target-min);
    padding-block: var(--space-2);
    padding-inline: calc(var(--space-3) + var(--safe-left)) calc(var(--space-3) + var(--safe-right));
    border: 0;
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--fg1);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: start;
    cursor: pointer;
  }
  .report-scope__toggle > span:first-child {
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }
  .report-scope__sheet[open] {
    position: fixed;
    inset-block: auto 0;
    inset-inline: 0;
    inline-size: 100%;
    max-block-size: calc(100dvh - 4rem - var(--safe-top));
    padding: var(--space-4) calc(var(--space-4) + var(--safe-right)) calc(var(--space-4) + var(--safe-bottom)) calc(var(--space-4) + var(--safe-left));
    border: 1px solid var(--rule);
    border-start-start-radius: var(--radius-lg);
    border-start-end-radius: var(--radius-lg);
    background: var(--surface-raised);
    overflow: auto;
  }
  .report-scope__sheet::backdrop {
    background: var(--scrim);
  }
  .report-scope__close {
    display: block;
    justify-self: end;
    margin: 0 0 var(--space-2);
  }
  .report-scope__bar,
  .report-scope__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }
  .report-scope__actions {
    margin-inline-start: 0;
  }
  .report-scope__csv,
  .report-scope summary {
    inline-size: 100%;
    justify-content: space-between;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .report-scope__popover {
    margin-block-start: var(--space-2);
    border-color: var(--rule);
  }
  .report-frame:has(.report-scope) :is(a, button, input, select, summary) {
    scroll-margin-block-start: calc(4rem + var(--safe-top) + var(--target-min) + var(--space-4));
  }
}

@media print {
  .report-scope { position: static; }
}
