/* Admin LLM / JsonField: keep long request/reply payloads on-screen. */
.app-container,
.main-content {
  min-inline-size: 0;
  max-inline-size: 100%;
}

.main-content__header .header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.main-content__header .header-actions form.button_to {
  margin: 0;
}

.main-content__body,
.main-content__body dl,
.main-content__body fieldset,
.main-content__body table {
  max-inline-size: 100%;
  min-inline-size: 0;
}

.attribute-data,
.attribute-data--text,
.attribute-data--string {
  min-inline-size: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.attribute-data--json-field {
  min-inline-size: 0;
  overflow-x: auto;
}

.json-payload {
  display: block;
  max-inline-size: 100%;
  margin-block: 0;
  overflow-wrap: anywhere;
}

pre.json-payload {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}

.admin-copy-source {
  position: absolute;
  inset-inline-start: -9999px;
}

/* Error log: Unresolved | Resolved filter */
nav.resolved-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;

  a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 2.75rem;
    padding-inline: 1rem;
    border: thin solid #d4dae4;
    border-radius: 0.375rem;
    background: #fff;
    color: #66738a;
    font-weight: 600;
    text-decoration: none;

    &:hover { background: #f3f5f8; }

    &[aria-current="true"] {
      background: #293241;
      border-color: #293241;
      color: #fff;
    }

    &:focus { outline: none; }

    &:focus-visible {
      outline: 0.08rem solid rgba(25, 118, 210, 0.45);
      outline-offset: 0.15em;
    }
  }
}

/* Monospace dump: Error log backtrace, context. */
.admin-log-dump {
  margin: 0;
  max-block-size: 40dvh;
  overflow: auto;
  padding: 0.75rem 1rem;
  border: thin solid #d4dae4;
  border-radius: 0.375rem;
  background: #f8f9fb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


textarea.admin-autosize {
  inline-size: 100%;
  min-height: 10rem;
  max-height: 60vh;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* /to link: full bounce URL with an icon-only copy button. */
.to-link-url {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  overflow-wrap: anywhere;
}

button.to-link-copy {
  padding: 0.125rem 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
}

/* Grouped sidebar navigation: section subtitles between resource groups. */
.navigation__section {
  padding-block-start: 0.75rem;
}

.navigation__subtitle {
  padding: 0 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #8f8f9d);
}

/* Mobile: keep wide index tables scrollable inside the content panel
   instead of stretching the whole page sideways, and break long
   unbreakable strings (callback URLs, slugs, payload codes). */
.main-content__body {
  overflow-x: auto;
  max-width: 100%;
}

.cell-data,
.attribute-data {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .app-container {
    flex-direction: column;
  }

  .navigation {
    width: auto;
    max-height: none;
  }

  .main-content {
    padding: 0.75rem;
  }

  .main-content__header {
    flex-wrap: wrap;
  }

  .cell-label--action-buttons {
    white-space: normal;
  }

  .main-content__body table {
    width: 100%;
    table-layout: fixed;
  }

  .cell-label,
  .cell-data,
  .cell-data a,
  .cell-data code {
    overflow-wrap: anywhere;
  }
}
