.codex-panel__toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.codex-panel__limit-panel-label,
.codex-panel__limit-panel-value,
.codex-panel__limit-panel-reset,
.codex-panel__toolbar-panel-label,
.codex-panel__toolbar-panel-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-panel__toolbar-panel-item {
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
  font: inherit;
  font-size: var(--codex-panel-toolbar-text-size);
  line-height: var(--codex-panel-toolbar-line-height);
  text-align: left;
}

.codex-panel-ui__nav-item.codex-panel__toolbar-panel-item {
  justify-content: flex-start;
  height: auto;
  background: transparent;
  box-shadow: none;
  color: var(--nav-item-color, var(--text-muted));
}

.codex-panel__toolbar-panel-label,
.codex-panel__toolbar-panel-meta {
  min-width: 0;
}

.codex-panel__toolbar-panel-label {
  flex: 1 1 auto;
  color: currentcolor;
}

.codex-panel__toolbar-panel-meta {
  flex: 0 1 auto;
  color: var(--text-faint);
  font-size: var(--codex-panel-toolbar-meta-size);
}

.codex-panel__toolbar-panel-item:where(:hover, :focus-visible, :active):not(:disabled):not(.is-disabled) .codex-panel__toolbar-panel-label {
  color: var(--nav-item-color-hover, var(--text-normal));
}

.codex-panel__toolbar-panel-item:where(:hover, :focus-visible, :active):not(:disabled):not(.is-disabled) .codex-panel__toolbar-panel-meta {
  color: var(--nav-item-color-hover, var(--text-normal));
}

.codex-panel__toolbar-panel-item.is-selected .codex-panel__toolbar-panel-label,
.codex-panel__toolbar-panel-item.is-selected:where(:hover, :focus, :focus-visible, :active) .codex-panel__toolbar-panel-label,
.codex-panel__toolbar-panel-item.is-selected .codex-panel__toolbar-panel-meta,
.codex-panel__toolbar-panel-item.is-selected:where(:hover, :focus, :focus-visible, :active) .codex-panel__toolbar-panel-meta {
  color: var(--nav-item-color-active, var(--text-normal));
}

.codex-panel__toolbar-panel-item:focus:not(.is-selected),
.codex-panel__toolbar-panel-item:focus-visible:not(.is-selected),
.codex-panel__toolbar-panel-item:active:not(.is-selected) {
  background: transparent;
  box-shadow: none;
  outline: none;
}

.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__status-diagnostics {
  margin-top: var(--codex-panel-panel-gap);
  padding-top: var(--codex-panel-item-gap);
}

.codex-panel__status-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__status-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__status-diagnostics-title + .codex-panel__status-diagnostics-section {
  padding-top: 0;
}

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

.codex-panel__status-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__status-diagnostics-row dt,
.codex-panel__status-diagnostics-row dd {
  margin: 0;
  min-width: 0;
  font-size: var(--font-ui-smaller);
  line-height: var(--line-height-tight);
}

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

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

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

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

.codex-panel__threads {
  display: flex;
  flex-direction: column;
  gap: var(--nav-item-margin-bottom, var(--codex-panel-panel-gap));
  min-width: 0;
  max-width: 100%;
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
}

.codex-panel__thread-row {
  grid-template-columns: minmax(0, 1fr) 0 0;
  gap: 0;
}

.codex-panel__thread-row:hover,
.codex-panel__thread-row:focus-within {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--codex-panel-panel-gap);
}

.codex-panel__thread-row--renaming {
  grid-template-columns: minmax(0, 1fr) 0;
}

.codex-panel__thread-row--renaming:hover,
.codex-panel__thread-row--renaming:focus-within {
  grid-template-columns: minmax(0, 1fr) auto;
}

.codex-panel__thread-row--archive-confirming {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--codex-panel-panel-gap);
}

.codex-panel__thread-rename {
  box-sizing: border-box;
  min-height: var(--codex-panel-size-nav-item);
  cursor: text;
}

.codex-panel__thread-rename-field {
  display: flex;
  flex: 1 1 auto;
  align-self: stretch;
  align-items: center;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: visible;
  font-size: var(--codex-panel-toolbar-text-size);
  line-height: var(--codex-panel-toolbar-line-height);
}

.codex-panel__thread-rename-input {
  width: 100%;
}

.codex-panel__thread {
  min-height: var(--codex-panel-size-nav-item);
  margin: 0;
  box-shadow: none;
}

.codex-panel__thread-action {
  min-width: 0;
  width: 0;
  padding: var(--codex-panel-control-gap) 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
}

.codex-panel__thread-row:hover .codex-panel__thread-action,
.codex-panel__thread-row:focus-within .codex-panel__thread-action,
.codex-panel__thread-action:focus-visible {
  min-width: calc(var(--icon-size) + var(--codex-panel-control-gap) * 2);
  width: auto;
  padding: var(--codex-panel-control-gap);
  overflow: visible;
  visibility: visible;
  opacity: 1;
}

.codex-panel__thread-row:hover .codex-panel__thread-action:disabled,
.codex-panel__thread-row:focus-within .codex-panel__thread-action:disabled {
  opacity: 0.4;
}

.codex-panel__thread-row--archive-confirming .codex-panel__thread-action {
  min-width: calc(var(--icon-size) + var(--codex-panel-control-gap) * 2);
  width: auto;
  padding: var(--codex-panel-control-gap);
  overflow: visible;
  visibility: visible;
  opacity: 1;
}

.codex-panel__thread--empty {
  color: var(--text-faint);
  pointer-events: none;
}
