:root {
  color: #111827;
  background: #f9fafb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --ink: #111827;
  --ink-strong: #0f172a;
  --muted: #6b7280;
  --muted-strong: #4b5563;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-alt: #f9fafb;
  --panel: rgba(255, 255, 255, 0.72);
  --green: #0d9488;
  --green-hover: #0f766e;
  --green-soft: #f0fdfa;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.18);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.74), rgba(238,241,237,.96) 36%, #eef1ed),
    repeating-linear-gradient(90deg, rgba(25,33,29,.045) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(180deg, rgba(25,33,29,.035) 0 1px, transparent 1px 56px);
}
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.is-hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(18, 35, 29, .94), rgba(29, 73, 79, .88)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 64px);
}
.login-panel {
  width: min(100%, 404px);
  padding: 30px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, #176b4d, #2b628e);
  box-shadow: 0 12px 26px rgba(23, 107, 77, .28);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark-small {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  box-shadow: none;
}
.brand-mark-small svg { width: 20px; height: 20px; }
.login-heading { margin: 22px 0 26px; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}
.login-heading h1, .brand-block h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
  letter-spacing: 0;
}
.brand-block h1 { font-size: 18px; }
.login-form { display: grid; gap: 9px; }
.login-form label, .field-label {
  color: #46514b;
  font-size: 13px;
  font-weight: 750;
}
.login-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.login-form input:focus,
.rate-input:focus,
.minute-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.13);
}
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.input-action { position: absolute; top: 3px; right: 3px; }
.form-error {
  min-height: 18px;
  margin: 0 0 2px;
  color: var(--red);
  font-size: 12px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 16px;
  font-weight: 780;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button svg, .icon-button svg { width: 18px; height: 18px; flex: none; }
.button-primary { color: #fff; background: linear-gradient(135deg, #176b4d, #1d7b57); box-shadow: 0 12px 26px rgba(23,107,77,.2); }
.button-primary:hover:not(:disabled) { background: var(--green-hover); }
.button-secondary { color: var(--ink); border-color: var(--line-strong); background: rgba(255,255,255,.92); }
.button-secondary:hover:not(:disabled) { background: #f2f6f3; }
.button-warning { color: #fff; background: linear-gradient(135deg, #a65f19, #c77723); box-shadow: 0 12px 26px rgba(166,95,25,.2); }
.button-warning:hover:not(:disabled) { background: #884b12; }
.button-danger-quiet { color: var(--red); border-color: #e4bcbc; background: #fff; }
.button-danger-quiet:hover:not(:disabled) { background: var(--red-soft); }
.button-full { width: 100%; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  color: #4c5851;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.icon-button:hover {
  transform: translateY(-1px);
  color: var(--green);
  background: var(--green-soft);
  border-color: #b9d7c8;
}

.app-shell { min-height: 100vh; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  border-bottom: 1px solid rgba(202, 213, 205, .78);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(100% - 40px, 1440px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-block { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-block .eyebrow { font-size: 9px; margin-bottom: 1px; color: #4f665b; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.target-compact {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.7);
}
.target-compact div { display: grid; }
.target-label { color: var(--muted); font-size: 10px; }
.target-compact strong {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex: none;
  border-radius: 50%;
  background: #99a39d;
}
.status-online { background: #2a936c; box-shadow: 0 0 0 4px rgba(42, 147, 108, 0.14); }
.status-running, .status-warning { background: #d18724; box-shadow: 0 0 0 4px rgba(209, 135, 36, 0.14); }
.status-error { background: #c94a4a; box-shadow: 0 0 0 4px rgba(201, 74, 74, 0.13); }
.status-muted { background: #99a39d; }

.content {
  width: min(100% - 40px, 1440px);
  margin: 0 auto;
  padding: 24px 0 44px;
}
.command-center {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: stretch;
  gap: 20px;
  overflow: hidden;
  min-height: 154px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: var(--radius);
  color: #eff7f1;
  background:
    linear-gradient(135deg, #11221b 0%, #174535 48%, #23506f 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 56px);
  box-shadow: var(--shadow-md);
}
.command-center::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 34%, rgba(255,255,255,.12) 46%, transparent 58% 100%);
  transform: translateX(-120%);
  pointer-events: none;
}
.has-running-job .command-center::after { animation: command-sheen 2.8s ease-in-out infinite; }
@keyframes command-sheen { to { transform: translateX(120%); } }
.command-copy { position: relative; z-index: 1; align-self: center; }
.command-copy .eyebrow { color: #a9d9c4; }
.command-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}
.command-copy p:last-child {
  max-width: 720px;
  margin: 10px 0 0;
  color: rgba(239,247,241,.78);
  font-size: 13px;
  line-height: 1.7;
}
.live-run-card {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 13px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius);
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.live-run-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.live-run-head > div { display: grid; gap: 2px; min-width: 0; }
.live-run-head span:not(.live-run-dot) { color: rgba(239,247,241,.64); font-size: 11px; }
.live-run-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 18px;
}
.live-run-dot {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  background: rgba(255,255,255,.54);
  box-shadow: 0 0 0 6px rgba(255,255,255,.09);
}
.live-run-dot.is-ready { background: #78d8ad; box-shadow: 0 0 0 6px rgba(120,216,173,.16); }
.live-run-dot.is-running { background: #ffd18a; box-shadow: 0 0 0 6px rgba(255,209,138,.18); animation: pulse-dot 1.1s ease-in-out infinite alternate; }
.live-run-dot.is-warning { background: #ffb25c; box-shadow: 0 0 0 6px rgba(255,178,92,.18); animation: pulse-dot 1.1s ease-in-out infinite alternate; }
@keyframes pulse-dot { from { transform: scale(.92); opacity: .7; } to { transform: scale(1.08); opacity: 1; } }
.live-run-card p {
  min-height: 18px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(239,247,241,.74);
  font-size: 12px;
}
.run-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}
.run-progress span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #83e5b9, #f7c06b);
  transition: width 220ms ease;
}
.has-running-job .run-progress span {
  background-size: 180% 100%;
  animation: progress-shift 1.5s linear infinite;
}
@keyframes progress-shift { to { background-position: 180% 0; } }

.status-strip {
  min-height: 78px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow-sm);
}
.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px 20px;
  background: rgba(255,255,255,.9);
}
.status-item > div { display: grid; min-width: 0; }
.status-item span:not(.status-icon) { color: var(--muted); font-size: 11px; }
.status-item strong {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}
.status-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 7px;
}
.status-icon svg { width: 19px; height: 19px; }
.status-icon-green { color: var(--green); background: var(--green-soft); }
.status-icon-blue { color: var(--blue); background: var(--blue-soft); }
.status-icon-amber { color: var(--amber); background: var(--amber-soft); }
.status-icon-neutral { color: #5b6660; background: #edf0ee; }

.workspace-tabs {
  position: sticky;
  top: 76px;
  z-index: 15;
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(238, 242, 239, .94);
  box-shadow: 0 8px 20px rgba(24,34,29,.08);
  backdrop-filter: blur(16px);
}
.workspace-tab {
  min-width: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #65716a;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  outline: none;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.workspace-tab:hover { color: var(--ink); background: rgba(255,255,255,.62); }
.workspace-tab:focus-visible { box-shadow: 0 0 0 3px rgba(23,107,77,.16); }
.workspace-tab.is-active {
  color: var(--ink-strong);
  background: #fff;
  box-shadow: 0 2px 7px rgba(24,34,29,.12);
}
.workspace-tab > svg { width: 16px; height: 16px; flex: none; }
.workspace-tab strong {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 10px;
  color: #64716a;
  background: #e7ece9;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.workspace-tab.is-active strong { color: var(--green); background: var(--green-soft); }
.workspace-tab.has-alert strong { color: #a33434; background: var(--red-soft); }
.workspace-panel { animation: workspace-reveal 180ms ease-out; }
@keyframes workspace-reveal {
  from { opacity: .55; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 20px;
  margin-top: 14px;
  align-items: start;
}
.source-section, .health-section, .activity-section, .activity-grid { min-width: 0; }
.section-header {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.section-header h2, .tool-header h2, .activity-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}
.section-header p, .tool-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.check-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4b5650;
  font-size: 12px;
  cursor: pointer;
}
.check-control input, .source-check {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
.select-all-control {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.72);
}
.source-board {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.62);
  box-shadow: var(--shadow-sm);
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
}
.source-card {
  position: relative;
  min-width: 0;
  min-height: 172px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  padding: 15px;
  border: 1px solid rgba(200,211,204,.86);
  border-radius: var(--radius);
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 18px rgba(24,34,29,.055);
  outline: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}
.source-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: transparent;
  transition: background 150ms ease;
}
.source-card:hover,
.source-card:focus-visible {
  transform: translateY(-2px);
  border-color: #abc7b9;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.source-card.is-selected {
  border-color: #86c6a8;
  background: linear-gradient(180deg, #ffffff, #f3fbf6);
}
.source-card.is-selected::before { background: linear-gradient(180deg, #176b4d, #2b628e); }
.source-card.is-disabled { opacity: .56; filter: saturate(.8); }
.source-card-head {
  display: grid;
  grid-template-columns: 26px 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.source-select {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.source-select input { position: absolute; opacity: 0; pointer-events: none; }
.source-check-visual {
  width: 20px;
  height: 20px;
  border: 1px solid #b9c6bf;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.source-select input:checked + .source-check-visual {
  border-color: var(--green);
  background:
    linear-gradient(135deg, transparent 0 36%, #fff 37% 48%, transparent 49% 100%),
    linear-gradient(135deg, var(--green), #2b936b);
}
.source-select input:disabled + .source-check-visual { background: #edf0ee; }
.source-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #15543d;
  background: linear-gradient(135deg, #e8f6ef, #edf4fb);
  font-weight: 850;
}
.source-name { display: grid; gap: 3px; min-width: 0; }
.source-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.source-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}
.source-meta-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}
.badge-neutral { color: #58625d; background: #ecefed; }
.badge-blue { color: #285a8d; background: var(--blue-soft); }
.badge-amber { color: #8d4e13; background: var(--amber-soft); }
.auth-cell {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 8px;
  color: #516059;
  border-radius: 6px;
  background: #f0f4f1;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
}
.auth-cell .status-dot { width: 7px; height: 7px; }
.source-key-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  color: #58625d;
  background: #edf0ee;
  font-size: 11px;
  font-weight: 750;
}
.source-card-footer {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #e8eeea;
}
.rate-editor { min-width: 122px; display: grid; gap: 4px; }
.rate-input-line {
  width: max-content;
  max-width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.rate-limit-symbol, .rate-suffix { flex: none; color: #56615b; font-size: 12px; }
.rate-input {
  width: 78px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 7px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.rate-input:disabled { color: #59635e; background: #f2f4f2; }
.rate-meta {
  min-height: 15px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.rate-meta.is-saved { color: var(--green); }
.rate-meta.is-error { color: var(--red); }
.source-card-state {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}
.source-card-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a9b4ae;
}
.source-card.is-selected .source-card-state { color: var(--green); }
.source-card.is-selected .source-card-state i { background: var(--green); box-shadow: 0 0 0 4px rgba(23,107,77,.12); }
.empty-row {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.run-tool {
  position: sticky;
  top: 84px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}
.tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.run-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 15px;
}
.pipeline-step {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #8b9690;
  font-size: 10px;
  font-weight: 800;
}
.pipeline-step span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #cbd5cf;
  background: #fff;
}
.pipeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% + 12px);
  width: calc(100% - 24px);
  height: 2px;
  background: #d9e1dc;
}
.pipeline-step.is-ready { color: #5f6b64; }
.pipeline-step.is-ready span { border-color: #9eb8ac; }
.pipeline-step.is-done { color: var(--green); }
.pipeline-step.is-done span {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(23,107,77,.12);
}
.pipeline-step.is-active { color: var(--amber); }
.pipeline-step.is-active span {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(166,95,25,.13);
  animation: pulse-dot 1.1s ease-in-out infinite alternate;
}
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  margin-top: 16px;
  padding: 11px 0;
  border-top: 1px solid #e7ebe8;
  border-bottom: 1px solid #e7ebe8;
}
.option-row > div { display: grid; gap: 3px; }
.option-row strong { font-size: 12px; }
.option-row span { color: var(--muted); font-size: 11px; }
.switch { position: relative; width: 38px; height: 22px; display: inline-block; flex: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #cbd2ce;
  transition: background 140ms ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform 140ms ease;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:disabled + .switch-track { opacity: 0.55; }
.schedule-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 15px 0;
  border-bottom: 1px solid #e7ebe8;
}
.schedule-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.schedule-heading > div { display: grid; gap: 3px; }
.schedule-heading strong, .schedule-field label { font-size: 12px; }
.schedule-heading span, .schedule-meta { color: var(--muted); font-size: 11px; }
.schedule-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  gap: 12px;
}
.minute-input {
  height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}
.minute-input input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}
.minute-input span { padding-right: 9px; color: var(--muted); font-size: 11px; }
.schedule-meta { display: flex; justify-content: space-between; gap: 10px; }
.schedule-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-meta span:last-child { text-align: right; }
.schedule-cleanup-scope {
  padding: 8px 10px;
  color: #805019;
  border: 1px solid #efd7b2;
  border-radius: 6px;
  background: #fff8ed;
  font-size: 10px;
  line-height: 1.45;
}
.schedule-panel .button { min-height: 36px; }
.run-facts { display: grid; gap: 10px; margin: 16px 0 18px; }
.run-facts div { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
.run-facts dt { color: var(--muted); font-size: 11px; }
.run-facts dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-size: 11px;
  font-weight: 650;
}
.run-tool > .button + .button { margin-top: 9px; }

.health-section { margin-top: 14px; }
.health-header { align-items: center; min-height: 40px; }
.health-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.health-monitor-control {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px 0 10px;
  color: #59645e;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.86);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.health-monitor-control .switch { width: 34px; height: 20px; }
.health-monitor-control .switch-track::after { width: 14px; height: 14px; }
.health-monitor-control .switch input:checked + .switch-track::after { transform: translateX(14px); }
.health-window-badge, .health-overall {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.health-window-badge { color: #59645e; border: 1px solid var(--line); background: rgba(255,255,255,.86); }
.health-overall { color: #59645e; background: #ecefed; }
.health-overall-operational { color: #176646; background: var(--green-soft); }
.health-overall-error { color: #a33434; background: var(--red-soft); }
.health-overall-unknown { color: #59645e; background: #ecefed; }
.health-overall-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.health-overall-operational .health-overall-dot,
.health-overall-error .health-overall-dot { animation: health-overall-pulse 1.4s ease-in-out infinite alternate; }
@keyframes health-overall-pulse { from { opacity: .45; } to { opacity: 1; } }
.health-summary {
  min-height: 50px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow-sm);
}
.health-summary > div {
  display: grid;
  grid-template-columns: 9px auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 16px;
  background: rgba(255,255,255,.82);
}
.health-summary span:not(.health-summary-dot) { color: var(--muted); font-size: 11px; }
.health-summary strong { justify-self: end; font-size: 16px; }
.health-summary-dot { width: 8px; height: 8px; border-radius: 50%; }
.health-summary-operational { background: #2a936c; }
.health-summary-failed, .health-summary-error { background: #c94a4a; }
.health-summary-unknown { background: #8b9690; }
.health-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.health-source-filters {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e9eeeb;
  width: max-content;
  max-width: 100%;
}
.health-source-filter {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 0 10px;
  color: #61706a;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}
.health-source-filter:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.health-source-filter.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(25, 35, 30, .13); }
.health-source-filter span {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 8px;
  color: var(--muted);
  background: #edf0ee;
  text-align: center;
  font-size: 9px;
}
.health-status-filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e9eeeb;
}
.health-status-filter {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #65716a;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 780;
}
.health-status-filter:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.health-status-filter.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(25,35,30,.13);
}
.health-status-filter strong {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 8px;
  color: var(--muted);
  background: #edf0ee;
  text-align: center;
  font-size: 9px;
}
.health-status-filter.has-alert strong { color: #a33434; background: var(--red-soft); }
.health-status-filter.has-alert.is-active { color: #a33434; }
.health-groups { display: grid; gap: 26px; margin-top: 20px; }
.health-group { display: grid; gap: 12px; min-width: 0; }
.health-group-header { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.health-order-badge, .health-provider-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}
.health-order-normal, .health-provider-openai { color: #176646; background: var(--green-soft); }
.health-order-abnormal { color: #a33434; background: var(--red-soft); }
.health-provider-grok { color: #454c49; background: #e9eceb; }
.health-provider-anthropic { color: #984d16; background: #fff0df; }
.health-provider-gemini { color: #285a8d; background: var(--blue-soft); }
.health-provider-other { color: #555f5a; background: #ecefed; }
.health-group-header h3 { margin: 0; font-size: 13px; }
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.health-card {
  min-width: 0;
  min-height: 286px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  box-shadow: 0 8px 22px rgba(31, 45, 38, .06);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.health-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.health-card-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}
.health-provider-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
}
.health-provider-mark svg { width: 19px; height: 19px; }
.health-provider-mark.health-provider-openai { color: #176646; background: #edf8f2; }
.health-provider-mark.health-provider-grok { color: #424a46; background: #f0f2f1; }
.health-provider-mark.health-provider-anthropic { color: #984d16; background: #fff5e9; }
.health-provider-mark.health-provider-gemini { color: #285a8d; background: #eef5fb; }
.health-card-title { min-width: 0; }
.health-card-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 14px;
}
.health-card-subtitle { min-width: 0; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.health-card-source {
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  color: #59645e;
  background: #edf0ee;
  font-size: 9px;
  font-weight: 750;
}
.health-card-model {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.health-card-head-values { display: grid; justify-items: end; gap: 5px; }
.health-score-badge {
  min-width: 52px;
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid #cce3d7;
  border-radius: 6px;
  color: #176646;
  background: #edf8f2;
  font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.health-score-empty { color: #68736d; border-color: #dfe4e1; background: #f0f2f1; }
.health-status-badge {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.health-status-operational { color: #176646; background: var(--green-soft); }
.health-status-failed { color: #a33434; background: var(--red-soft); }
.health-status-error, .health-status-unknown { color: #58625d; background: #ecefed; }
.health-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
.health-metric {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e5e9e6;
  border-radius: var(--radius);
  background: #f8faf8;
}
.health-metric-label {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: #7a8580;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}
.health-metric-label svg { width: 13px; height: 13px; flex: none; }
.health-metric-value {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font: 700 17px/1.15 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.health-metric-value span {
  margin-left: 2px;
  color: #8c9691;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.15;
}
.health-availability { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.health-availability-copy { display: grid; gap: 3px; color: #7a8580; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.health-availability-copy span:last-child { text-transform: none; font-weight: 500; }
.health-availability-value { white-space: nowrap; font-size: 28px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.health-priority {
  min-height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #e5e9e6;
  border-radius: 7px;
  background: #f8faf8;
}
.health-priority-copy { min-width: 0; display: grid; gap: 2px; color: #68736d; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.health-priority-copy span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #929b96;
  font-size: 8px;
  font-weight: 500;
  text-transform: none;
}
.health-priority-values { flex: none; display: flex; align-items: baseline; gap: 8px; }
.health-priority-values span { color: #78837d; font-size: 9px; font-weight: 700; }
.health-priority-values strong {
  min-width: 26px;
  color: var(--ink);
  text-align: right;
  font: 800 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.health-timeline-wrap { margin-top: auto; padding-top: 13px; border-top: 1px solid #edf0ee; }
.health-timeline-header, .health-timeline-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #909994;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.health-timeline {
  width: 100%;
  height: 20px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-top: 8px;
}
.health-tick { min-width: 2px; flex: 1 1 0; border-radius: 2px 2px 1px 1px; background: #dfe4e1; }
.health-tick-operational { height: 100%; background: #2a936c; }
.health-tick-failed, .health-tick-error { height: 35%; background: #c94a4a; }
.health-tick-running { height: 65%; background: #3478b8; animation: health-tick-pulse 1s ease-in-out infinite alternate; }
.health-tick-unknown { height: 15%; background: #dfe4e1; }
.health-timeline-axis { margin-top: 5px; }
.health-card-message {
  margin: 10px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a33434;
  font-size: 10px;
}
.health-empty {
  margin-top: 18px;
  padding: 40px 20px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  font-size: 13px;
}
.health-error {
  margin-top: 14px;
  padding: 14px 16px;
  color: var(--red);
  border: 1px solid #eccccc;
  border-radius: var(--radius);
  background: #fff8f8;
  text-align: center;
  font-size: 12px;
}
@keyframes health-tick-pulse { from { opacity: .45; } to { opacity: 1; } }
.is-refreshing svg { animation: refresh-spin 700ms linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }

.activity-section { margin-top: 14px; }
.activity-header { align-items: flex-end; min-height: 44px; }
.summary-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.summary-chip {
  min-width: 60px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  color: #4f5a54;
  background: rgba(255,255,255,.86);
  font-size: 11px;
}
.summary-chip strong { color: var(--ink); }
.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr);
  gap: 20px;
}
.activity-grid.is-history-only { grid-template-columns: minmax(0, 1fr); }
.job-results, .history-panel {
  min-width: 0;
  height: 410px;
  display: grid;
  grid-template-rows: 42px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-sm);
}
.job-results-header, .history-heading {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(247,250,247,.88);
}
.job-results-header h3, .history-heading h3 { margin: 0; font-size: 13px; }
.job-results-header span, .history-heading span { color: var(--muted); font-size: 11px; }
.job-detail-tabs {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2ef;
}
.job-detail-tab {
  height: 24px;
  padding: 0 9px;
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
}
.job-detail-tab:hover { color: var(--ink); }
.job-detail-tab.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 35, 29, .12);
}
.job-results-list, .job-logs-list, .history-list { overflow: auto; }
.history-empty, .job-results-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 18px 14px;
  color: var(--muted);
  font-size: 12px;
}
.job-source + .job-source { border-top: 1px solid #e8ece9; }
.job-source-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(251,252,251,.9);
}
.job-source-title { min-width: 0; display: flex; align-items: center; gap: 8px; }
.job-source-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.job-source-title span { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.job-source-state { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.job-source-state-success { color: var(--green); }
.job-source-state-partial_success { color: #9a5817; }
.job-source-state-failed { color: var(--red); }
.job-source-message { padding: 0 14px 7px 38px; color: var(--muted); font-size: 10px; }
.job-outcome {
  min-height: 36px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 38px;
  border-top: 1px solid #f0f2f1;
}
.job-outcome-dot { width: 7px; height: 7px; border-radius: 50%; background: #99a39d; }
.job-outcome-dot-success { background: var(--green); }
.job-outcome-dot-failed { background: var(--red); }
.job-outcome-dot-skipped { background: #d18724; }
.job-outcome-copy { min-width: 0; display: grid; gap: 2px; }
.job-outcome-name { overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.job-outcome-meta { overflow-wrap: anywhere; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.job-outcome-message { max-width: 45%; color: var(--muted); font-size: 10px; text-align: right; overflow-wrap: anywhere; }
.job-outcome-message-failed { color: var(--red); }
.job-outcome-message-skipped { color: #9a5817; }
.job-logs-list {
  min-width: 0;
  padding: 7px 0;
  color: #d8e3dc;
  background: #18211d;
}
.job-log-line {
  min-height: 27px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 5px 13px;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.job-log-line:hover { background: rgba(255,255,255,.045); }
.job-log-line time { color: #82a18f; }
.job-log-line span { overflow-wrap: anywhere; white-space: pre-wrap; }
.job-logs-list .job-results-empty { color: #91a198; }
.history-item {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid #e8ece9;
  background: rgba(255,255,255,.78);
  text-align: left;
}
.history-item:hover, .history-item.is-selected { background: #f1f8f4; }
.history-item:last-child { border-bottom: 0; }
.history-status {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.history-status svg { width: 14px; height: 14px; }
.history-status-success { color: var(--green); background: var(--green-soft); }
.history-status-partial_success { color: #9a5817; background: #fff0d8; }
.history-status-failed { color: var(--red); background: var(--red-soft); }
.history-status-cancelled { color: #68726d; background: #ecefed; }
.history-copy { display: grid; gap: 2px; min-width: 0; }
.history-copy strong { font-size: 12px; }
.history-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
}
.history-time { color: var(--muted); font-size: 10px; white-space: nowrap; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 21, 0.52);
  backdrop-filter: blur(8px);
}
.modal {
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: var(--radius);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-lg);
}
.modal-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--amber);
  background: var(--amber-soft);
}
.modal-icon svg { width: 21px; height: 21px; }
.modal h2 { margin: 1px 0 6px; font-size: 17px; }
.modal p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.toast-region {
  position: fixed;
  z-index: 70;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 36px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  color: #fff;
  border-radius: 7px;
  background: #25302b;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  font-size: 12px;
}
.toast-error { background: #922f2f; }
.toast svg { width: 17px; height: 17px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
@media (max-width: 1280px) {
  .health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .command-center { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .run-tool {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
  .tool-header, .run-pipeline, .schedule-panel { grid-column: 1 / -1; }
  .run-facts { grid-row: span 2; }
  .run-tool > .button { align-self: end; }
  .activity-grid { grid-template-columns: 1fr; }
  .history-panel { height: 320px; }
}
@media (max-width: 980px) {
  .status-strip { grid-template-columns: 1fr 1fr; }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .header-inner, .content { width: min(100% - 24px, 1440px); }
  .app-header { height: 58px; }
  .brand-mark-small { width: 32px; height: 32px; }
  .brand-block h1 { font-size: 16px; }
  .brand-block .eyebrow { display: none; }
  .target-compact { display: none; }
  .content { padding-top: 14px; }
  .command-center { min-height: 0; padding: 18px; }
  .command-copy h2 { font-size: 22px; }
  .workspace-tabs {
    top: 66px;
    width: 100%;
    margin-top: 14px;
  }
  .workspace-tab { gap: 5px; padding: 0 7px; }
  .status-item { min-height: 68px; padding: 11px 12px; gap: 9px; }
  .status-icon { width: 31px; height: 31px; }
  .status-item strong { font-size: 14px; }
  .workspace-grid { margin-top: 14px; }
  .section-header { align-items: center; }
  .source-board { padding: 9px; }
  .source-grid { grid-template-columns: 1fr; }
  .source-card-footer { grid-template-columns: 1fr; align-items: start; }
  .source-card-state { justify-content: flex-start; }
  .run-tool { display: block; }
  .health-header { align-items: flex-start; }
  .health-toolbar { justify-content: flex-start; }
  .health-summary { grid-template-columns: 1fr 1fr; }
  .health-filters-row { align-items: stretch; flex-direction: column; }
  .health-source-filters { width: 100%; }
  .health-status-filters { order: -1; width: max-content; max-width: 100%; }
  .health-grid { grid-template-columns: 1fr; }
  .activity-header { align-items: flex-start; flex-direction: column; }
  .summary-group { justify-content: flex-start; }
  .job-source-header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .job-outcome { grid-template-columns: 8px minmax(0, 1fr); padding-left: 24px; }
  .job-outcome-message { grid-column: 2; max-width: none; text-align: left; }
  .job-source-message { padding-left: 24px; }
  .job-results, .history-panel { height: 360px; }
  .modal { grid-template-columns: 36px minmax(0, 1fr); padding: 18px; }
  .modal-icon { width: 36px; height: 36px; }
  .login-panel { padding: 25px 21px; }
}
@media (max-width: 430px) {
  .status-strip, .health-summary { grid-template-columns: 1fr 1fr; }
  .workspace-tab > svg { display: none; }
  .workspace-tab { font-size: 11px; }
  .summary-chip { min-width: 54px; }
  .run-pipeline { gap: 2px; }
  .pipeline-step strong { font-size: 9px; }
}

/* Sub2API visual system */
html.dark {
  color-scheme: dark;
  --ink: #f3f4f6;
  --ink-strong: #ffffff;
  --muted: #9ca3af;
  --muted-strong: #d1d5db;
  --line: #1f2937;
  --line-strong: #374151;
  --surface: rgba(31, 41, 55, 0.82);
  --surface-solid: #1f2937;
  --surface-alt: #111827;
  --panel: rgba(31, 41, 55, 0.72);
  --green: #2dd4bf;
  --green-hover: #14b8a6;
  --green-soft: rgba(13, 148, 136, 0.18);
  --blue: #60a5fa;
  --blue-soft: rgba(37, 99, 235, 0.18);
  --amber: #fbbf24;
  --amber-soft: rgba(217, 119, 6, 0.18);
  --red: #f87171;
  --red-soft: rgba(220, 38, 38, 0.18);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.38);
}

body {
  background: #f9fafb;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(at 40% 20%, rgba(20, 184, 166, 0.08) 0, transparent 45%),
    radial-gradient(at 82% 0%, rgba(37, 99, 235, 0.05) 0, transparent 38%);
}

html.dark body { background: #030712; }
html.dark body::before {
  background:
    radial-gradient(at 40% 20%, rgba(20, 184, 166, 0.08) 0, transparent 45%),
    radial-gradient(at 82% 0%, rgba(37, 99, 235, 0.06) 0, transparent 38%);
}

::selection { color: var(--ink-strong); background: rgba(20, 184, 166, 0.22); }

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

.login-shell {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(249, 250, 251, 0.94), rgba(240, 253, 250, 0.9)),
    linear-gradient(rgba(20, 184, 166, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.04) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
}

html.dark .login-shell {
  background:
    linear-gradient(135deg, rgba(3, 7, 18, 0.96), rgba(17, 24, 39, 0.94)),
    linear-gradient(rgba(45, 212, 191, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.04) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
}

.login-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
}

.login-panel {
  width: 100%;
  max-width: 448px;
  min-width: 0;
  padding: 32px;
  border-color: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px);
}

html.dark .login-panel {
  border-color: rgba(55, 65, 81, 0.65);
  background: rgba(31, 41, 55, 0.76);
}

.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: none;
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.24);
}

.brand-mark img { width: 100%; height: 100%; display: block; }
.login-heading { margin: 20px 0 28px; text-align: center; }
.login-heading .eyebrow { color: var(--green); font-size: 12px; font-weight: 650; }
.login-heading h1 { margin-top: 5px; color: var(--ink-strong); font-size: 25px; }

.login-form { gap: 10px; }
.login-form, .login-form input { min-width: 0; }
.login-form label, .field-label { color: var(--muted-strong); font-weight: 600; }
.login-form input,
.rate-input,
.minute-input {
  border-color: var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-solid);
}

.login-form input { height: 44px; }
.login-form input:focus,
.rate-input:focus,
.minute-input:focus-within {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.button {
  min-height: 40px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.button:hover:not(:disabled) { transform: none; }
.button:active:not(:disabled) { transform: scale(0.98); }
.button-primary {
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  box-shadow: 0 6px 18px rgba(20, 184, 166, 0.24);
}
.button-primary:hover:not(:disabled) { background: linear-gradient(90deg, #0d9488, #0f766e); }
.button-secondary {
  color: var(--muted-strong);
  border-color: var(--line);
  background: var(--surface-solid);
}
.button-secondary:hover:not(:disabled) { color: var(--ink); background: var(--surface-alt); }
.button-warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.2);
}
.button-warning:hover:not(:disabled) { background: linear-gradient(90deg, #d97706, #b45309); }
.button-danger-quiet { color: var(--red); border-color: rgba(239, 68, 68, 0.34); background: var(--surface-solid); }
.button-danger-quiet:hover:not(:disabled) { background: var(--red-soft); }

.icon-button {
  width: 40px;
  height: 40px;
  color: var(--muted);
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}
.icon-button:hover {
  transform: none;
  color: var(--green);
  border-color: rgba(20, 184, 166, 0.35);
  background: var(--green-soft);
}

.app-shell { min-height: 100vh; padding-left: 256px; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 256px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface-solid);
}
.sidebar-brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand img { width: 36px; height: 36px; flex: none; border-radius: 12px; box-shadow: 0 0 20px rgba(20, 184, 166, 0.22); }
.sidebar-brand div { min-width: 0; display: grid; gap: 1px; }
.sidebar-brand strong { overflow: hidden; text-overflow: ellipsis; font-size: 18px; white-space: nowrap; }
.sidebar-brand span { color: var(--muted); font-size: 11px; }
.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--line); }
.sidebar-link {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  color: var(--muted-strong);
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
  font-weight: 550;
  text-align: left;
}
.sidebar-link svg { width: 20px; height: 20px; flex: none; }
.sidebar-link:hover { color: var(--ink); background: var(--surface-alt); }
.sidebar-link.is-active { color: var(--green); background: var(--green-soft); }
.mobile-theme-toggle { display: none; }

.app-header {
  height: 64px;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  backdrop-filter: blur(20px);
}
.header-inner {
  width: auto;
  max-width: none;
  padding: 0 24px;
}
.brand-block h1 { color: var(--ink-strong); font-size: 18px; font-weight: 650; }
.brand-block .eyebrow { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.target-compact {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
}

.content {
  width: auto;
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px;
}

.command-center {
  min-height: 92px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  padding: 4px 0 0;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.command-center::after { display: none; }
.command-copy .eyebrow { color: var(--green); }
.command-copy h2 { color: var(--ink-strong); font-size: 22px; }
.command-copy p:last-child { margin-top: 7px; color: var(--muted); line-height: 1.6; }
.live-run-card {
  padding: 16px;
  color: var(--ink);
  border-color: var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}
.live-run-head span:not(.live-run-dot), .live-run-card p { color: var(--muted); }
.live-run-head strong { color: var(--ink-strong); font-size: 16px; }
.live-run-dot { background: #9ca3af; box-shadow: 0 0 0 5px rgba(156, 163, 175, 0.12); }
.live-run-dot.is-ready { background: #14b8a6; box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.15); }
.live-run-dot.is-running, .live-run-dot.is-warning { background: #f59e0b; box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.15); }
.run-progress { background: var(--line); }
.run-progress span { background: linear-gradient(90deg, #14b8a6, #2563eb); }

.status-strip {
  gap: 16px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.status-item {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}
.status-icon { border-radius: 10px; }
.status-icon-green { color: #059669; background: #ecfdf5; }
.status-icon-blue { color: #2563eb; background: #eff6ff; }
.status-icon-amber { color: #d97706; background: #fffbeb; }
.status-icon-neutral { color: #64748b; background: #f1f5f9; }

.workspace-tabs {
  top: 76px;
  padding: 4px;
  border-color: var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-alt) 88%, transparent);
  box-shadow: var(--shadow-sm);
}
.workspace-tab { border-radius: 10px; color: var(--muted); }
.workspace-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--surface-solid) 60%, transparent); }
.workspace-tab.is-active { color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.workspace-tab.is-active::after { display: none; }
.workspace-tab strong { border-radius: 999px; }

.section-header h2, .tool-header h2, .activity-header h2 { color: var(--ink-strong); font-weight: 650; }
.select-all-control { border-color: var(--line); border-radius: 10px; background: var(--surface-solid); }
.source-board { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.source-grid { gap: 16px; }
.source-card {
  border-color: var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}
.source-card::before { border-radius: 16px 0 0 16px; }
.source-card:hover, .source-card:focus-visible { border-color: rgba(20, 184, 166, 0.38); background: var(--surface-solid); box-shadow: var(--shadow-md); }
.source-card.is-selected { border-color: rgba(20, 184, 166, 0.55); background: var(--green-soft); }
.source-card.is-selected::before { background: linear-gradient(180deg, #14b8a6, #0d9488); }
.source-check-visual { border-color: var(--line-strong); border-radius: 6px; background: var(--surface-solid); }
.source-select input:checked + .source-check-visual { background: linear-gradient(135deg, transparent 0 36%, #fff 37% 48%, transparent 49% 100%), #0d9488; }
.source-avatar { border-radius: 10px; color: #0f766e; background: var(--green-soft); }
.badge { border-radius: 999px; font-weight: 650; }
.badge-neutral, .auth-cell, .source-key-pill { color: var(--muted-strong); background: var(--surface-alt); }
.badge-blue { color: var(--blue); }
.badge-amber { color: var(--amber); }
.source-card-footer { border-color: var(--line); }

.run-tool {
  top: 84px;
  border-color: var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
.tool-header, .option-row, .schedule-panel { border-color: var(--line); }
.pipeline-step { color: var(--muted); }
.pipeline-step span { border-color: var(--line-strong); background: var(--surface-solid); }
.pipeline-step:not(:last-child)::after { background: var(--line); }
.pipeline-step.is-ready { color: var(--muted-strong); }
.pipeline-step.is-ready span { border-color: #5eead4; }
.pipeline-step.is-done span { box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14); }
.switch-track { background: #d1d5db; }
.switch input:checked + .switch-track { background: #14b8a6; }
.schedule-cleanup-scope { color: #b45309; border-color: #fde68a; border-radius: 10px; background: #fffbeb; }

.health-monitor-control,
.health-window-badge {
  color: var(--muted-strong);
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
}
.health-overall, .health-window-badge { border-radius: 999px; }
.health-overall { color: var(--muted-strong); background: var(--surface-alt); }
.health-overall-operational { color: var(--green); background: var(--green-soft); }
.health-overall-error { color: var(--red); background: var(--red-soft); }
.health-summary { gap: 0; border-color: var(--line); border-radius: 16px; background: var(--surface-solid); }
.health-summary > div { border-right: 1px solid var(--line); background: var(--surface-solid); }
.health-summary > div:last-child { border-right: 0; }
.health-source-filters, .health-status-filters, .job-detail-tabs { border-color: var(--line); border-radius: 12px; background: var(--surface-alt); }
.health-source-filter, .health-status-filter { border-radius: 9px; color: var(--muted); }
.health-source-filter:hover, .health-status-filter:hover { color: var(--ink); background: var(--surface-solid); }
.health-source-filter.is-active, .health-status-filter.is-active, .job-detail-tab.is-active { color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.health-card {
  border-color: var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}
.health-provider-mark { border-radius: 10px; }
.health-metric, .health-priority { border-color: var(--line); border-radius: 12px; background: var(--surface-alt); }
.health-timeline-wrap { border-color: var(--line); }
.health-empty { border-color: var(--line-strong); border-radius: 16px; }
.health-error { border-color: rgba(239, 68, 68, 0.35); border-radius: 16px; background: var(--red-soft); }

.summary-chip { border-color: var(--line); border-radius: 999px; color: var(--muted-strong); background: var(--surface-solid); }
.job-results, .history-panel { border-color: var(--line); border-radius: 16px; background: var(--surface-solid); }
.job-results-header, .history-heading { border-color: var(--line); background: var(--surface-alt); }
.job-detail-tab { border-radius: 8px; }
.job-source + .job-source, .job-source-header, .job-outcome, .history-item { border-color: var(--line); }
.job-source-header { background: var(--surface-alt); }
.history-item { background: var(--surface-solid); }
.history-item:hover, .history-item.is-selected { background: var(--green-soft); }
.job-logs-list { color: #d1d5db; background: #0f172a; }
.job-log-line time { color: #5eead4; }

.modal-backdrop { background: rgba(3, 7, 18, 0.56); }
.modal { border-color: var(--line); border-radius: 16px; background: var(--surface-solid); }
.modal-icon { border-radius: 12px; }
.toast { border-radius: 12px; background: #111827; }
.toast-error { background: #b91c1c; }

html.dark .status-icon-green { color: #34d399; background: rgba(5, 150, 105, 0.2); }
html.dark .status-icon-blue { color: #60a5fa; background: rgba(37, 99, 235, 0.2); }
html.dark .status-icon-amber { color: #fbbf24; background: rgba(217, 119, 6, 0.2); }
html.dark .status-icon-neutral { color: #cbd5e1; background: rgba(100, 116, 139, 0.2); }
html.dark .source-avatar { color: #5eead4; }
html.dark .check-control,
html.dark .rate-limit-symbol,
html.dark .rate-suffix,
html.dark .health-monitor-control,
html.dark .health-window-badge,
html.dark .health-source-filter,
html.dark .health-status-filter,
html.dark .summary-chip { color: var(--muted-strong); }
html.dark .source-check-visual,
html.dark .pipeline-step span,
html.dark .minute-input,
html.dark .rate-input { background: var(--surface-solid); }
html.dark .source-select input:disabled + .source-check-visual,
html.dark .rate-input:disabled { color: var(--muted); background: #111827; }
html.dark .switch-track { background: #4b5563; }
html.dark .schedule-cleanup-scope { color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); background: rgba(217, 119, 6, 0.12); }
html.dark .health-provider-grok,
html.dark .health-provider-other,
html.dark .health-score-empty,
html.dark .health-status-error,
html.dark .health-status-unknown,
html.dark .health-card-source,
html.dark .health-source-filter span,
html.dark .health-status-filter strong { color: var(--muted-strong); background: #111827; }
html.dark .health-provider-mark.health-provider-grok { color: #d1d5db; background: #111827; }
html.dark .health-provider-mark.health-provider-openai { color: #5eead4; background: var(--green-soft); }
html.dark .health-provider-mark.health-provider-anthropic { color: #fdba74; background: rgba(194, 65, 12, 0.18); }
html.dark .health-provider-mark.health-provider-gemini { color: #60a5fa; background: var(--blue-soft); }
html.dark .health-score-badge { color: #5eead4; border-color: rgba(20, 184, 166, 0.3); background: var(--green-soft); }

@media (max-width: 1023px) {
  .app-shell { padding-left: 0; }
  .app-sidebar { display: none; }
  .mobile-theme-toggle { display: inline-grid; }
  .content { padding: 24px; }
}

@media (max-width: 680px) {
  .header-inner { width: auto; padding: 0 12px; }
  .content { width: auto; padding: 16px 12px 32px; }
  .command-center { padding-top: 0; }
  .status-strip { gap: 10px; }
  .status-item { border-radius: 14px; }
  .workspace-tabs { top: 66px; }
  .source-card, .run-tool, .health-card, .job-results, .history-panel { border-radius: 14px; }
  .login-theme-toggle { top: 12px; right: 12px; }
  .login-shell { padding: 16px; }
}
