/* GitHub Actions access and Workspace spending in Project settings → Connections.
   Uses the shared settings tokens so light and dark appearance follow the shell;
   readable text stays at 12px or larger, labels and pills at 11px. */

.gha-brand {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #fff;
  background: #1b2a27;
  box-shadow: 0 3px 9px rgb(0 0 0 / 0.12);
}
.gha-brand svg { width: 20px; height: 20px; }

.gha-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.gha-title-line strong { color: var(--ink); font-size: 13px; }

.gha-status,
.gha-simulation {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 2px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.gha-status svg { width: 11px; height: 11px; }
.gha-status.is-ready {
  border-color: rgb(var(--mint-rgb) / 0.34);
  background: rgb(var(--mint-rgb) / 0.12);
  color: color-mix(in srgb, var(--mint) 72%, var(--ink));
}
.gha-status.is-warning {
  border-color: rgb(var(--gold-rgb) / 0.45);
  background: rgb(var(--gold-rgb) / 0.16);
  color: color-mix(in srgb, var(--gold) 45%, var(--ink));
}
.gha-simulation { font-weight: 500; background: transparent; }

/* Connections row and offer */
.project-settings-connection-row.gha-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}
.gha-row-copy { display: grid; gap: 3px; min-width: 0; }
.gha-row-copy small { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.gha-row-copy .gha-row-notice { color: color-mix(in srgb, var(--gold) 45%, var(--ink)); }
.gha-row-actions { display: flex; gap: 6px; align-self: center; }

.gha-offer {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--surface-card-strong);
}
.gha-offer-head { display: flex; gap: 12px; align-items: flex-start; }
.gha-offer-head > div { display: grid; gap: 4px; }
.gha-offer-head small,
.gha-offer-actions small { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.gha-howto {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--ink);
  font-size: 12px;
}
.gha-howto li { display: flex; align-items: center; gap: 7px; }
.gha-howto span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: color-mix(in srgb, var(--mint) 75%, var(--ink));
  background: rgb(var(--mint-rgb) / 0.14);
  font-size: 11px;
  font-weight: 600;
}
.gha-offer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

.gha-banner {
  margin: 0 0 14px;
  padding: 10px 13px;
  border: 1px solid rgb(var(--mint-rgb) / 0.26);
  border-radius: 9px;
  color: var(--ink);
  background: rgb(var(--mint-rgb) / 0.08);
  font-size: 12px;
  line-height: 1.5;
}
.gha-banner.is-warning { border-color: rgb(var(--gold-rgb) / 0.45); background: rgb(var(--gold-rgb) / 0.14); }
.gha-banner.is-error { border-color: color-mix(in srgb, var(--danger-text) 30%, transparent); background: var(--danger-soft); color: var(--danger-text); }

/* Full-pane views */
.gha-view { display: grid; align-content: start; gap: 0; }
.gha-view .action-button.small { padding: 6px 12px; font-size: 12px; }
.gha-text.action-button {
  padding-right: 4px;
  padding-left: 4px;
  color: color-mix(in srgb, var(--mint) 70%, var(--ink));
  background: transparent;
  font-weight: 600;
}
.gha-text.action-button:not(:disabled):hover,
.gha-text.action-button:not(:disabled):focus-visible { background: transparent; box-shadow: none; text-decoration: underline; }
.gha-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.gha-head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; color: var(--ink); font-size: 20px; line-height: 1.25; }
.gha-head span { color: var(--ink-soft); font-size: 12px; }
.gha-head .gha-simulation { font-size: 11px; }
.gha-head-actions { display: flex; flex: none; align-items: center; gap: 8px; }

.gha-steps { display: flex; gap: 4px; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.gha-steps button {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 5px 1px;
  border: 0;
  color: var(--ink-soft);
  background: none;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.gha-steps button:disabled { cursor: default; opacity: 0.55; }
.gha-steps button span {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}
.gha-steps button span svg { width: 11px; height: 11px; }
.gha-steps button[aria-current] { color: var(--ink); font-weight: 600; }
.gha-steps button[aria-current] span { border-color: transparent; color: var(--on-accent); background: linear-gradient(135deg, var(--mint), var(--sky)); }

.gha-form { display: grid; gap: 12px; }
.gha-form h3 { margin: 0; color: var(--ink); font-size: 16px; }
.gha-form > p,
.gha-form .gha-note { margin: -6px 0 2px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.gha-form .gha-note { margin: 0; }
.gha-form code,
.gha-view code,
.gha-dialog code { padding: 1px 5px; border-radius: 4px; color: var(--ink); background: var(--surface-control); font-size: 0.92em; }
.gha-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.gha-card {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--surface-card-strong);
}
.gha-account { display: flex; align-items: center; gap: 12px; }
.gha-account > div { display: grid; flex: 1; gap: 3px; min-width: 0; }
.gha-account small { color: var(--ink-soft); font-size: 12px; }
.gha-account strong { color: var(--ink); font-size: 13px; }
.gha-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.gha-card .gha-inline-actions { margin-top: 14px; }

.gha-workflows { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.gha-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-card-strong);
  cursor: pointer;
}
.gha-choice:has(input:checked) { border-color: rgb(var(--mint-rgb) / 0.7); box-shadow: 0 0 0 1px rgb(var(--mint-rgb) / 0.7); }
.gha-choice input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--mint); }
.gha-choice > span:first-of-type { display: grid; flex: 1; gap: 2px; min-width: 0; }
.gha-choice strong { color: var(--ink); font-size: 13px; }
.gha-choice small { color: var(--ink-soft); font-size: 12px; }
.gha-estimate { display: grid; color: var(--ink); font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.gha-estimate small { font-weight: 400; }

.gha-allowed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgb(var(--mint-rgb) / 0.06);
}
.gha-allowed h4 { margin: 0 0 4px; color: var(--ink); font-size: 12px; }
.gha-allowed p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.gha-allowed b { color: var(--ink); font-weight: 600; }

.gha-more { padding-top: 10px; border-top: 1px solid var(--line); }
.gha-more > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.gha-more > summary span { color: var(--ink-soft); font-weight: 400; }
.gha-more .gha-review { margin-top: 8px; }

.gha-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gha-field { display: grid; align-content: start; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.gha-field label,
.gha-field legend { padding: 0; color: var(--ink); font-size: 12px; font-weight: 600; }
.gha-field legend { margin-bottom: 6px; }
.gha-field small { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.gha-field input[type="number"],
.gha-field input[type="date"],
.gha-filter select {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-popover);
  font: inherit;
  font-size: 13px;
}
.gha-field input[type="date"] { max-width: 220px; }
.gha-money { position: relative; }
.gha-money > span { position: absolute; top: 10px; left: 12px; color: var(--ink-soft); font-size: 13px; }
.gha-money input { padding-left: 25px !important; font-weight: 600 !important; }
.gha-segmented {
  display: inline-flex;
  justify-self: start;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-popover);
}
.gha-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.gha-segmented span { display: block; padding: 5px 13px; border-radius: 999px; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.gha-segmented input:checked + span { color: var(--on-accent); background: linear-gradient(135deg, var(--mint), var(--sky)); font-weight: 600; }
.gha-segmented input:focus-visible + span { outline: 2px solid var(--sky); outline-offset: 1px; }

/* Sticky so the next step stays reachable in a short settings window. */
.gha-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  margin-top: 18px;
  padding: 12px 0 16px;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
}
.gha-footer > span { color: var(--ink-soft); font-size: 12px; }
.gha-footer > div { display: flex; grid-row: span 2; gap: 8px; }
.gha-form-error { grid-column: 1; margin: 0; color: var(--danger-text); font-size: 12px; }
.gha-form-error:empty { display: none; }

.gha-review { margin: 0; }
.gha-review > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.gha-review > div:last-child { border-bottom: 0; }
.gha-review dt { color: var(--ink-soft); }
.gha-review dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* Spending */
.gha-allowance { padding: 18px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--surface-card-strong); }
.gha-allowance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gha-allowance-head small { color: var(--ink-soft); font-size: 12px; }
.gha-left { display: block; margin: 4px 0 14px; color: var(--ink); font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.gha-left span { color: var(--ink-soft); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.gha-meter { display: flex; height: 9px; overflow: hidden; border-radius: 5px; background: var(--surface-control); }
.gha-meter i:first-child { background: var(--mint); }
.gha-meter i:nth-child(2) { background: var(--gold); }
.gha-legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; color: var(--ink-soft); font-size: 12px; }
.gha-legend span { display: inline-flex; align-items: baseline; gap: 6px; }
.gha-legend strong { color: var(--ink); font-size: 13px; }
.gha-legend i { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.gha-legend i.is-spent { background: var(--mint); }
.gha-legend i.is-reserved { background: var(--gold); }
.gha-allowance .gha-note { margin: 12px 0 0; color: var(--ink-soft); font-size: 12px; }

.gha-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 10px; }
.gha-section-head h3 { margin: 0; color: var(--ink); font-size: 14px; }
.gha-filter { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.gha-filter select { width: 128px; min-height: 30px; padding: 4px 8px; font-size: 12px; }

.gha-runs { overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 11px; background: var(--surface-card-strong); }
.gha-runs-head,
.gha-run { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 96px; align-items: center; gap: 12px; padding: 11px 14px; }
.gha-runs-head { color: var(--ink-soft); background: var(--surface-control); font-size: 11px; }
.gha-runs-head span:last-child { text-align: right; }
.gha-run { width: 100%; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: none; font: inherit; text-align: left; cursor: pointer; }
.gha-run:first-of-type { border-top: 0; }
.gha-runs-head + .gha-run { border-top: 0; }
.gha-run:hover,
.gha-run:focus-visible { background: rgb(var(--mint-rgb) / 0.07); outline: none; }
.gha-run > span { min-width: 0; }
.gha-run strong { display: block; font-size: 12px; font-weight: 600; }
.gha-run small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 12px; }
.gha-run-status { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; }
.gha-run-status i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.gha-run-status.is-spent i { background: var(--mint); }
.gha-run-status.is-released i { background: var(--border-strong); }
.gha-amount { text-align: right; }
.gha-amount small { margin-top: 0; }
.gha-empty { margin: 0; padding: 16px; color: var(--ink-soft); font-size: 12px; }
.gha-footnote { margin: 14px 0 18px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }

/* Receipt and confirmation dialog */
.gha-dialog { width: min(470px, calc(100vw - 32px)); padding: 22px; }
.gha-dialog h2 { margin: 0 0 10px; color: var(--ink); font-size: 18px; }
.gha-dialog p { margin: 10px 0 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.gha-dialog .gha-review > div { grid-template-columns: 96px minmax(0, 1fr); }
.gha-dialog .gha-more { margin-top: 8px; }
.gha-events { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; }
.gha-events li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); }
.gha-events small { color: var(--ink-soft); }
.gha-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.gha-dialog .action-button.small { padding: 7px 14px; font-size: 12px; }

@media (max-width: 720px) {
  .project-settings-connection-row.gha-row { grid-template-columns: auto minmax(0, 1fr); }
  .gha-row-actions { grid-column: 2; }
  .gha-head { flex-wrap: wrap; }
  .gha-two,
  .gha-allowed { grid-template-columns: 1fr; }
  .gha-steps button { flex-direction: column; align-items: flex-start; gap: 5px; font-size: 11px; }
  .gha-footer > span { display: none; }
  .gha-review > div { grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
  .gha-runs-head { display: none; }
  .gha-run { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .gha-run > span:nth-child(2) { grid-row: 2; grid-column: 1; }
  .gha-run > span:last-child { grid-row: 1 / 3; grid-column: 2; }
}
