/* Catalog navigation and results inside the authenticated workspace. */
#appShell .desk-main:has(.catalog-heading) {
  container-type: inline-size;
}

#appShell .catalog-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

#appShell .catalog-heading-actions {
  display: contents;
}

#appShell .catalog-heading .catalog-modes {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: thin;
}

#appShell .catalog-heading .catalog-modes a {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 14px;
  font-weight: 650;
}

body.catalog-app #appShell .catalog-heading .catalog-modes a[aria-current="page"] {
  background: transparent;
  border-bottom-color: var(--green);
  color: var(--text);
}

#appShell :is(.catalog-modes a, .answer-tabs button):focus-visible {
  outline-offset: -3px;
}

#appShell .catalog-heading h1 {
  font-size: clamp(24px, 2.65cqw, 32px);
  font-weight: 720;
  letter-spacing: -.025em;
}

#appShell .catalog-heading .catalog-count {
  align-self: center;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
}

#appShell :is(.catalog-toolbar, .catalog-workbench .finder, .catalog-workbench .university-detail, .call-active) {
  border-radius: 14px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 7%, transparent);
}

#appShell .catalog-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 14px;
}

#appShell .catalog-toolbar .finder-controls {
  grid-template-columns: minmax(120px, 175px) minmax(0, 1fr) auto;
  gap: 10px;
}

#appShell :is(#directoryWorkbench, #courseWorkbench) .catalog-toolbar .finder-controls {
  grid-template-columns: minmax(120px, 175px) minmax(0, 1fr);
}

#appShell .catalog-toolbar :is(.finder-input input, .finder-controls select, .call-toolbar-actions button) {
  min-height: 42px;
  border-radius: 8px;
}

#appShell .catalog-toolbar :is(.finder-input input, .finder-controls select) {
  text-overflow: ellipsis;
}

#appShell .catalog-toolbar .finder-input input {
  height: 42px;
  padding-inline-start: 35px;
  border-color: var(--border);
}

#appShell .catalog-toolbar .finder-input input:focus {
  border-color: var(--green);
}

#appShell .finder-input > span {
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  font-size: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E") center / contain no-repeat;
}

#appShell .catalog-toolbar .grant-filter {
  min-height: 42px;
}

#appShell .catalog-toolbar-examples {
  margin: 0;
}

#appShell .catalog-workbench {
  grid-template-columns: minmax(210px, min(30%, 320px)) minmax(0, 1fr);
  gap: 16px;
}

#appShell .catalog-workbench .result-count {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0;
  font-weight: 650;
}

#appShell .catalog-workbench .finder-results {
  padding: 4px 6px 6px;
}

#appShell .catalog-workbench .university-result {
  min-height: 54px;
  padding: 7px 9px;
  border-radius: 8px;
}

#appShell .university-monogram {
  background: var(--greenWash);
  border-color: transparent;
  border-radius: 8px;
}

#appShell .catalog-workbench .detail-header,
#appShell .catalog-workbench .detail-body {
  padding-inline: clamp(16px, 2.3cqw, 26px);
}

#appShell .catalog-workbench .detail-title-row h2 {
  font-size: clamp(22px, 2.55cqw, 30px);
  font-weight: 720;
  letter-spacing: -.025em;
}

#appShell .catalog-workbench .answer-tabs {
  flex-wrap: nowrap;
  gap: 4px;
  padding: 0 clamp(10px, 1.7cqw, 20px);
  background: var(--panel);
}

#appShell .catalog-workbench .answer-tabs button {
  min-height: 43px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  white-space: nowrap;
}

body.catalog-app #appShell .catalog-workbench .answer-tabs button.active {
  border-bottom-color: var(--green);
  color: var(--greenText);
  background: transparent;
}

#appShell .catalog-workbench :is(.phone-answer, .quick-answer-grid button) {
  border-radius: 10px;
}

#appShell .catalog-workbench .phone-answer p {
  margin-block: 8px 0;
}

#appShell .catalog-workbench .quick-answer-grid {
  gap: 10px;
  margin-top: 12px;
}

#appShell .catalog-workbench .quick-answer-grid button {
  padding: 13px;
}

@container (width < 1000px) {
  #appShell .catalog-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container (width < 670px) {
  #appShell .catalog-heading {
    gap: 10px;
  }

  #appShell .catalog-heading .catalog-modes a {
    padding: 9px 8px;
    font-size: 12px;
  }

  #appShell .catalog-heading .catalog-count {
    display: none;
  }

  #appShell .catalog-toolbar .finder-controls,
  #appShell :is(#directoryWorkbench, #courseWorkbench) .catalog-toolbar .finder-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }

  #appShell .catalog-toolbar .finder-controls select:not([multiple]):not([size]) {
    padding-inline-end: 28px;
    background-position: right 7px center;
  }

  #appShell .catalog-toolbar .grant-filter {
    grid-column: 1 / -1;
    min-height: 24px;
  }
}

@media (max-width: 760px) {
  #appShell .catalog-heading {
    align-items: center;
  }

  #appShell .catalog-heading h1 {
    font-size: 22px;
  }

  #appShell .catalog-toolbar {
    gap: 8px;
    padding: 10px;
  }

  #appShell .catalog-toolbar .call-toolbar-actions button {
    min-height: 38px;
  }

  #appShell .catalog-workbench .finder {
    height: clamp(120px, 25dvh, 195px);
  }
}

@media (max-height: 650px) {
  #appShell .catalog-heading {
    display: grid;
    row-gap: 8px;
    margin-bottom: 10px;
  }

  #appShell .catalog-heading :is(.catalog-heading-copy, .catalog-count) {
    display: none;
  }
}
