/* The parts every Mission Control app shares: the layout around the page, and the components that LucaUi's helpers
   render. Styles for one app's pages stay in that app's application.css. */

.topbar {
  --bs-navbar-padding-y: 0.75rem;
}

/* Narrow screens truncate the user's name rather than wrapping the menu onto a second row. */
.topbar > .container {
  flex-wrap: nowrap;
}

.topbar .dropdown {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  height: 22px;
}

.brand-app {
  padding-left: 0.75rem;
  border-left: var(--bs-border-width) solid var(--bs-border-color);
  color: var(--luca-blue);
  font-weight: 600;
  font-size: 1.05rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  color: var(--luca-blue);
  text-decoration: none;
}

.user-menu:hover,
.user-menu:focus {
  color: var(--luca-blue);
}

.avatar {
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-small {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.avatar-large {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}

.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--luca-blue-rgb), 0.1);
  color: var(--luca-blue);
  font-weight: 600;
  line-height: 1;
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  vertical-align: middle;
}

.user-name {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle {
  display: flex;
  padding: 0.4rem;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  color: var(--luca-blue);
}

.sidebar-toggle:hover {
  background-color: var(--blueish-white);
}

.sidebar {
  --bs-offcanvas-width: 300px;
}

.sidebar .offcanvas-header {
  border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--bs-border-radius-sm);
  color: var(--luca-blue);
  font-weight: 500;
}

.sidebar-nav .nav-link:hover {
  background-color: var(--blueish-white);
}

.sidebar-nav .nav-link.active {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

.sign-in-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

.sign-in {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.sign-in-logo {
  display: block;
  height: 36px;
  margin: 0 auto 2rem;
}

.developer-sign-in {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--bs-border-color);
}

.confirm-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: 1.5rem;
  border: 0;
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-lg);
  color: var(--bs-body-color);
}

.confirm-dialog::backdrop {
  background-color: rgba(var(--luca-blue-rgb), 0.4);
}

.status {
  font-weight: 500;
}

.status-neutral {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

.status-running,
.status-accent {
  background-color: rgba(var(--luca-blue-rgb), 0.08);
  color: var(--luca-blue);
}

.status-success {
  background-color: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
}

.status-danger {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
}

.status-muted {
  background-color: var(--bs-body-bg);
  color: var(--bs-secondary-color);
  border: var(--bs-border-width) solid var(--bs-border-color);
}

.status .spinner-border {
  --bs-spinner-width: 0.7rem;
  --bs-spinner-height: 0.7rem;
  --bs-spinner-border-width: 0.12em;
  margin-right: 0.15rem;
  vertical-align: -0.05rem;
}

.in-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--luca-blue);
  font-weight: 500;
}

.in-progress .spinner-border {
  --bs-spinner-width: 0.9rem;
  --bs-spinner-height: 0.9rem;
  --bs-spinner-border-width: 0.15em;
}

/* A table set straight in a card would paint square corners over the card's rounded ones; the scroll wrapper clips it
   to them. */
.card > .table-responsive {
  border-radius: var(--bs-card-inner-border-radius);
}

/* The column that gives way so a table fits its card rather than scrolling sideways: it takes the width the other
   columns leave, and its .text-truncate content ends in an ellipsis. */
.table .cell-fill {
  width: 100%;
  max-width: 0;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: var(--bs-border-width) solid rgba(var(--luca-blue-rgb), 0.12);
  border-radius: var(--bs-border-radius-pill);
  background-color: rgba(var(--luca-blue-rgb), 0.05);
  color: var(--luca-blue);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Element-qualified to outrank theme.css's underline on hovered links. */
a.link-chip:hover {
  background-color: rgba(var(--luca-blue-rgb), 0.09);
  color: var(--luca-blue);
  text-decoration: none;
}

.link-chip-detail {
  color: var(--bs-secondary-color);
  font-weight: 400;
}

.back-link {
  font-size: 0.9rem;
}

.meta {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.error-message {
  white-space: pre-wrap;
}

/* A prompt as the person wrote it: a <pre> keeps its line breaks, and a <div> holds simple_format's paragraphs. */
.prompt-body {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--blueish-white);
  border-radius: var(--bs-border-radius);
  overflow-wrap: anywhere;
}

pre.prompt-body {
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
}

.prompt-body > :first-child {
  margin-top: 0;
}

.prompt-body > :last-child {
  margin-bottom: 0;
}

.markdown > :first-child {
  margin-top: 0;
}

.markdown > :last-child {
  margin-bottom: 0;
}

.markdown h1 {
  font-size: 1.375rem;
}

.markdown h2 {
  font-size: 1.25rem;
}

.markdown h3 {
  font-size: 1.125rem;
}

.markdown :is(h4, h5, h6) {
  font-size: 1rem;
}

.markdown :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 1.5rem;
}

.markdown pre {
  background: var(--blueish-white);
  padding: 0.75rem 1rem;
  border-radius: var(--bs-border-radius-sm);
  overflow-x: auto;
}

.markdown code {
  color: inherit;
}

.markdown :not(pre) > code {
  background: var(--blueish-white);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.markdown table {
  border-collapse: collapse;
  margin: 1rem 0;
}

.markdown th,
.markdown td {
  border: var(--bs-border-width) solid var(--bs-border-color);
  padding: 0.35rem 0.6rem;
  text-align: left;
}

/* Bootstrap gives tooltips its own font stack rather than the body's, which is Inter. */
.luca-tooltip {
  font-family: var(--bs-body-font-family);
}

/* LucaUi::CodeComponent */
.code-block {
  margin: 0;
  padding: 0.75rem 0;
  background: var(--blueish-white);
  border-radius: var(--bs-border-radius);
  font-size: 0.8rem;
  line-height: 1.5;
  counter-reset: line;
  overflow-x: auto;
}

.code-block.collapsed {
  max-height: calc(var(--preview-lines) * 1.5em + 0.75rem);
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 70%, transparent);
}

.code-line {
  display: block;
  min-height: 1.5em;
  padding-right: 1rem;
  white-space: pre;
}

.code-line::before {
  content: counter(line);
  counter-increment: line;
  display: inline-block;
  width: 2.5rem;
  margin-right: 1rem;
  padding-right: 0.5rem;
  color: var(--bs-secondary-color);
  text-align: right;
  user-select: none;
}

/* A definition list of a record's details, labels on the left */
.details-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.details-list dt {
  color: var(--bs-secondary-color);
  font-weight: 500;
}

.details-list dd {
  margin: 0;
  min-width: 0;
}
