.catalog-project-nav,
.catalog-content-heading,
.catalog-row-heading,
.catalog-business-actions,
.catalog-lifecycle-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.catalog-project-nav {
  gap: 0 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.workspace.catalog-historical-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.catalog-project-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-heading > .actions > a { display: inline-flex; align-items: center; min-height: 44px; }

.catalog-project-nav [aria-current="page"] {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.catalog-action-menu {
  display: block;
  position: relative;
}

.catalog-action-menu > summary {
  padding: 9px 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ui-link);
}

.catalog-action-menu[open] > .catalog-menu-actions {
  position: absolute;
  z-index: 4;
  inset-inline: auto 0;
  top: calc(100% + 4px);
  display: grid;
  gap: 4px;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ui-surface);
  box-shadow: 0 6px 16px #17355724;
}

.catalog-menu-actions > :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  text-align: start;
  overflow-wrap: anywhere;
}

.catalog-menu-actions > :is(a, button):hover { background: var(--ui-hover); }

.catalog-content-heading {
  justify-content: space-between;
  margin-bottom: 14px;
}

.catalog-content-heading > .detail-name {
  margin: 0;
  overflow-wrap: anywhere;
}

.catalog-root-heading > h2 { margin: 0; }
.scope-diagram-return { display: inline-block; margin: 0 0 8px; }

.catalog-content-heading > .actions {
  padding: 0;
  margin-bottom: 0;
}

.catalog-content-heading > .actions > button { min-height: 44px; }
.view-content > .detail-panel > .scope-diagram {
  margin-block: 16px 20px;
  padding: clamp(12px, 2.2vw, 20px);
  background: var(--ui-surface);
}

.catalog-directory-contents > h3 { margin: 16px 0 10px; font-size: 18px; }

.tree-panel .catalog-tree { min-height: 0; max-height: none; overflow: visible; padding-block: 8px 12px; }
.tree-panel .catalog-select { min-width: 0; min-height: 42px; width: 100%; height: auto; }
.tree-panel .catalog-row { gap: 3px; align-items: start; }
.tree-panel .catalog-row > .catalog-toggle { margin-block: 5px; }
.tree-panel .catalog-select .kind { flex: none; }
.tree-panel .catalog-select .entry-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.tree-panel .catalog-select .entry-code { flex: 0 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.tree-panel .catalog-select.selected .entry-name { font-weight: 650; }
.catalog-signed-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--ui-ready-ink);
  border-radius: 50%;
}
.catalog-signed-complete {
  background: var(--ui-ready-ink);
}
.tree-panel .catalog-row-ordering .catalog-select { overflow: visible; }
.tree-panel .catalog-row-ordering .entry-name { overflow: visible; }
.tree-panel .catalog-current { border-bottom: 0; padding-block: 8px; }

.catalog-content-rows {
  display: grid;
  padding: 0;
  margin: 0;
  list-style: none;
  border-block: 1px solid var(--line);
}

.catalog-content-row {
  display: grid;
  gap: 6px 16px;
  padding: 14px 12px;
  background: var(--ui-surface);
  min-width: 0;
  overflow-wrap: anywhere;
}

.catalog-content-row + .catalog-content-row { border-block-start: 1px solid var(--line); }

.catalog-content-row[data-located="true"] {
  background: var(--ui-selection);
  box-shadow: inset 3px 0 var(--ui-action);
}

.catalog-content-row > p,
.catalog-content-row h3,
.catalog-row-heading h4,
.catalog-region-entry p {
  margin: 0;
}

.catalog-code,
.catalog-located-label {
  font-size: 12px;
}

.catalog-row-heading { gap: 4px 8px; }
.catalog-row-heading h4 { min-width: 0; font-size: 16px; }
.catalog-row-heading .kind { font-size: 11px; }

.catalog-located-label {
  color: var(--ui-link);
}

.catalog-entry-link {
  color: inherit;
  font-weight: 680;
  text-decoration-thickness: .075em;
  text-underline-offset: .15em;
}
.catalog-entry-link:hover { color: var(--ui-link); }

.catalog-business-actions a,
.catalog-business-actions button,
.catalog-lifecycle-actions button,
.catalog-locate,
.catalog-clear {
  min-height: 44px;
}

.catalog-business-actions a {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
.catalog-business-actions { gap: 2px 18px; }
.catalog-withheld { font-size: 13px; }
.catalog-withheld > summary { cursor: pointer; color: var(--ui-pending-ink); }

.catalog-question,
.catalog-question-note {
  color: var(--ui-pending-ink);
}

.catalog-question-note {
  background: var(--ui-pending-surface);
  border-inline-start: 3px solid #a26a19;
  padding: 6px 9px;
}

.catalog-signed-quantity {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-number {
  min-width: 0;
  color: var(--ui-ink);
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1100px) {
  .catalog-content-row:has(> .catalog-signed-quantity .catalog-number) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .catalog-content-row:has(> .catalog-signed-quantity .catalog-number) > * { grid-column: 1 / -1; }
  .catalog-content-row:has(> .catalog-signed-quantity .catalog-number) > .catalog-row-heading { grid-column: 1; }
  .catalog-content-row > .catalog-signed-quantity:has(.catalog-number) {
    grid-area: 1 / 2;
    flex-direction: column;
    align-items: flex-end;
    text-align: end;
  }
}

.catalog-region-entry {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.catalog-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ui-inset);
}

.catalog-related summary {
  cursor: pointer;
  color: var(--ui-link);
}

.catalog-related h3 {
  margin: 8px 0 3px;
}

.catalog-search input[type="search"] {
  min-height: 44px;
}

.catalog-scope-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
}

.catalog-scope-filter input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ui-action);
}

.catalog-lifecycle-dialog {
  width: min(580px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.catalog-lifecycle-body > p,
.catalog-lifecycle-status {
  overflow-wrap: anywhere;
}

.catalog-lifecycle-status:empty {
  display: none;
}

.catalog-relocation-target select {
  display: block;
  margin-top: 6px;
}

.catalog-relocation-impact {
  overflow-wrap: anywhere;
}

.catalog-relocation-impact h3 {
  margin: 12px 0 4px;
  font-size: 14px;
}

.catalog-impact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  margin: 10px 0;
}

.catalog-impact dd {
  margin: 0;
  text-align: end;
}

.catalog-blockers {
  border: 1px solid #9d3647;
  border-radius: 7px;
  background: var(--ui-blocked-surface);
  color: var(--ui-blocked-ink);
  padding: 8px 12px;
}

.catalog-blockers h3 {
  margin: 0;
}

.catalog-delete-trigger {
  color: #8c2435;
}

.catalog-delete-confirm,
.catalog-delete-confirm:hover {
  background: #8c2435;
  border-color: #8c2435;
  color: white;
}

.catalog-page-title:focus,
.page-heading h1[tabindex="-1"]:focus-visible,
.catalog-project-nav a:focus-visible,
.catalog-content-row a:focus-visible,
.catalog-action-menu > summary:focus-visible,
.catalog-menu-actions > :is(a, button):focus-visible,
.catalog-lifecycle-dialog :is(a, button):focus-visible {
  outline: 2px solid var(--ui-link);
  outline-offset: 2px;
}

@media (max-width: 800px) {
  .tree-panel { max-height: min(55dvh, 430px); }
  .tree-panel .panel-heading { padding: 8px 12px; }
  .tree-panel .catalog-current { padding-inline: 12px; }
  .tree-panel .catalog-toggle, .tree-panel .catalog-order-actions button { min-height: 44px; }
  .tree-panel .catalog-row > .catalog-toggle { margin-block: 0; }
  .catalog-collapse {
    min-height: 44px;
  }
}

@media (max-width: 700px) {
  .project-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .project-heading > .actions {
    flex: 0 1 auto;
  }

  .catalog-business-actions {
    display: grid;
    justify-items: stretch;
    gap: 2px;
  }

  .catalog-business-actions > a { border-top: 1px solid var(--line); }
  .catalog-business-actions > button { justify-self: start; max-width: 100%; text-align: start; overflow-wrap: anywhere; }
  .catalog-signed-quantity { justify-content: space-between; }
  .catalog-number { margin-inline-start: auto; text-align: end; }
  .catalog-project-nav a { min-height: 44px; }
  .catalog-project-nav { margin-bottom: 5px; }
}

@media (max-width: 360px) {
  .view-content > .detail-panel,
  .catalog-recycle {
    padding: 12px;
  }
}
