:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --bg-elev: #ffffff;
  --bg-elev-2: #f0f4f4;
  --border: #dfe6e6;
  --border-soft: #eaf0ef;
  --text: #1d3033;
  --muted: #627578;
  --muted-2: #6d7e81;
  --accent: #087f73;
  --accent-soft: #e8f5f1;
  --ok: #14845d;
  --changed: #a56a0b;
  --skipped: #75868a;
  --failed: #be4242;
  --ignored: #8053b0;
  --running: #087f73;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; }

/* ---------------------------------------------------------------- header */
.top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  flex-wrap: wrap;
}
.brand { font-weight: 650; letter-spacing: 0.2px; display: flex; align-items: baseline; gap: 8px; }
.brand .sub { color: var(--muted-2); font-weight: 400; font-size: 12px; }
.meta-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.chip {
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip b { color: var(--text); font-weight: 550; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.16); }
.dot.down { background: var(--failed); }
.dot.busy { background: var(--running); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------------------------------------------------------------- layout */
main {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  align-items: start;
}
@media (max-width: 1000px) {
  main { grid-template-columns: minmax(0, 1fr); }
}
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.panel + .panel { margin-top: 14px; }
.panel > h2 {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel > h2 .right { margin-left: auto; text-transform: none; letter-spacing: 0; }
.panel .body { padding: 12px 14px; }
.sidebar { position: sticky; top: 62px; }

/* --------------------------------------------------------------- controls */
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 13px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { font-family: var(--mono); resize: vertical; min-height: 58px; }

.btn {
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover:not(:disabled) { background: #222b36; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #3d7dea; }
.btn.danger { color: #ffb4ae; border-color: rgba(248, 81, 73, 0.5); }
.btn.danger:hover:not(:disabled) { background: rgba(248, 81, 73, 0.16); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* the sign-out control sits at the far right of the header, next to the chips */
.signout { flex: 0 0 auto; color: var(--muted); }
.signout:hover:not(:disabled) { color: var(--text); }

/* ------------------------------------------------------------ env tabs */
.tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.tabs button.active { background: var(--accent-soft); color: #cfe0ff; font-weight: 600; }
.tabs button .count { color: var(--muted-2); font-size: 11px; }

/* ------------------------------------------------------------ role list */
/* "you may only deploy X" banner for restricted accounts */
.restriction {
  margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; font-size: 12px; line-height: 1.45;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
}
.chip.role.restricted b { color: var(--accent); }

/* second-level tabs (role: all / projects) */
.tabs.sub { margin-bottom: 8px; gap: 4px; }
.tabs.sub button { padding: 3px 8px; font-size: 12px; }

.role-list { max-height: 330px; overflow: auto; border: 1px solid var(--border-soft); border-radius: 8px; }
.role-group-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-2);
  background: var(--bg);
  position: sticky;
  top: 0;
}
.role {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}
.role:hover { background: var(--bg-elev-2); }
.role.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.role .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role .tag {
  font-size: 10px;
  color: var(--muted-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
}
.role .tag.projects { color: #cdbcff; border-color: rgba(163, 113, 247, 0.4); }

/* ----------------------------------------------------------- project picker */
.proj-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.proj {
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--mono);
}
.proj.on { background: var(--accent-soft); border-color: var(--accent); color: #cfe0ff; }
.hint { color: var(--muted-2); font-size: 12px; }
.mono { font-family: var(--mono); }
.cmd-preview {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  color: #a9c7ff;
  overflow-x: auto;
  white-space: pre;
}

/* --------------------------------------------------------------- run card */
.run-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  text-transform: capitalize;
}
.pill.queued { color: #d7c4ff; background: rgba(163, 113, 247, 0.14); border-color: rgba(163, 113, 247, 0.4); }
.pill.running { color: #cfe4ff; background: rgba(88, 166, 255, 0.16); border-color: rgba(88, 166, 255, 0.45); }
.pill.succeeded { color: #b6f0bf; background: rgba(63, 185, 80, 0.14); border-color: rgba(63, 185, 80, 0.45); }
.pill.failed { color: #ffc4bf; background: rgba(248, 81, 73, 0.14); border-color: rgba(248, 81, 73, 0.45); }
.pill.cancelled { color: #ffd9a8; background: rgba(210, 153, 34, 0.14); border-color: rgba(210, 153, 34, 0.45); }
.pill.error { color: #ffc4bf; background: rgba(248, 81, 73, 0.14); border-color: rgba(248, 81, 73, 0.45); }
/* exit code 0 but nothing was targeted: not a success, not a failure */
.pill.noop { color: #ffd9a8; background: rgba(210, 153, 34, 0.14); border-color: rgba(210, 153, 34, 0.45); text-transform: none; }
.noop-panel { border: 1px solid rgba(210, 153, 34, 0.45); background: rgba(210, 153, 34, 0.08); border-radius: 10px; padding: 12px; margin-top: 12px; }
.noop-panel h4 { margin: 0 0 6px; font-size: 14px; color: #ffd9a8; }
.noop-panel p { margin: 0 0 8px; font-size: 13px; color: var(--text); }
.play-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.play-chips .chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border-soft); color: var(--muted); }
.run-title { font-weight: 600; }
.run-title .env { color: var(--muted); font-weight: 400; }

.progress-wrap { margin-top: 10px; }
.progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.progress { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, #3d7dea, #58a6ff); transition: width 0.4s ease; }
.progress .bar.done { background: linear-gradient(90deg, #2ea043, #3fb950); }
.progress .bar.bad { background: linear-gradient(90deg, #b3382f, #f85149); }
.progress.indeterminate .bar { width: 35% !important; animation: slide 1.4s ease-in-out infinite; }
.progress .bar.noop { background: repeating-linear-gradient(45deg, rgba(210, 153, 34, 0.55) 0 8px, rgba(210, 153, 34, 0.18) 8px 16px); }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 8px; padding: 6px 9px; }
.stat b { display: block; font-size: 16px; font-weight: 600; }
.stat.ignored b { color: var(--ignored); }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat.ok b { color: var(--ok); }
.stat.changed b { color: var(--changed); }
.stat.failed b { color: var(--failed); }
.stat.skipped b { color: var(--skipped); }

/* ------------------------------------------------------------ task timeline */
.tasks { max-height: 46vh; overflow: auto; border: 1px solid var(--border-soft); border-radius: 8px; margin-top: 12px; }
.play-header {
  padding: 5px 10px;
  background: var(--bg);
  color: #b9c6d6;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 2;
}
.block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(163, 113, 247, 0.09);
  border-bottom: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: #d7c4ff;
}
.block-header .idx { font-family: var(--mono); color: var(--muted); }
.task {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.task.block-child { padding-left: 26px; }
.task:hover { background: var(--bg-elev-2); }
.task .icon { text-align: center; font-size: 12px; }
.task .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .name .role-prefix { color: var(--muted-2); }
.task .hosts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.task .dur { color: var(--muted-2); font-size: 11px; font-family: var(--mono); min-width: 42px; text-align: right; }
.task[data-status="ok"] .icon { color: var(--ok); }
.task[data-status="changed"] .icon { color: var(--changed); }
.task[data-status="skipping"] .icon { color: var(--skipped); }
.task[data-status="failed"] .icon, .task[data-status="unreachable"] .icon { color: var(--failed); }
.task[data-status="ignored"] .icon { color: var(--ignored); }
.task[data-status="running"] .icon { color: var(--running); }
.task[data-status="failed"] .name { color: #ffc4bf; }
.host-chip {
  font-family: var(--mono);
  font-size: 10px;
  border-radius: 4px;
  padding: 0 5px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.host-chip.ok { color: #b6f0bf; border-color: rgba(63, 185, 80, 0.4); }
.host-chip.changed { color: #f0d08a; border-color: rgba(210, 153, 34, 0.4); }
.host-chip.failed, .host-chip.unreachable { color: #ffc4bf; border-color: rgba(248, 81, 73, 0.45); }
.host-chip.skipping { color: var(--muted-2); }
.task-raw {
  grid-column: 1 / -1;
  margin: 4px 0 8px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 260px;
  overflow-y: auto;
  color: #c6d2de;
}

/* ------------------------------------------------------------------ log */
.log {
  margin-top: 12px;
  background: #0a0e13;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.log div { color: #c6d2de; }
.log div.warn { color: #f0d08a; }
.log div.err { color: #ffb4ae; }
.log div.ui { color: #7fb0ff; }
.log div.taskline { color: #dcd6ff; }
.log div.playline { color: #9fe8b0; }

.recap { display: grid; gap: 6px; margin-top: 12px; }
.recap-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) repeat(4, 62px);
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 8px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
}
.recap-row.head { color: var(--muted-2); background: transparent; border: 0; padding-bottom: 0; }
.recap-row .bad { color: var(--failed); }
.recap-row .ok { color: var(--ok); }
.recap-row .chg { color: var(--changed); }

/* ------------------------------------------------------------- run lists */
#runs-list {
  max-height: min(26rem, 50vh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
.run-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.run-item:hover { background: var(--bg-elev-2); }
.run-item.active { background: var(--accent-soft); }
.run-item .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.run-item .who small { color: var(--muted-2); font-family: var(--mono); font-size: 11px; display: block; }
.empty { color: var(--muted-2); font-size: 13px; padding: 10px 2px; }

.banner {
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  margin-bottom: 10px;
  border: 1px solid;
}
.banner.info { background: rgba(76, 141, 255, 0.1); border-color: rgba(76, 141, 255, 0.35); color: #cfe0ff; }
.banner.warn { background: rgba(210, 153, 34, 0.1); border-color: rgba(210, 153, 34, 0.35); color: #ffd9a8; }
.banner.err { background: rgba(248, 81, 73, 0.1); border-color: rgba(248, 81, 73, 0.4); color: #ffc4bf; }
.banner code { font-family: var(--mono); }

/* ----------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
.modal h3 { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); font-size: 15px; }
.modal .body { padding: 14px 16px; }
.modal .foot { padding: 12px 16px; border-top: 1px solid var(--border-soft); display: flex; gap: 8px; justify-content: flex-end; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 10px; font-size: 13px; margin-bottom: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 10px 0 2px; }
.check input { margin-top: 3px; }

/* ----------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(400px, 100%); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.login-card h1 { margin: 0 0 4px; font-size: 18px; }
.login-card p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.error-text { color: #ffb4ae; font-size: 12.5px; min-height: 18px; margin-top: 8px; }

/* Workspace design */
.top { min-height: 76px; padding: 16px 36px; gap: 24px; background: #fff; }
.brand { align-items: center; gap: 7px; font-size: 20px; font-weight: 750; letter-spacing: -.7px; white-space: nowrap; }
.brand-light { font-weight: 400; color: #788789; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; margin-right: 5px; background: #087f73; color: white; font-size: 27px; font-weight: 400; }
.workspace-name { border-left: 1px solid var(--border); padding-left: 24px; font-size: 13px; color: var(--muted); }
.meta-chips { gap: 16px; }
.chip { background: transparent; border: 0; padding: 3px 0; font-size: 12px; }
.chip.role { padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; }
.dot.live { background: #1b9b76; box-shadow: 0 0 0 3px #e5f5ed; }
.page-heading, .overview, main, .page-footer { max-width: 1540px; margin-left: auto; margin-right: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; padding: 36px 36px 28px; gap: 16px; }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: 1.8px; color: var(--muted); margin-bottom: 8px; }
h1 { margin: 0; font-size: 34px; font-weight: 650; letter-spacing: -1.3px; line-height: 1.2; }
.heading-dot { color: var(--accent); }
.page-heading p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.workspace-badge { display: flex; gap: 9px; align-items: center; font-size: 12px; border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; background: white; }
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 0 36px 28px; }
.overview-card { position: relative; display: flex; flex-direction: column; background: white; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.overview-label { font-size: 12px; color: var(--muted); font-weight: 550; }
.overview-card strong { font-size: 28px; font-weight: 600; margin: 5px 0; letter-spacing: -1px; }
.overview-detail { font-size: 11px; color: var(--muted-2); }
.overview-icon { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 29px; height: 29px; background: #f0f7f5; color: var(--accent); border-radius: 7px; font-size: 19px; }
main { grid-template-columns: 310px minmax(0, 1fr); gap: 24px; padding: 0 36px 32px; }
.sidebar { position: static; min-width: 0; }
.workspace { min-width: 0; }
.panel { border-radius: 10px; box-shadow: 0 2px 3px #20393603; }
.panel + .panel { margin-top: 18px; }
.panel > h2 { color: #31484b; padding: 17px 20px; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; min-height: 57px; }
.panel .body { padding: 20px; }
.step-number { display: grid; place-items: center; font-family: var(--mono); font-size: 10px; width: 23px; height: 23px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); margin-right: 4px; }
.sidebar .panel > h2 { padding: 15px 16px; }
.sidebar .panel .body { padding: 16px; }
.tabs { background: #f3f6f6; border: 1px solid #e7eded; gap: 2px; }
.tabs button { font-size: 12px; padding: 8px 3px; }
.tabs button.active { background: #fff; color: var(--accent); box-shadow: 0 1px 4px #193d3614; }
.tabs button .count { font-size: 10px; margin-left: 2px; }
.tabs.sub { margin-bottom: 15px; }
.tabs.sub button { padding: 7px; }
label.field { margin-bottom: 16px; }
label.field > span { color: #4a6265; font-size: 12px; font-weight: 500; margin-bottom: 7px; }
input[type="text"], input[type="password"], textarea, select { background: #fff; padding: 10px 12px; border-radius: 6px; font-size: 12px; }
input::placeholder, textarea::placeholder { color: #8c9a9c; }
input:focus, textarea:focus { box-shadow: 0 0 0 3px #087f7312; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.role-list { border: 0; border-radius: 0; max-height: 390px; scrollbar-width: thin; }
.role-group-title { background: #fff; color: #8a999b; padding: 14px 8px 7px; font-size: 9px; letter-spacing: 1px; }
button.role { width: 100%; text-align: left; background: #fff; color: var(--text); border: 1px solid transparent; border-radius: 6px; padding: 10px 8px; margin-bottom: 2px; font-size: 12px; }
button.role:hover { background: #f3f8f6; }
button.role.active { background: var(--accent-soft); border-color: #cce6de; box-shadow: none; color: #06695e; }
.role .name { font-family: var(--sans); }
.role .tag { font-size: 9px; color: #7b8b8d; background: #f8faf9; border-color: var(--border); }
.role .tag.projects { color: #398377; border-color: #d7e9e3; background: #f3f9f7; }
.role-arrow { font-size: 17px; color: #9babae; }
.configuration-panel { margin-bottom: 22px; }
.configuration-panel .body { padding: 24px; }
.configuration-panel .kv { background: #f7f9f9; padding: 15px; border-radius: 7px; border: 1px solid var(--border-soft); grid-template-columns: 85px minmax(0,1fr); row-gap: 8px; font-size: 12px; }
.configuration-panel .banner { margin-bottom: 18px; }
.proj-list { background: #fbfcfc; padding: 12px; gap: 8px; }
.proj { background: #fff; border-radius: 5px; padding: 6px 12px; font-size: 11px; }
.proj.on { color: #06695e; border-color: #9bccbd; background: #e8f5ef; }
.cmd-preview { background: #f0f5f3; color: #35645a; padding: 14px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.btn { background: #fff; border-radius: 6px; font-size: 12px; padding: 9px 14px; font-weight: 500; }
.btn:hover:not(:disabled) { background: #eef4f2; border-color: #bbd1c9; }
.btn.primary { background: #087f73; border-color: #087f73; box-shadow: 0 2px 3px #087f7315; }
.btn.primary:hover:not(:disabled) { background: #06695e; }
.btn.primary span { margin-left: 18px; }
.btn.danger { color: #b13e3e; border-color: #e5bcbc; }
.setup-empty { text-align: center; padding: 35px 12px 40px; }
.empty-symbol { display: inline-grid; place-items: center; width: 60px; height: 60px; background: #edf7f2; border: 1px solid #d4e9df; border-radius: 15px; font-size: 28px; color: var(--accent); box-shadow: 0 6px 0 #f8fbf9; }
.setup-empty h3 { font-size: 20px; font-weight: 550; letter-spacing: -.5px; margin: 24px 0 8px; }
.setup-empty p { font-size: 13px; color: var(--muted); margin: 0; }
.empty-steps { display: flex; justify-content: center; gap: 15px; margin-top: 34px; color: var(--muted-2); font-size: 10px; }
.empty-steps span:first-child { color: var(--accent); }
.activity-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin-right: 6px; }
.activity-empty { display: flex; align-items: center; gap: 16px; padding: 14px 2px 20px; }
.activity-icon { font-size: 28px; color: #829694; }
.activity-empty h3 { font-size: 13px; font-weight: 550; margin: 0 0 4px; }
.activity-empty p { color: var(--muted); font-size: 12px; margin: 0; }
.pill.idle { margin-left: auto; background: #f3f5f5; color: #738487; border-color: var(--border); font-size: 10px; }
.history-empty { padding: 25px 18px; text-align: center; color: var(--muted); }
.history-empty > span { display: block; font-size: 24px; margin-bottom: 8px; color: #93a7a5; }
.history-empty b { font-size: 12px; font-weight: 500; }
.history-empty p { font-size: 11px; margin: 6px 0; }
.run-item { padding: 12px; flex-wrap: wrap; }
.run-item .who { min-width: 120px; }
.pill { font-size: 11px; padding: 3px 10px; }
.pill.running { color: #087569; background: #e7f5ef; border-color: #bdded2; }
.pill.succeeded { color: #247c50; background: #eaf6ed; border-color: #c3dfca; }
.pill.failed, .pill.error { color: #ae3e3e; background: #fff0f0; border-color: #edcccc; }
.pill.cancelled, .pill.noop { color: #95650f; background: #fff8e9; border-color: #e9d8ae; }
.pill.queued { color: #7959a6; background: #f4effb; border-color: #ddd0ee; }
.banner.info { color: #406c64; background: #f2f8f5; border-color: #dceae4; line-height: 1.7; }
.banner.warn, .noop-panel { color: #8c641d; background: #fffaed; border-color: #efdfb3; }
.banner.err { color: #ad4141; background: #fff3f3; border-color: #edcccc; }
.noop-panel h4 { color: #93651a; }
.progress { height: 6px; border: 0; background: #eaf0ee; }
.progress .bar { background: #188b77; }
.progress .bar.done { background: #2d9d67; }
.stat { padding: 14px; background: #fafcfc; }
.stat b { font-size: 24px; font-weight: 550; }
.stat span { font-size: 9px; }
.play-header { color: #46615e; background: #f0f5f3; padding: 10px; }
.block-header { color: #665080; background: #f7f4fa; }
.host-chip.ok { color: #258052; border-color: #bcdcc9; }
.host-chip.changed { color: #99660d; border-color: #e1d4b4; }
.host-chip.failed, .host-chip.unreachable { color: #b94343; }
.task { padding-top: 9px; padding-bottom: 9px; font-size: 12px; }
.task[data-status="failed"] .name { color: #b94343; }
.task-raw { color: #3b5557; background: #f5f8f7; }
.log { background: #182d30; border-color: #182d30; padding: 16px; font-size: 11px; }
.modal-backdrop { background: #142e3366; backdrop-filter: blur(3px); }
.modal { box-shadow: 0 24px 80px #142e3326; }
.error-text { color: var(--failed); }
.page-footer { padding: 0 36px 24px; display: flex; justify-content: space-between; color: #849496; font-size: 10px; }
.login-page { background: radial-gradient(ellipse at top, #e3f3ed, transparent 65%), var(--bg); }
.login-card { padding: 36px; box-shadow: 0 20px 60px #163d3310; }
.login-card h1 { color: var(--accent); font-size: 24px; margin-bottom: 15px; }
@media (min-width: 1500px) { main { grid-template-columns: 340px minmax(0,1fr); } }
@media (max-width: 1000px) {
  .top { padding: 16px 22px; gap: 14px; }
  .workspace-name { display: none; }
  .page-heading { padding: 28px 22px 24px; }
  .overview { padding: 0 22px 24px; gap: 10px; }
  .overview-card { padding: 15px; }
  .overview-icon { display: none; }
  main { grid-template-columns: 270px minmax(0,1fr); padding: 0 22px 24px; gap: 18px; }
  .configuration-panel .body { padding: 18px; }
  .empty-steps { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 760px) {
  .top { position: static; padding: 16px; gap: 12px; }
  .brand { font-size: 18px; }
  .meta-chips { order: 3; width: 100%; margin: 0; gap: 14px; }
  .signout { margin-left: auto; }
  .page-heading { padding: 26px 16px 22px; }
  h1 { font-size: 29px; }
  .workspace-badge { display: none; }
  .overview { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 16px 20px; }
  .overview-card strong { font-size: 25px; }
  main { grid-template-columns: minmax(0,1fr); padding: 0 16px 24px; }
  .role-list { max-height: 240px; }
  .sidebar .panel:last-child { margin-bottom: 4px; }
  .panel > h2 { padding: 15px; flex-wrap: wrap; }
  .panel .body { padding: 16px; }
  .configuration-panel .kv { grid-template-columns: 66px minmax(0,1fr); font-size: 11px; padding: 10px; }
  .activity-empty { gap: 10px; }
  .activity-icon { display: none; }
  .stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .task { grid-template-columns: 16px minmax(0,1fr) auto; }
  .task .hosts { grid-column: 2; justify-content: flex-start; }
  .task .dur { grid-column: 3; grid-row: 1; }
  .recap { overflow-x: auto; }
  .recap-row { min-width: 380px; }
  .page-footer { padding: 0 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Both themes share the same layout and status semantics. */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; flex: 0 0 auto; font-size: 20px; }
.theme-sun { display: none; }
.login-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10191d;
  --bg-elev: #182429;
  --bg-elev-2: #213237;
  --border: #304247;
  --border-soft: #283a3f;
  --text: #e1eeeb;
  --muted: #a5b9ba;
  --muted-2: #8fa6a8;
  --accent: #5dd5b8;
  --accent-soft: #203e38;
  --ok: #71dba4;
  --changed: #edbf69;
  --skipped: #9aafb5;
  --failed: #ff9696;
  --ignored: #c9a4ee;
  --running: #5dd5b8;
}
[data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: inline; }
[data-theme="dark"] :is(.top, .overview-card, .workspace-badge, .tabs button.active, .role-group-title, button.role, .proj, .btn, input[type="text"], input[type="password"], textarea, select) { background: var(--bg-elev); color: var(--text); }
[data-theme="dark"] :is(.workspace-name, .brand-light, .eyebrow, .overview-label, label.field > span, .page-footer) { color: var(--muted); }
[data-theme="dark"] .panel > h2 { color: var(--text); }
[data-theme="dark"] :is(.tabs, .configuration-panel .kv, .proj-list, .stat, .task-raw, .play-header, .pill.idle) { background: #142024; color: var(--muted); border-color: var(--border); }
[data-theme="dark"] :is(.overview-icon, .empty-symbol) { background: #203b35; color: var(--accent); border-color: #34564b; box-shadow: none; }
[data-theme="dark"] :is(.tabs button.active, button.role.active, .proj.on) { color: #8ae4cc; background: #203e38; border-color: #3b6b5c; }
[data-theme="dark"] :is(button.role:hover, .btn:hover:not(:disabled)) { background: #273c3f; border-color: #49635e; }
[data-theme="dark"] .role .tag { background: #203035; color: #a9bfbe; border-color: var(--border); }
[data-theme="dark"] .role .tag.projects { background: #203b35; color: #86cbb6; border-color: #34564b; }
[data-theme="dark"] .btn.primary { background: #168a74; color: #fff; border-color: #2caa90; }
[data-theme="dark"] .btn.primary:hover:not(:disabled) { background: #1d9c84; }
[data-theme="dark"] .btn.danger { color: #ffabab; border-color: #8b4b4b; }
[data-theme="dark"] .cmd-preview { background: #122321; color: #a4d7c7; }
[data-theme="dark"] .banner.info { background: #1b302c; color: #b4d6cc; border-color: #355148; }
[data-theme="dark"] :is(.banner.warn, .noop-panel) { background: #352e1f; color: #edcc8d; border-color: #655437; }
[data-theme="dark"] .noop-panel h4 { color: #edcc8d; }
[data-theme="dark"] :is(.banner.err, .pill.failed, .pill.error) { background: #3d262b; color: #ffb1b1; border-color: #71434b; }
[data-theme="dark"] :is(.pill.cancelled, .pill.noop) { background: #352e1f; color: #edcc8d; border-color: #655437; }
[data-theme="dark"] :is(.pill.running, .pill.succeeded) { background: #203e33; color: #94e2bb; border-color: #3d6b53; }
[data-theme="dark"] .pill.queued { background: #30293f; color: #d0b6ee; border-color: #5a486d; }
[data-theme="dark"] .progress { background: #2c4140; }
[data-theme="dark"] .block-header { background: #2c293c; color: #d0b6ee; }
[data-theme="dark"] .host-chip.ok { color: #94e2bb; border-color: #3d6b53; }
[data-theme="dark"] .host-chip.changed { color: #edcc8d; border-color: #655437; }
[data-theme="dark"] :is(.host-chip.failed, .host-chip.unreachable, .task[data-status="failed"] .name) { color: #ffb1b1; }
[data-theme="dark"] .login-page { background: radial-gradient(ellipse at top, #1c3932, transparent 65%), var(--bg); }
[data-theme="dark"] .log { background: #0e181b; border-color: var(--border); }
