/* Semantic colors are independent of the user's brand accent. Opaque pairs
   retain their contrast on every palette, hover surface, and OLED background. */
:root {
  --issue-badge-neutral-text: #52616c;
  --issue-badge-neutral-bg: #eef1f4;
  --issue-badge-blue-text: #1857b8;
  --issue-badge-blue-bg: #dbeafe;
  --issue-badge-red-text: #b42332;
  --issue-badge-red-bg: #fee2e2;
  --issue-badge-amber-text: #9a450c;
  --issue-badge-amber-bg: #fff0dc;
  --issue-badge-green-text: #236542;
  --issue-badge-green-bg: #eaf4ed;
}

html[data-theme="dark"] {
  --issue-badge-neutral-text: #c0cbd4;
  --issue-badge-neutral-bg: #2d3743;
  --issue-badge-blue-text: #b5d5ff;
  --issue-badge-blue-bg: #193f6d;
  --issue-badge-red-text: #ffb4bb;
  --issue-badge-red-bg: #54242e;
  --issue-badge-amber-text: #ffc37a;
  --issue-badge-amber-bg: #493222;
  --issue-badge-green-text: #9ad7b2;
  --issue-badge-green-bg: #253e30;
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) .plana-issue-badge,
.plana-roadmap-tracker .plana-issue-badge {
  --badge-text: var(--issue-badge-neutral-text);
  --badge-bg: var(--issue-badge-neutral-bg);
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.22rem 0.55rem;
  border: 0;
  border-radius: 0.4rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) .plana-issue-badge[data-badge-tone="blue"] {
  --badge-text: var(--issue-badge-blue-text);
  --badge-bg: var(--issue-badge-blue-bg);
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) .plana-issue-badge[data-badge-tone="amber"] {
  --badge-text: var(--issue-badge-amber-text);
  --badge-bg: var(--issue-badge-amber-bg);
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) .plana-issue-badge[data-badge-tone="red"] {
  --badge-text: var(--issue-badge-red-text);
  --badge-bg: var(--issue-badge-red-bg);
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) .plana-issue-badge[data-badge-tone="green"] {
  --badge-text: var(--issue-badge-green-text);
  --badge-bg: var(--issue-badge-green-bg);
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) .plana-issue-badge[data-badge-kind="status"] {
  border-radius: 999px;
}

.plana-issue-badge-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 1.125rem;
}

.plana-issue-badge-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Preserve the accessible name without reserving label space in icon badges. */
.plana-issue-badge[data-badge-icon="true"] .plana-issue-badge-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.plana-roadmap-tracker {
  display: inline-block;
  vertical-align: middle;
}

/* The badge owns its surface, not the shared editor's display wrapper. */
.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) td.status .plana-inline-display {
  border: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
}

/* Include room for the content-adjacent pencil and custom text fallbacks.
   Keep these widths in sync with issueListColumnBudgets in theme.js. */
.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) :is(th, td).priority {
  width: 8rem !important;
  min-width: 8rem !important;
  max-width: 8rem !important;
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) :is(th, td).tracker {
  width: 9rem !important;
  min-width: 9rem !important;
  max-width: 9rem !important;
}

.controller-issues.action-index table.list.issues:not(.plana-subtasks-table) :is(th, td).status {
  width: 10rem !important;
  min-width: 10rem !important;
  max-width: 10rem !important;
}
