.codex-panel__status-menu-toggle {
  flex: 0 0 auto;
}

.codex-panel__toolbar-panel {
  display: flex;
  flex-direction: column;
  gap: var(--codex-panel-panel-gap);
  max-height: min(var(--codex-panel-size-toolbar-panel-max-height), 45vh);
  overflow: auto;
  margin-top: 0;
  margin-bottom: var(--codex-panel-panel-gap);
  padding: 0;
  background: transparent;
}

.codex-panel__toolbar-panel--status {
  max-height: min(var(--codex-panel-size-toolbar-status-panel-max-height), 55vh);
  cursor: text;
  user-select: text;
}

.codex-panel__status-panel-items {
  display: flex;
  flex-direction: column;
  gap: var(--nav-item-margin-bottom, var(--codex-panel-panel-gap));
}

.codex-panel__limit-panel {
  margin-top: var(--codex-panel-panel-gap);
  padding-top: var(--codex-panel-item-gap);
}

.codex-panel__limit-panel-title {
  padding: var(--codex-panel-section-label-padding);
  color: var(--codex-panel-section-label-color);
  font-size: var(--codex-panel-section-label-size);
  font-weight: var(--codex-panel-section-label-weight);
  line-height: var(--codex-panel-section-label-line-height);
}

.codex-panel__limit-panel-list {
  display: table;
  width: 100%;
  border-spacing: 0 var(--codex-panel-panel-gap);
  cursor: text;
  user-select: text;
}

.codex-panel__limit-panel-row {
  display: table-row;
}

.codex-panel__limit-panel-label,
.codex-panel__limit-panel-value,
.codex-panel__limit-panel-meter-cell,
.codex-panel__limit-panel-reset {
  min-width: 0;
  color: var(--codex-panel-text-muted);
  font-size: var(--font-ui-smaller);
  line-height: var(--codex-panel-compact-line-height);
  cursor: text;
  user-select: text;
}

.codex-panel__limit-panel-label {
  display: table-cell;
  padding: var(--codex-panel-control-gap) var(--codex-panel-section-gap) var(--codex-panel-control-gap) var(--codex-panel-section-gap);
}

.codex-panel__limit-panel-value {
  display: table-cell;
  padding: var(--codex-panel-control-gap) var(--codex-panel-section-gap) var(--codex-panel-control-gap) 0;
  font-variant-numeric: tabular-nums;
}

.codex-panel__limit-panel-meter-cell {
  display: table-cell;
  width: 100%;
  padding: 0 var(--codex-panel-section-gap) 0 0;
  vertical-align: middle;
}

.codex-panel__limit-panel-reset {
  display: table-cell;
  padding: var(--codex-panel-control-gap) var(--codex-panel-section-gap) var(--codex-panel-control-gap) 0;
  color: var(--codex-panel-text-faint);
  white-space: nowrap;
}

.codex-panel__limit-panel-meter {
  align-self: center;
  position: relative;
  height: var(--codex-panel-control-gap);
  margin: 0;
  overflow: hidden;
  border-radius: var(--codex-panel-radius-pill);
  background: var(--codex-panel-border-color);
}

.codex-panel__limit-panel-meter--divided::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc((100% / var(--codex-panel-limit-panel-divisions)) - 1px),
    color-mix(in srgb, var(--codex-panel-surface) 58%, transparent) calc((100% / var(--codex-panel-limit-panel-divisions)) - 1px),
    color-mix(in srgb, var(--codex-panel-surface) 58%, transparent) calc(100% / var(--codex-panel-limit-panel-divisions))
  );
}

.codex-panel__limit-panel-meter--5 {
  --codex-panel-limit-panel-divisions: 5;
}

.codex-panel__limit-panel-meter--7 {
  --codex-panel-limit-panel-divisions: 7;
}

.codex-panel__limit-panel-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--codex-panel-color-success);
}

.codex-panel__limit-panel-row--warn .codex-panel__limit-panel-fill {
  background: var(--codex-panel-color-warning);
}

.codex-panel__limit-panel-row--danger .codex-panel__limit-panel-fill {
  background: var(--codex-panel-color-danger);
}

.codex-panel__limit-panel-row--warn .codex-panel__limit-panel-value {
  color: var(--codex-panel-color-warning);
}

.codex-panel__limit-panel-row--danger .codex-panel__limit-panel-value {
  color: var(--codex-panel-color-danger);
}

.codex-panel__connection-diagnostics {
  margin-top: var(--codex-panel-panel-gap);
  padding-top: var(--codex-panel-item-gap);
}

.codex-panel__connection-diagnostics-title {
  padding: var(--codex-panel-section-label-padding);
  color: var(--codex-panel-section-label-color);
  font-size: var(--codex-panel-section-label-size);
  font-weight: var(--codex-panel-section-label-weight);
  line-height: var(--codex-panel-section-label-line-height);
}

.codex-panel__connection-diagnostics-section {
  padding: var(--codex-panel-section-label-block-padding);
  color: var(--codex-panel-section-label-color);
  font-size: var(--codex-panel-section-label-size);
  font-weight: var(--codex-panel-section-label-weight);
  line-height: var(--codex-panel-section-label-line-height);
}

.codex-panel__connection-diagnostics-title + .codex-panel__connection-diagnostics-section {
  padding-top: 0;
}

.codex-panel__connection-diagnostics-list {
  margin: 0;
  cursor: text;
  user-select: text;
}

.codex-panel__connection-diagnostics-row {
  display: grid;
  grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
  gap: var(--codex-panel-section-gap);
  padding: var(--codex-panel-control-gap) var(--codex-panel-section-gap);
}

.codex-panel__connection-diagnostics-row dt,
.codex-panel__connection-diagnostics-row dd {
  margin: 0;
  min-width: 0;
  font-size: var(--font-ui-smaller);
  line-height: var(--line-height-tight);
}

.codex-panel__connection-diagnostics-row dt {
  color: var(--codex-panel-text-faint);
  overflow-wrap: anywhere;
}

.codex-panel__connection-diagnostics-row dd {
  color: var(--codex-panel-text-muted);
  overflow-wrap: anywhere;
  cursor: text;
  user-select: text;
  white-space: pre-wrap;
}

.codex-panel__connection-diagnostics-row--warning dd {
  color: var(--codex-panel-color-warning);
}

.codex-panel__connection-diagnostics-row--error dd {
  color: var(--codex-panel-color-danger);
}
