.page {
  width: 100%;
}

.page--narrow {
  max-width: none;
  text-align: left;
}

.page--narrow > :not(.page-header):not(.page-title) {
  margin-inline: auto;
  max-width: 42rem;
  width: 100%;
}

.page--narrow > .page-title:first-child {
  padding-top: 1.625rem;
}

.page-header {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  padding-top: 1.625rem;
  position: relative;
}

.page-header + .stack > .section-divider:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.page-header-leading {
  min-width: 0;
}

.breadcrumbs {
  color: var(--text-muted);
  font-size: 0.875rem;
  left: 0;
  line-height: 1.25rem;
  max-width: 100%;
  position: absolute;
  top: 0;
}

.breadcrumbs-list {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  list-style: none;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.breadcrumbs-item {
  display: flex;
  min-width: 0;
}

.breadcrumbs-item + .breadcrumbs-item::before {
  color: var(--text-subtle);
  content: "›";
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.breadcrumbs-link,
.breadcrumbs-label,
.breadcrumbs-current {
  display: block;
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs-link:hover {
  color: var(--text);
}

.breadcrumbs-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.breadcrumbs-current {
  color: var(--text);
  font-weight: 500;
}

.page-header--end {
  justify-content: flex-end;
}

.page-title {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 2rem;
  margin: 0;
}

.page > .page-title:first-child {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.page-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.page > .page-description {
  margin-bottom: 1.5rem;
}

.section-title {
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.75rem;
  margin: 0 0 1rem;
}

.section-title--small {
  font-size: 1rem;
  font-weight: 500;
}

.section-heading {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  margin: 0;
  text-transform: uppercase;
}

.cluster {
  --cluster-gap: 0.5rem;

  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--cluster-gap);
}

.cluster--large {
  --cluster-gap: 0.75rem;
}

.cluster--between {
  justify-content: space-between;
}

.cluster--end {
  justify-content: flex-end;
}

.cluster--wrap {
  flex-wrap: wrap;
}

.destructive-actions {
  margin-top: 1rem;
}

.stack {
  --stack-gap: 1.5rem;

  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}

.stack--small {
  --stack-gap: 1rem;
}

.stack--compact {
  --stack-gap: 0.75rem;
}

.stack--tiny {
  --stack-gap: 0.125rem;
}

.field-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.detail-grid {
  display: grid;
  gap: 1rem 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.filter-form,
.filter-row {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.filter-panel {
  margin-bottom: 1.5rem;
}

.filter-form--stacked {
  align-items: stretch;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.filter-separator {
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .filter-form,
  .filter-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  .filter-label,
  .filter-separator {
    white-space: normal;
  }
}

.metric-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.metric-row > * {
  font-size: 0.875rem;
}

.metric-label {
  color: var(--text-subtle);
}

.metric-value {
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 0.25rem;
}

.metric-value--positive {
  color: var(--lime-700);
}

.metric-value--negative {
  color: var(--red-600);
}

.approx-value {
  color: var(--text-subtle);
  font-weight: 400;
}

.section-group {
  margin-bottom: 2rem;
}

.split-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
}

.split-row--section {
  margin-bottom: 1rem;
}

.section-toolbar {
  margin-bottom: 0.5rem;
}

.section-toolbar .section-title {
  margin-bottom: 0;
}

.detail-label,
label,
.label {
  color: var(--text-muted);
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

:is(p, dt).label,
.detail-label {
  margin: 0 0 0.125rem;
}

.detail-value {
  color: var(--text);
  margin: 0;
}

.detail-title {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.75rem;
  margin: 0;
}

.empty-value {
  color: var(--text-subtle);
  font-style: italic;
  margin: 0;
}

.detail-list {
  color: var(--text);
  list-style: disc;
  list-style-position: inside;
  margin: 0;
  padding: 0;
}

dd.detail-value {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-note {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}

.field-label-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.small-link {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: color 150ms;
}

.small-link:hover {
  color: var(--text);
}

.form-footer {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 1rem 0 0;
  text-align: center;
}

.strong-link {
  color: var(--text);
  font-weight: 500;
  transition: color 150ms;
}

.strong-link:hover {
  color: var(--black);
}

.error-text {
  color: var(--red-600);
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.error-panel {
  background: var(--red-50);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.error-panel-title {
  color: var(--red-800);
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
}

.error-list {
  color: var(--red-700);
  font-size: 0.875rem;
  list-style: disc;
  list-style-position: inside;
  margin: 0.5rem 0 0;
}

.link {
  color: var(--text-muted);
}

.link:hover {
  color: var(--text);
}

.link--accent {
  color: var(--link);
}

.link--accent:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.action-link {
  color: var(--link);
  font-size: inherit;
  font-weight: inherit;
  padding: 0;
}

.action-link:hover {
  color: var(--link-hover);
}

.action-link--danger {
  color: var(--red-600);
}

.action-link--danger:hover {
  color: var(--red-900);
}

