:root {
  --flexion-navy: #1F2937;
  --flexion-charcoal: #4B5563;
  --flexion-blue: #155FC8;
  --flexion-concrete: #DFE3E6;
  --flexion-smoke: #F9FAFB;
  --flexion-orange: #E05F1A;
  --flexion-green: #3BB273;
  --flexion-red: #f85149;
  --panel-border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', -apple-system, sans-serif;
  background: var(--flexion-navy);
  color: white;
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--panel-border);
}

.brand-mark {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.1rem;
}

.brand-mark .dot {
  color: var(--flexion-orange);
}

nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

nav a {
  color: var(--flexion-concrete);
  text-decoration: none;
  font-size: 0.9rem;
}

nav a.active,
nav a:hover {
  color: white;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.75rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
}

p.subhead {
  color: var(--flexion-concrete);
  margin: 0 0 1.75rem;
}

form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.5rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--flexion-concrete);
  margin-bottom: 0.3rem;
}

.field {
  margin-bottom: 1.1rem;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 0.95rem;
}

/* A preset fills the repo field and marks it readonly — keep it legible
   rather than letting the browser grey it out into looking broken. */
input[type="text"][readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: var(--flexion-concrete);
  cursor: default;
}

.hint {
  font-size: 0.78rem;
  color: var(--flexion-concrete);
  margin: 0.35rem 0 0;
  line-height: 1.4;
}

.checkbox-field {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
  color: white;
}

.checkbox-field input {
  margin: 0;
}

.checkbox-field .hint {
  flex-basis: 100%;
  margin-top: 0;
}

/* Three peer scope options, each with its own body revealed on selection.
   Replaces an earlier preset-dropdown-plus-hidden-toggle arrangement that
   made the tool look like it only did one thing. */
.scope-picker {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 1rem 1.1rem 0.5rem;
  margin: 0 0 1.1rem;
}

.scope-picker legend {
  padding: 0 0.4rem;
  font-size: 0.85rem;
  color: var(--flexion-concrete);
}

.scope-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: white;
  cursor: pointer;
}

.scope-option input {
  margin: 0;
}

/* Indented to sit under its radio, so which input belongs to which option is
   unambiguous at a glance. */
.scope-body {
  margin: 0 0 1rem 1.55rem;
}

.scope-body[hidden] {
  display: none;
}

.scope-body .hint {
  margin-top: 0.35rem;
}

.scope-option.is-disabled {
  color: var(--flexion-concrete);
  cursor: not-allowed;
}

.scope-note {
  margin: -0.25rem 0 0.9rem 1.55rem;
}

/* Digest links are <button>s so the presigned URL can be minted on click
   rather than baked into an href at render. They should still read as links —
   this undoes the button chrome without losing keyboard focus or semantics. */
.linklike {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--flexion-orange);
  text-decoration: underline;
  cursor: pointer;
}

.linklike:hover:not(:disabled) {
  filter: brightness(1.15);
}

.linklike:disabled {
  color: var(--flexion-concrete);
  cursor: progress;
  text-decoration: none;
}

.pill {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  color: var(--flexion-concrete);
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.scope-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: white;
}

button {
  background: var(--flexion-orange);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#status-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  font-size: 0.9rem;
  display: none;
}

#status-panel.visible {
  display: block;
}

#status-panel.pending,
#status-panel.running {
  border-color: var(--flexion-blue);
}

#status-panel.success {
  border-color: var(--flexion-green);
}

#status-panel.failed,
#status-panel.error {
  border-color: var(--flexion-red);
}

.error-text {
  color: var(--flexion-red);
  font-size: 0.85rem;
  margin-top: 0.6rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--panel-border);
}

th {
  color: var(--flexion-concrete);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.success {
  background: rgba(59, 178, 115, 0.2);
  color: var(--flexion-green);
}

.badge.failed {
  background: rgba(248, 81, 73, 0.2);
  color: var(--flexion-red);
}

.badge.pending,
.badge.running {
  background: rgba(21, 95, 200, 0.2);
  color: #6ea8ff;
}

.muted {
  color: var(--flexion-concrete);
  font-size: 0.85rem;
}
