:root {
  --ink: #1a1035;
  --muted: #6b6787;
  --line: #e2d9f3;
  --panel: #ffffff;
  --page: #f5f3ff;
  --nav: #1a1035;
  --nav-soft: #2d1a5e;
  --accent: #9333ea;
  --accent-dark: #7e22ce;
  --green: #16803c;
  --blue: #a855f7;
  --danger: #be185d;
  --shadow: 0 16px 36px rgba(26, 16, 53, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.file-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover,
.file-button:hover {
  border-color: #aab3b2;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 16, 53, 0.11);
}

button:active,
.file-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.primary {
  position: relative;
  overflow: hidden;
  border-color: #7c3aed;
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 52%, #f59e0b 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(147, 51, 234, 0.22);
}

.primary:hover {
  border-color: #6d28d9;
  background: linear-gradient(135deg, #6d28d9 0%, #c026d3 48%, #ea580c 100%);
  box-shadow: 0 12px 26px rgba(219, 39, 119, 0.26);
}

.primary::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -70%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
}

.primary:hover::after,
.primary.wf-next::after,
.primary.wf-running::after {
  animation: sparkle-sweep 1.8s ease-in-out infinite;
}

.danger {
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: #eef4f2;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #c084fc;
  color: #1a1035;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: #b7c7c4;
  font-size: 13px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  justify-content: flex-start;
  color: #e9f0ee;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
}

.tab.is-active {
  background: var(--nav-soft);
  border-color: rgba(255, 255, 255, 0.28);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats div {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.stats span {
  display: block;
  font-size: 26px;
  font-weight: 800;
}

.stats small {
  color: #bdcac8;
}

.stats-note {
  margin: -14px 0 0;
  color: #bdcac8;
  font-size: 12px;
  line-height: 1.4;
}

.storage-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.storage-actions button,
.storage-actions .file-button {
  min-width: 0;
  padding: 0 8px;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.workspace {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.workspace-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(280px, 0.52fr);
  gap: 24px;
  align-items: end;
  padding: 4px 2px 0;
}

.workspace-intro h2 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
}

.workspace-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workspace-intro .eyebrow {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid rgba(216, 220, 218, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.search-box,
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 95, 134, 0.15);
}

textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.45;
}

.view-desc {
  padding: 11px 16px;
  border: 1px solid #e2d9f3;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #faf5ff;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.view-desc strong {
  color: var(--accent-dark);
}

.view-desc code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  background: #ede9fe;
  padding: 1px 5px;
  border-radius: 3px;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.wide-panel {
  min-height: calc(100vh - 118px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
}

form {
  display: grid;
  gap: 14px;
}

.guide-list,
.result-list {
  display: grid;
  gap: 12px;
}

.guide-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.guide-card header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.guide-card h3,
.result-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.tags,
.excerpt,
.result-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.excerpt {
  margin-top: 10px;
}

.card-actions,
.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.version-pill {
  min-height: 40px;
  border: 1px solid #d8b4fe;
  border-radius: 6px;
  background: #faf5ff;
  color: var(--accent-dark);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.card-actions button {
  min-height: 34px;
  padding: 0 10px;
}

details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}

.rule-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #344044;
  line-height: 1.4;
}

.empty {
  min-height: 110px;
  border: 1px dashed #b8bfbc;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.answer-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.answer-grid h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.task-form {
  display: grid;
  gap: 14px;
}

.helper-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: #faf5ff;
  border-radius: 6px;
}

.task-form textarea {
  min-height: 150px;
}

.task-form input {
  min-height: 44px;
}

.review-stack {
  display: grid;
  gap: 10px;
}

.review-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.review-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  background: #1e1b2e;
  color: #f5f3ff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
}

.review-panel summary::-webkit-details-marker {
  display: none;
}

.review-panel summary::before {
  content: "+";
  display: inline-flex;
  width: 1.25rem;
  color: #c084fc;
  font-weight: 900;
}

.review-panel[open] summary::before {
  content: "-";
}

.review-panel > :not(summary) {
  margin: 12px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 0 4px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  color: var(--ink);
  font-weight: 400;
}

.check-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.generated-prompt {
  min-height: 430px;
  white-space: pre-wrap;
}

.generated-preview {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  line-height: 1.45;
  font-size: 14px;
  overflow-y: auto;
  font-family: Arial, Helvetica, sans-serif;
}

.generated-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

.generated-preview a {
  color: var(--blue);
  word-break: break-all;
}

.generated-preview a:hover {
  color: var(--accent);
}

.preview-empty {
  color: var(--muted);
}

.checklist {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.check-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.35;
}

.check-item.pass {
  border-color: rgba(22, 128, 60, 0.35);
  background: #f0fdf4;
}

.check-item.warn {
  border-color: rgba(190, 24, 93, 0.3);
  background: #fff0f8;
}

.check-item strong {
  display: block;
  margin-bottom: 3px;
}

.outline-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.55;
  background: #fbfcfb;
}

.outline-box.empty {
  display: grid;
}

.outline-box ol {
  margin: 0;
  padding-left: 20px;
}

.result-card mark {
  background: #e9d5ff;
  color: #1a1035;
  padding: 0 2px;
}

.template-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.template-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.template-pane-header h3 {
  margin: 0;
  font-size: 14px;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.02em;
}

.code-block {
  min-height: 480px;
  max-height: 70vh;
  border: 1px solid #3b1f6b;
  border-radius: 8px;
  background: #120b2e;
  color: #d8b4fe;
  padding: 14px 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
  margin: 0;
}

@media (max-width: 900px) {
  .template-layout {
    grid-template-columns: 1fr;
  }
}

.is-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .tabs,
  .storage-actions,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .answer-grid,
  .task-layout,
  .topbar,
  .workspace-intro {
    grid-template-columns: 1fr;
  }

  .workspace-intro {
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .guide-card header,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions,
  .inline-actions {
    flex-wrap: wrap;
  }
}

/* ── READINESS DASHBOARD ─────────────────────────────────────────────────── */

.readiness-dashboard {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.meter {
  background: #f9f6ff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.meter-label { font-size: 11px; font-weight: 600; color: var(--ink); }
.meter-pct   { font-size: 11px; font-weight: 700; }

.meter-track {
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2px;
}

.meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.meter-high .meter-fill { background: #16a34a; }
.meter-mid  .meter-fill { background: #d97706; }
.meter-low  .meter-fill { background: #dc2626; }
.meter-high .meter-pct  { color: #16a34a; }
.meter-mid  .meter-pct  { color: #d97706; }
.meter-low  .meter-pct  { color: #dc2626; }

.meter-desc { font-size: 10px; color: var(--muted); }

.overall-score {
  margin-top: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.score-ready    { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.score-near     { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.score-notready { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── FRONTIER SIM ─────────────────────────────────────────────────────────── */

.sim-results {
  background: #faf5ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

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

.sim-header small { color: var(--muted); font-size: 11px; }

.diff-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.diff-hard   { background: #fee2e2; color: #991b1b; }
.diff-medium { background: #fef3c7; color: #92400e; }
.diff-easy   { background: #dcfce7; color: #15803d; }

.sim-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.sim-model   { font-weight: 600; font-size: 11px; color: var(--muted); }
.sim-verdict { font-size: 12px; font-weight: 700; }
.sim-pass .sim-verdict { color: #15803d; }
.sim-fail .sim-verdict { color: #991b1b; }

.sim-failures {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  padding-left: 14px;
  font-size: 11px;
  color: #b45309;
}

.self-heal {
  margin-top: 8px;
  padding: 7px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 12px;
}

.self-heal strong { color: #166534; }
.self-heal ul { margin: 3px 0 0; padding-left: 14px; }
.self-heal li { margin: 2px 0; color: #166534; }

/* ── Submission Field Audit ─────────────────────────────────────────────── */
.submission-audit { margin-top: 6px; }

.audit-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.audit-table thead th { text-align: left; padding: 5px 8px; background: #1e1b2e; color: #a78bfa; font-weight: 600; border-bottom: 1px solid #312e55; }
.audit-table tbody tr { border-bottom: 1px solid #1e1b2e; }
.audit-table tbody td { padding: 5px 8px; vertical-align: top; }

.audit-ready  { color: #15803d; font-weight: 700; }
.audit-ok     { color: #0369a1; font-weight: 600; }
.audit-weak   { color: #b45309; font-weight: 600; }
.audit-empty  { color: #991b1b; font-weight: 700; }

.flag-count { font-size: 0.78rem; color: #ef4444; font-weight: 600; }
.flag-detail { margin-top: 6px; font-size: 0.80rem; }
.flag-detail summary { cursor: pointer; color: #f87171; font-weight: 600; }
.flag-detail ul { margin: 4px 0 0; padding-left: 16px; }
.flag-detail li { margin: 3px 0; color: #fca5a5; }
.flag-detail li strong { color: #f9a8d4; }
.flag-detail li em { color: #86efac; font-style: normal; }

.audit-clean { font-size: 0.80rem; color: #4ade80; margin: 4px 0 0; }

/* ── CONSISTENCY CHECKER & CODE LINTER ────────────────────────────────────── */

.consistency-checker,
.code-linter {
  margin: 4px 0 8px;
  font-size: 0.80rem;
}

/* ── LLM / REVIEWER RISK CHECKS ────────────────────────────────────────── */
.risk-checks {
  margin: 4px 0 8px;
}

.risk-panel {
  border: 1px solid #d8b4fe;
  border-radius: 8px;
  background: #1e1b2e;
  color: #e9d5ff;
  font-size: 0.78rem;
  overflow: hidden;
}

.risk-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #2d1a5e;
  border-bottom: 1px solid #4b3b7a;
}

.risk-panel-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #c084fc;
}

.risk-overall {
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
}

.risk-legend {
  display: flex;
  gap: 12px;
  padding: 5px 12px;
  font-size: 0.7rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid #312e55;
}

.risk-table {
  width: 100%;
  border-collapse: collapse;
}

.risk-row {
  border-bottom: 1px solid #312e55;
}

.risk-row:last-child {
  border-bottom: none;
}

.risk-row td {
  padding: 5px 8px;
  vertical-align: top;
  line-height: 1.4;
}

.risk-icon {
  width: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.risk-label {
  width: 110px;
  font-weight: 600;
  white-space: nowrap;
}

.risk-status {
  width: 100px;
  font-weight: 700;
  white-space: nowrap;
}

.risk-detail {
  color: #a78bfa;
  font-size: 0.72rem;
  word-break: break-word;
}

.risk-pass .risk-icon,
.risk-pass .risk-status { color: #4ade80; }

.risk-warn .risk-icon,
.risk-warn .risk-status { color: #fbbf24; }

.risk-block .risk-icon,
.risk-block .risk-status { color: #f87171; }

.risk-footer {
  padding: 6px 12px;
  border-top: 1px solid #312e55;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

.risk-footer.risk-pass { color: #4ade80; background: rgba(74,222,128,0.06); }
.risk-footer.risk-warn { color: #fbbf24; background: rgba(251,191,36,0.06); }
.risk-footer.risk-block { color: #f87171; background: rgba(248,113,113,0.06); }

.risk-footer-note {
  padding: 5px 12px 8px;
  font-size: 0.72rem;
  color: #fca5a5;
  background: rgba(248,113,113,0.04);
}

.consistency-errors,
.consistency-warns {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

.c-error {
  color: #fca5a5;
  background: rgba(239,68,68,0.08);
  border-left: 3px solid #ef4444;
  padding: 3px 8px;
  margin: 3px 0;
  border-radius: 0 4px 4px 0;
}

.c-warn {
  color: #fcd34d;
  background: rgba(251,191,36,0.08);
  border-left: 3px solid #f59e0b;
  padding: 3px 8px;
  margin: 3px 0;
  border-radius: 0 4px 4px 0;
}

.c-error strong { color: #f87171; }
.c-warn  strong { color: #fbbf24; }

/* ── LOCAL RUNNER PANEL ─────────────────────────────────────────────── */
.runner-top-panel {
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.runner-top-panel > h3 {
  margin: 0 0 10px;
}

.runner-workflow {
  margin: 0 0 12px;
}

.runner-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.runner-top-panel .runner-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: start;
}

.runner-section h3 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.runner-box {
  background: #faf9ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
}

.runner-muted {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 8px;
}

.runner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-link {
  --link-accent: #7c3aed;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--link-accent) 38%, #ffffff);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--link-accent) 12%, #ffffff), #ffffff);
  color: #1a1035;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(26, 16, 53, 0.09);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.button-link:hover {
  border-color: var(--link-accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(26, 16, 53, 0.14);
}

.button-link::before {
  content: "\2726";
  margin-right: 7px;
  color: var(--link-accent);
}

#runner-download-task-kit {
  --link-accent: #0d9488;
}

#runner-download-golden-kit {
  --link-accent: #d97706;
}

@keyframes sparkle-sweep {
  0% { left: -70%; opacity: 0; }
  20% { opacity: 0.88; }
  55%, 100% { left: 130%; opacity: 0; }
}

@keyframes wf-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.48), 0 10px 22px rgba(147, 51, 234, 0.22);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(147, 51, 234, 0), 0 13px 28px rgba(219, 39, 119, 0.24);
    transform: scale(1.025);
  }
}

@keyframes wf-blink {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0), 0 10px 22px rgba(147, 51, 234, 0.2);
    outline: 2px solid transparent;
    outline-offset: 1px;
  }
  50% {
    box-shadow: 0 0 18px 4px rgba(245, 158, 11, 0.42), 0 14px 30px rgba(219, 39, 119, 0.24);
    outline: 2px solid rgba(245, 158, 11, 0.85);
    outline-offset: 2px;
  }
}

.wf-step.wf-running,
.wf-step.wf-next {
  position: relative;
  z-index: 1;
}

.wf-step.wf-running {
  animation: wf-pulse 1.15s ease-in-out infinite;
}

.wf-step.wf-next {
  animation: wf-blink 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .primary:hover::after,
  .primary.wf-next::after,
  .primary.wf-running::after,
  .wf-step.wf-running,
  .wf-step.wf-next {
    animation: none;
  }

  .wf-step.wf-next {
    outline: 2px solid rgba(245, 158, 11, 0.85);
    outline-offset: 2px;
  }

  .wf-step.wf-running {
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.35);
  }
}

.runner-status-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-size: 0.82rem;
}

.runner-label {
  color: var(--muted);
  font-weight: 600;
}

.runner-value {
  font-weight: 700;
  font-family: monospace;
}

.runner-disconnected {
  background: #fecaca !important;
  color: #991b1b !important;
}

.runner-connected {
  background: #bbf7d0 !important;
  color: #166534 !important;
}

.runner-logs {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.runner-logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #1e1b2e;
  color: #e9d5ff;
}

.runner-logs-header h3 {
  margin: 0;
  font-size: 0.85rem;
  color: #c084fc;
}

.runner-logs-content {
  background: #111;
  color: #4ade80;
  padding: 12px;
  font-size: 0.75rem;
  font-family: monospace;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  border-radius: 0 0 8px 8px;
}

.runner-version-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  margin: 4px 0;
}

.runner-version-item {
  display: flex;
  gap: 4px;
  align-items: center;
}

.runner-version-item .runner-label {
  font-weight: 400;
}

.runner-check {
  color: var(--green);
  font-weight: 700;
}

.runner-cross {
  color: var(--danger);
  font-weight: 700;
}

.runner-package-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  font-size: 0.82rem;
}

.runner-download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.runner-download-link:hover {
  opacity: 0.9;
}

@media (max-width: 900px) {
  .runner-top-panel .runner-layout {
    grid-template-columns: 1fr;
  }
}
.runner-download-link.is-hidden {
  display: none;
}

.runner-builder-status {
  margin-top: 8px;
  font-size: 0.82rem;
  min-height: 1.2em;
}

/* ── Field step instructions ── */
.field-step {
  display: block;
  margin: 4px 0 6px 0;
  padding: 7px 12px;
  background: #1e293b;
  border-left: 4px solid #4ade80;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.5;
  font-style: normal;
}
.field-step strong {
  color: #4ade80;
}
