:root {
  color-scheme: light;
  --border: #d7dbe0;
  --bg: #f7f8fa;
  --accent: #2952e3;
  --danger: #c0392b;
  --ok: #1e7e34;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: #1b1f23;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 18px; margin: 0; }

main {
  max-width: 860px;
  margin: 24px auto;
  padding: 0 16px 64px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 { margin-top: 0; font-size: 16px; }

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

button:disabled {
  background: #9aa5b1;
  cursor: not-allowed;
}

button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.hint { color: #6a737d; font-size: 12px; }

.hidden { display: none !important; }

table.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.kv td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.kv td:first-child {
  font-weight: 600;
  width: 260px;
  color: #444;
}

.results {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.results li {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.results li:last-child { border-bottom: none; }
.results li:hover { background: #f0f3ff; }
.results li.selected { background: #e5ecff; font-weight: 600; }

.warning {
  background: #fff4e5;
  border: 1px solid #f0c36d;
  color: #7a5200;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 13px;
}

.safe-mode-banner {
  background: #4a0e0e;
  color: #fff;
  border: 1px solid #7a1a1a;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}

.steps li.status-ok { border-left: 4px solid var(--ok); }
.steps li.status-error { border-left: 4px solid var(--danger); }
.steps li.status-running { border-left: 4px solid var(--accent); }
.steps li.status-skipped { border-left: 4px solid #9aa5b1; }

.steps pre {
  background: #f4f5f7;
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
  margin: 6px 0 0;
}

#authBar { font-size: 13px; color: #444; display: flex; gap: 12px; align-items: center; }

.view-tabs {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.view-tab {
  font-weight: 600;
}

.nav-panel {
  margin-top: 8px;
}

.pipeline-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 12px;
  color: #555;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.pipeline-step {
  font-weight: 600;
  white-space: nowrap;
}

.pipeline-step.parallel {
  font-weight: 500;
  color: #335;
  background: #e8eeff;
  padding: 3px 8px;
  border-radius: 4px;
}

.pipeline-parallel {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px dashed #9ab;
  border-radius: 6px;
  background: #fafcff;
}

.pipeline-label {
  font-size: 11px;
  color: #6a737d;
  font-style: italic;
}

.pipeline-arrow {
  color: #888;
  font-weight: 700;
}

.parallel-divider {
  color: #ccc;
  font-weight: 300;
  user-select: none;
}

.ops-flow-selector {
  flex-wrap: wrap;
}

.parallel-option {
  font-size: 13px;
}

.flow-selector {
  gap: 20px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.radio-option input[type="radio"] {
  cursor: pointer;
}

select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

.ok-badge {
  color: var(--ok);
  font-weight: 700;
}

.fail-badge {
  color: var(--danger);
  font-weight: 700;
}

table.payments {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0;
}

table.payments th,
table.payments td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

table.payments tr.already-invoiced {
  color: #9aa5b1;
}

table.payments tr.already-invoiced td:first-child {
  font-style: italic;
}
