/* Azure DevOps */
/* ── Azure DevOps Inbox ── */
.azure-inbox {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.azure-inbox__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.azure-inbox__tabs {
  display: flex;
  gap: 2px;
}

.azure-inbox__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.azure-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.azure-tab:hover {
  color: var(--text);
  background: rgba(var(--tint), 0.04);
}

.azure-tab--active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(var(--tint), 0.05);
}

.azure-tab--alert {
  color: var(--danger);
}

.azure-tab--alert.azure-tab--active {
  border-color: var(--danger);
}

.azure-tab__count {
  font-weight: 700;
  font-size: 11px;
  min-width: 20px;
  text-align: center;
  border-radius: 9px;
  padding: 1px 6px;
  background: color-mix(in srgb, var(--accent), transparent 78%);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 55%);
  color: var(--accent);
  line-height: 16px;
}

.azure-tab--active .azure-tab__count {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.azure-tab--alert .azure-tab__count {
  background: color-mix(in srgb, var(--danger), transparent 78%);
  border-color: color-mix(in srgb, var(--danger), transparent 55%);
  color: var(--danger);
}

.azure-tab--alert.azure-tab--active .azure-tab__count {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--bg);
}

.azure-inbox__content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

.azure-section {
  display: none;
}

.azure-section--active {
  display: block;
}

.azure-repo-group {
  margin-bottom: 6px;
  border-left: 3px solid color-mix(in srgb, var(--accent), transparent 55%);
  background: rgba(var(--tint), 0.02);
  border-radius: 0 4px 4px 0;
}

.azure-repo-group__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent), transparent 88%) 0%,
    color-mix(in srgb, var(--accent), transparent 96%) 70%,
    transparent 100%
  );
  position: sticky;
  top: 0;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.azure-repo-group__header::before {
  content: "▸";
  color: var(--accent);
  font-size: 10px;
  opacity: 0.7;
}

/* Indent the PR rows under a project/repo group so the nesting reads
   visually — the user reported it was "almost invisible". */
.azure-repo-group .azure-pr-row {
  padding-left: 26px;
}

.azure-repo-group__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.azure-repo-group__count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 80%);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 60%);
  padding: 1px 7px;
  border-radius: 9px;
  line-height: 16px;
}

/* Inline icon prefix on chips — keeps the chip width balanced and gives
   the small badge enough visual weight to register at a glance. */
.workspace-chip .chip-icon {
  display: inline-block;
  margin-right: 3px;
  font-size: 11px;
  line-height: 1;
  vertical-align: -1px;
}

/* Make the seen button keep its slot in the row when the PR has no
   attention flag — disabled style instead of removed-from-DOM, so the
   neighbouring buttons don't shift left and right as PRs cycle in/out
   of the attention list. */
.azure-pr-row__actions .button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Inline hint used in the Needs Attention sub-bucket headers — explains
   why this group needs attention (e.g. "PRs where you are an explicit
   reviewer..."). Reuses the same .azure-repo-group__header frame. */
.azure-repo-group__hint {
  font-size: 11px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.azure-pr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.azure-pr-row:hover {
  background: rgba(var(--tint), 0.03);
}

.azure-pr-row__main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.azure-pr-row__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.azure-pr-row__title strong {
  font-size: 14px;
}

.azure-pr-row__id {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}

.azure-pr-row__meta {
  display: flex;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.azure-pr-row__branch {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.azure-pr-row__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 2px;
  margin-left: auto;
  justify-content: flex-end;
  align-items: center;
}

/* Caret toggle that expands the row to reveal description, status, and
   reviewer info inline. Uses a tight square so it doesn't push the title
   down a line on dense lists. */
.azure-pr-row__expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(var(--tint), 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
}

.azure-pr-row__expand:hover {
  border-color: color-mix(in srgb, var(--accent), transparent 50%);
  color: var(--text);
}

.azure-pr-row--expanded .azure-pr-row__expand {
  border-color: color-mix(in srgb, var(--accent), transparent 50%);
  color: var(--accent);
}

.azure-pr-row__expand-caret {
  display: inline-block;
  transform: translateY(-1px);
}

.azure-pr-row__details {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(var(--tint), 0.025);
  display: grid;
  gap: 8px;
}

.azure-pr-row__description {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.azure-pr-row__description--empty {
  color: var(--muted);
  font-style: italic;
}

.azure-pr-row__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 16px;
  margin: 0;
}

.azure-pr-row__fact {
  display: grid;
  gap: 1px;
}

.azure-pr-row__fact dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.azure-pr-row__fact dd {
  margin: 0;
  font-size: 12px;
  color: var(--text);
}

.azure-pr-row__fact code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.azure-pr-row__comment-preview {
  margin: 0;
  padding: 6px 8px;
  border-left: 2px solid color-mix(in srgb, var(--accent), transparent 50%);
  background: rgba(var(--tint), 0.02);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  display: grid;
  gap: 2px;
}

.azure-pr-row__comment-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.azure-pr-row__comment-body {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Right-align the action cluster on connection cards, review summary,
   and similar action rows. The user explicitly asked for buttons to
   line up on the right across all comparable forms. */
.docker-card__actions--end {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

/* Diff toolbar above the Monaco panel in the Files tab. Holds the
   per-commit selector for 6.1. */
.review-diff-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.review-diff-toolbar__title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* File name on top, full + prominent. */
.review-diff-toolbar__name {
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Directory path below — truncate from the LEFT (rtl trick) so the most
   specific path segments stay visible when there's not enough room. */
.review-diff-toolbar__path {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
}

.review-diff-toolbar__commit-select {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 220px;
  max-width: 360px;
}

.review-diff-monaco {
  flex: 1;
  min-height: 0;
  display: flex;
}

.azure-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

.azure-connection-list {
  padding: 0 4px 4px;
}

.azure-review-root,
.azure-review__description {
  white-space: pre-wrap;
}

.review-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.review-subtabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.review-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.review-content > * {
  min-height: 0;
}

.review-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-right: 4px;
}

.review-grid {
  display: grid;
  gap: 8px;
  align-content: start;
}

.review-grid--summary {
  grid-template-columns: minmax(320px, 1.2fr) minmax(240px, 0.8fr);
  align-items: start;
}

.review-sidebar {
  display: grid;
  gap: 8px;
  align-content: start;
}

.review-grid--drafts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-grid--agent {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-card {
  min-height: 0;
}

.review-card--hero {
  grid-column: 1;
}

.review-card--stack {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-card__list {
  min-height: 0;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.review-card__list--dense {
  max-height: none;
  flex: 1;
  align-content: start;
}

.review-meta-list {
  display: grid;
  gap: 8px;
}

.review-check__meta,
.review-check__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

.review-check__meta {
  color: var(--muted);
  font-size: 12px;
}

.review-check__description {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  white-space: pre-wrap;
}

.review-agent-prompts {
  display: grid;
  gap: 8px;
}

/* ── Enhanced checks ────────────────────────────────────────────────── */

.review-check-item {
  transition: background 0.15s ease;
}

.review-check-item:hover {
  background: rgba(var(--tint), 0.04);
}

.review-check__error {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(255, 50, 50, 0.12);
  border: 1px solid rgba(255, 50, 50, 0.25);
  border-radius: 3px;
  color: #ff9090;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Mono", "JetBrains Mono", "Fira Code", "Consolas", monospace;
  max-height: 140px;
  overflow-y: auto;
}

/* ── Pipelines tab ─────────────────────────────────────────────────── */

.pipelines-tab {
  padding: 0 12px 12px;
}

.pipelines-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.pipelines-error {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(255, 50, 50, 0.12);
  border: 1px solid rgba(255, 50, 50, 0.25);
  border-radius: 4px;
  color: #ff9090;
  font-size: 12px;
  cursor: pointer;
}

.pipelines-error small {
  color: var(--muted);
  margin-left: 8px;
}

.pipelines-summary__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pipelines-summary__badge--failed {
  background: rgba(255, 50, 50, 0.18);
  color: #ff7070;
}

.pipelines-summary__badge--pending {
  background: rgba(255, 180, 50, 0.18);
  color: var(--accent);
}

.pipelines-summary__badge--passed {
  background: rgba(110, 223, 182, 0.15);
  color: var(--success-fg);
}

.pipelines-list {
  display: grid;
  gap: 2px;
}

.pipeline-item {
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.pipeline-item:hover {
  background: rgba(var(--tint), 0.04);
}

.pipeline-item--expanded {
  background: rgba(var(--tint), 0.04);
}

.pipeline-item__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
}

.pipeline-item__icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  font-size: 13px;
  line-height: 1;
}

.pipeline-item__icon--succeeded {
  color: var(--success-fg);
}

.pipeline-item__icon--failed {
  color: var(--danger);
}

.pipeline-item__icon--pending {
  color: var(--accent);
  animation: pulse-check 1.8s ease-in-out infinite;
}

.pipeline-item__icon--not-applicable {
  color: var(--muted);
}

@keyframes pulse-check {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.pipeline-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pipeline-item__name {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-item__state-label {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.pipeline-item__badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pipeline-item__opt-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(var(--tint), 0.06);
  color: var(--muted);
}

.pipeline-item__opt-badge--req {
  background: rgba(255, 180, 50, 0.12);
  color: var(--accent);
}

.pipeline-item__time {
  font-size: 10.5px;
  color: var(--muted);
  flex-shrink: 0;
}

.pipeline-item__time--running {
  color: var(--accent);
}

.pipeline-item__rerun {
  all: unset;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  padding: 0 2px;
  border-radius: 3px;
  transition:
    color 0.12s,
    background 0.12s;
}

.pipeline-item__rerun:hover {
  color: var(--accent);
  background: rgba(var(--tint), 0.06);
}

.pipeline-item__rerun:disabled {
  opacity: 0.4;
  cursor: default;
}

.pipeline-item__link {
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.12s;
}

.pipeline-item__link:hover {
  opacity: 1;
}

.pipelines-summary__polling {
  font-size: 10px;
  color: var(--accent);
  animation: pulse-check 1.8s ease-in-out infinite;
}

.pipeline-item__detail {
  padding: 4px 8px 10px 36px;
  font-size: 12px;
  display: grid;
  gap: 6px;
}

.pipeline-item__desc {
  color: var(--fg);
}

.pipeline-item__meta {
  color: var(--muted);
  font-size: 11px;
}

.pipeline-item__meta-label {
  font-weight: 600;
  margin-right: 4px;
}

.pipeline-item__error {
  padding: 8px 10px;
  background: rgba(255, 50, 50, 0.12);
  border: 1px solid rgba(255, 50, 50, 0.25);
  border-radius: 3px;
  color: #ff9090;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Mono", "JetBrains Mono", "Fira Code", "Consolas", monospace;
  max-height: 200px;
  overflow-y: auto;
}

.pipelines-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Comment cards ──────────────────────────────────────────────────── */

.review-comment-card {
  border-left: 3px solid var(--border);
  transition: border-color 0.2s ease;
  gap: 2px;
  padding: 6px 10px;
  align-content: start;
}

/* Keep review comment actions compact — override the responsive grid */
.review-comment-card .docker-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.review-comment-card:hover {
  border-left-color: var(--accent);
}

.review-comment-card--local {
  border-left-color: color-mix(in srgb, var(--accent), transparent 50%);
  background: rgba(255, 164, 36, 0.03);
}

/* File context header */
.review-comment-file {
  font-size: 12px;
  font-family: "Cascadia Mono", "JetBrains Mono", "Fira Code", "Consolas", monospace;
  color: var(--text);
  font-weight: 600;
}

.review-comment-line {
  color: var(--accent);
}

.review-comment-context {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow-x: auto;
}

.review-comment-context__path {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

.review-code-snippet {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(var(--tint), 0.06);
  border-radius: 3px;
  font-family: "Cascadia Mono", "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  max-height: 180px;
  color: var(--text);
  tab-size: 4;
}

/* Thread container */
.review-comment-thread {
  display: grid;
  gap: 0;
}

/* Individual comment */
.review-comment {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.review-comment:first-child {
  border-top: none;
}

.review-comment--reply {
  padding-left: 24px;
  background: rgba(var(--tint), 0.015);
}

.review-comment--draft {
  background: rgba(255, 164, 36, 0.05);
  border-left: 2px solid var(--accent);
  margin: 4px 0;
  border-radius: 3px;
  display: block;
  padding: 10px 12px;
}

.review-comment--fix-summary {
  background: rgba(76, 175, 80, 0.06);
  border-left: 2px solid var(--success, #4caf50);
  margin: 4px 0;
  border-radius: 3px;
  display: block;
  padding: 10px 12px;
}

/* Avatar */
.review-comment__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Comment header */
.review-comment__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 4px;
}

.review-comment__header strong {
  font-weight: 600;
}

.review-comment__date {
  font-size: 11px;
  color: var(--muted);
}

/* Markdown body */
.review-comment__body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  overflow-wrap: anywhere;
}

.review-comment__body code {
  padding: 1px 5px;
  background: rgba(var(--tint), 0.08);
  border: 1px solid rgba(var(--tint), 0.06);
  border-radius: 3px;
  font-family: "Cascadia Mono", "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 12px;
}

.review-comment__body strong {
  font-weight: 700;
}

.review-comment__body em {
  font-style: italic;
  color: color-mix(in srgb, var(--text), var(--muted) 20%);
}

.review-comment__body pre {
  margin: 6px 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow-x: auto;
  font-family: "Cascadia Mono", "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.review-comment__body pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: inherit;
}

/* Draft card visual marker */
.review-draft-card {
  border-left: 3px solid #e0a020;
  background: rgba(255, 200, 0, 0.06);
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
}

.review-draft-card .eyebrow {
  color: #e0a020;
}

/* Section divider */
.review-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.review-section-divider::before,
.review-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Files tab — split layout like Git Changes */
.review-files-split {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.review-files-split__left {
  padding: 10px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  min-height: 0;
}

.review-files-split__right {
  padding: 10px;
  overflow-y: auto;
  min-height: 0;
  /* Flex column so the diff body (MonacoDiffPanel / DiffViewer / hint) can
     fill remaining height under the toolbar. With display:grid the rows
     collapsed to their content height and Monaco rendered with h=0. */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-files-split__right .git-output--preview {
  max-height: none;
  flex: 1;
  min-height: 0;
  font-size: 11.5px;
}

.review-files-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  opacity: 0.5;
}

/* File tree */
.review-file-tree {
  font-size: 13px;
}

.review-tree-dir {
  margin: 0;
}

.review-tree-dir > summary {
  list-style: none;
}

.review-tree-dir > summary::-webkit-details-marker {
  display: none;
}

.review-tree-dir__label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  border-radius: 3px;
  user-select: none;
}

.review-tree-dir__label:hover {
  background: rgba(var(--tint), 0.04);
}

.review-tree-dir__icon::before {
  content: "\25B6";
  display: inline-block;
  font-size: 8px;
  color: var(--muted);
  transition: transform 0.15s ease;
  width: 10px;
  text-align: center;
}

details[open] > .review-tree-dir__label .review-tree-dir__icon::before {
  transform: rotate(90deg);
}

.review-tree-dir__label span:last-child {
  color: var(--accent);
  font-weight: 500;
}

.review-tree-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border: none;
  border-radius: 3px;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  width: 100%;
}

.review-tree-file:hover {
  background: rgba(var(--tint), 0.04);
}

.review-tree-file--active {
  background: color-mix(in srgb, var(--panel-elevated, rgba(var(--tint), 0.06)), var(--accent) 10%);
}

.review-tree-file__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.review-diff-output {
  max-height: none;
  font-size: 11.5px;
}

/* Conflicts */
.review-conflict-status {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(var(--tint), 0.02);
}

/* Summary tab meta */
.review-meta {
  font-size: 12px;
  color: var(--muted);
}

.review-meta__label {
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}

/* Conflict banner on Summary */
.review-conflict-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 4px;
  margin: 8px 0 4px;
}

.review-conflict-banner--danger {
  background: rgba(255, 111, 141, 0.08);
  border: 1px solid rgba(255, 111, 141, 0.25);
}

.review-conflict-banner--ok {
  background: rgba(110, 223, 182, 0.06);
  border: 1px solid rgba(110, 223, 182, 0.18);
}

.review-conflict-banner__icon {
  font-size: 16px;
  line-height: 20px;
  flex-shrink: 0;
}

.review-conflict-banner--danger .review-conflict-banner__icon {
  color: var(--danger);
}

.review-conflict-banner--ok .review-conflict-banner__icon {
  color: var(--success-fg);
}

.review-conflict-banner strong {
  font-size: 13px;
}

.review-conflict-banner__hint {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.review-conflict-banner__hint code {
  font-size: 11px;
  background: rgba(var(--tint), 0.06);
  padding: 1px 4px;
  border-radius: 2px;
}

.review-conflict-files {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-conflict-files li {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--danger);
}

/* Check row in sidebar */
.review-check-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
}

.review-check-icon {
  font-size: 13px;
  line-height: 18px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.review-check-icon--passed,
.review-check-icon--approved {
  color: var(--success-fg);
}

.review-check-icon--failed,
.review-check-icon--rejected {
  color: var(--danger);
}

.review-check-icon--pending {
  color: var(--accent);
}

/* Vote badge */
.review-vote-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.review-vote-badge--approved {
  background: rgba(110, 223, 182, 0.15);
  color: var(--success-fg);
}

.review-vote-badge--rejected {
  background: rgba(255, 111, 141, 0.15);
  color: var(--danger);
}

.review-vote-badge--none {
  background: rgba(var(--tint), 0.06);
  color: var(--muted);
}

/* Agent prompt cards */
.review-agent-card .docker-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.review-copy-btn {
  padding: 4px 6px !important;
  min-width: 0 !important;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.review-copy-btn:hover {
  opacity: 1;
}

.review-agent-prompt {
  font-size: 11.5px;
  max-height: 140px;
  cursor: text;
  user-select: all;
}

/* ──────────────────────────────────────────────────────────────────────
   Mobile: compact Azure DevOps Inbox + GitHub Inbox + Review pane.

   Same compound breakpoint as git.css / mobile.css — covers portrait
   phones (≤768px wide) and landscape phones (≤500px tall). Strategy
   mirrors the Git pane redesign:
     - Tabs collapse into a "[active tab] ▼" popover trigger top-left
     - Actions collapse into a "⋮ Actions" popover trigger top-right
     - Backdrop overlay catches outside clicks to dismiss popovers
     - PR rows reflow: title + meta on top, action buttons stretch
       across a second row instead of squeezing into a sliver
     - Files-tab split (file tree | diff) stacks vertically in portrait,
       stays side-by-side in landscape so the diff still gets width
   ────────────────────────────────────────────────────────────────────── */
.azure-inbox__menu-trigger,
.azure-inbox__tabs-trigger,
.azure-inbox__menu-backdrop,
.review-shell__menu-trigger,
.review-shell__tabs-trigger,
.review-shell__menu-backdrop {
  display: none;
}

@media (max-width: 768px), (max-height: 500px) {
  /* ── Inbox pane (Azure / GitHub share these classes via .azure-inbox) ── */
  .azure-inbox {
    position: relative;
  }

  /* Header strip (32px) reserved for the two trigger buttons. The full
     toolbar pops over it when --menu-open or --tabs-menu-open. */
  .azure-inbox__toolbar {
    display: none;
  }

  .azure-inbox--menu-open .azure-inbox__toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    position: absolute;
    top: 36px;
    left: 5px;
    right: 5px;
    z-index: 50;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-elevated);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: calc(100% - 60px);
    overflow-y: auto;
  }

  /* When the actions popover is open, hide the tabs strip — only show
     the action cluster. (If both panes were on screen the popover would
     dwarf the data behind it.) */
  .azure-inbox--menu-open .azure-inbox__tabs {
    display: none;
  }

  .azure-inbox--tabs-menu-open .azure-inbox__toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 36px;
    left: 5px;
    right: 5px;
    z-index: 50;
    padding: 4px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-elevated);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: calc(100% - 60px);
    overflow-y: auto;
  }
  .azure-inbox--tabs-menu-open .azure-inbox__actions {
    display: none;
  }
  .azure-inbox--tabs-menu-open .azure-inbox__tabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .azure-inbox--tabs-menu-open .azure-tab {
    padding: 10px 12px;
    text-align: left;
    border-radius: 0;
    border: none;
    border-left: 3px solid transparent;
    font-size: 13px;
    width: 100%;
    flex: 0 0 auto;
    justify-content: space-between;
  }
  .azure-inbox--tabs-menu-open .azure-tab--active {
    border-left-color: var(--accent);
    background: rgba(var(--tint), 0.08);
  }

  /* Action cluster: full width, buttons stretch so taps don't miss. */
  .azure-inbox--menu-open .azure-inbox__actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }
  .azure-inbox--menu-open .azure-inbox__actions .button {
    flex: 1 1 auto;
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Triggers — fixed pinning so tabs/actions are always reachable
     regardless of scroll position. */
  .azure-inbox__menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 50;
  }
  .azure-inbox__menu-trigger:hover {
    background: rgba(var(--tint), 0.08);
  }
  .azure-inbox__menu-trigger__dot {
    font-size: 16px;
    line-height: 1;
  }

  .azure-inbox__tabs-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 50;
    max-width: calc(100% - 110px);
  }
  .azure-inbox__tabs-trigger__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .azure-inbox__tabs-trigger__caret {
    font-size: 9px;
    opacity: 0.7;
    flex-shrink: 0;
  }

  .azure-inbox__menu-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 40;
  }

  /* Reserve a 36px chrome strip at the top so the popovers know where to
     anchor and the content area starts below it. */
  .azure-inbox__content {
    margin-top: 36px;
    padding: 0;
  }

  /* Content area itself — keep paddings tight. */
  .azure-section {
    padding: 4px;
  }

  /* PR row: stack title/meta and the action cluster vertically so the
     buttons get full width instead of being squeezed off-screen. */
  .azure-pr-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .azure-pr-row__main {
    width: 100%;
  }
  .azure-pr-row__title {
    flex-wrap: wrap;
  }
  .azure-pr-row__title strong {
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .azure-pr-row__branch {
    white-space: normal;
    word-break: break-all;
  }
  .azure-pr-row__actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .azure-pr-row__actions .button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 10px;
    font-size: 12px;
  }
  .azure-repo-group .azure-pr-row {
    /* drop the desktop indent so the cards use full width on phones */
    padding-left: 12px;
  }

  /* Repo group header reads better wrapped on narrow screens. */
  .azure-repo-group__header {
    flex-wrap: wrap;
    padding: 8px 12px 6px;
  }
  .azure-repo-group__hint {
    flex: 1 1 100%;
  }

  /* ── Review pane ── */
  .review-shell {
    position: relative;
  }
  .review-shell .git-view__toolbar {
    /* The review pane reuses .git-view__toolbar — collapse it under a
       trigger like in the Git pane. */
    display: none;
  }
  .review-shell--menu-open .git-view__toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    position: absolute;
    top: 36px;
    left: 5px;
    right: 5px;
    z-index: 50;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-elevated);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: calc(100% - 60px);
    overflow-y: auto;
  }
  .review-shell--menu-open .git-view__summary,
  .review-shell--menu-open .git-view__actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }
  .review-shell--menu-open .git-view__actions .button {
    flex: 1 1 auto;
    padding: 8px 10px;
    font-size: 12px;
  }

  .review-shell .review-subtabs {
    display: none;
  }
  .review-shell--tabs-menu-open .review-subtabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 36px;
    left: 5px;
    right: 5px;
    z-index: 50;
    padding: 4px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-elevated);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: calc(100% - 60px);
    overflow-y: auto;
  }
  .review-shell--tabs-menu-open .azure-tab {
    padding: 10px 12px;
    text-align: left;
    border-radius: 0;
    border: none;
    border-left: 3px solid transparent;
    width: 100%;
    flex: 0 0 auto;
    justify-content: space-between;
    font-size: 13px;
  }
  .review-shell--tabs-menu-open .azure-tab--active {
    border-left-color: var(--accent);
    background: rgba(var(--tint), 0.08);
  }

  .review-shell__menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 50;
  }
  .review-shell__menu-trigger:hover {
    background: rgba(var(--tint), 0.08);
  }
  .review-shell__menu-trigger__dot {
    font-size: 16px;
    line-height: 1;
  }

  .review-shell__tabs-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 50;
    max-width: calc(100% - 110px);
  }
  .review-shell__tabs-trigger__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .review-shell__tabs-trigger__caret {
    font-size: 9px;
    opacity: 0.7;
    flex-shrink: 0;
  }

  .review-shell__menu-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 40;
  }

  .review-shell .review-content {
    margin-top: 36px;
    padding: 8px;
  }

  /* Files split (file tree + Monaco diff): in portrait the diff barely
     gets any width. Stack them: tree on top with a fixed cap, diff
     fills the rest. In landscape phones we keep them side-by-side via
     the (max-height: 500px) rule below. */
  .review-files-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(120px, 30vh) minmax(0, 1fr);
  }
  .review-files-split__left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 30vh;
  }

  /* Summary cards stack instead of trying for two columns. */
  .review-grid--summary,
  .review-grid--drafts,
  .review-grid--agent {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Pre-PR ("New branch") form layout — ditto. */
  .review-shell .nb-step {
    flex-wrap: wrap;
  }
}

/* Landscape phones: keep the file-tree + diff side-by-side because the
   width is just enough, and the height is too short to tolerate a
   stacked layout (the diff would only get ~150px of vertical room). */
@media (max-width: 768px) and (min-aspect-ratio: 13/10), (max-height: 500px) and (min-width: 480px) {
  .review-files-split {
    grid-template-columns: minmax(160px, 0.4fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .review-files-split__left {
    border-right: 1px solid var(--border);
    border-bottom: none;
    max-height: none;
  }
}
