/**
 * @file css/components/hello-mcp.css
 * @description Styles for the Hello MCP panel (`.hm-*`) and the organism instruction block
 *   (`.ib-*`). Both are onboarding surfaces, so the visual job is to make ONE thing obviously
 *   next at any moment: the proof step is the only one with an accent edge, and the pass state
 *   is the only place a success colour appears. All colours are theme tokens.
 * @structure .hm (panel) · .hm-step · .hm-step--proof · .hm-prompt · .hm-fail · .hm-passed ·
 *   .ib (instruction block) · .ib-tabs · .ib-block
 * @usage loaded from spa.html
 * @version-history
 *   v1.0.0 — 2026-07-31 — Initial.
 */

/* ── Hello MCP panel ── */
.hm { margin: 0 0 1.5rem; }

.hm-intro { margin-bottom: 0.9rem; }
.hm-intro-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.hm-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 0.9rem 1rem;
  margin-bottom: 0.7rem;
}

/* The proof is the only step with an accent edge: at any moment exactly one thing is next. */
.hm-step--proof { border-left: 3px solid var(--accent); }

.hm-step-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.hm-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: var(--radius-full);
  background: var(--bg-dim);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.hm-p {
  margin: 0 0 0.6rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.hm-p--dim { font-size: 0.8125rem; }

.hm-list {
  margin: 0 0 0.6rem;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.hm-list li { margin-bottom: 0.4rem; }
.hm-list--ol { padding-left: 1.3rem; }

.hm-code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8125rem;
  background: var(--bg-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.1rem 0.35rem;
  overflow-wrap: anywhere;
}

.hm-prompt {
  margin: 0 0 0.6rem;
  padding: 0.7rem 0.8rem;
  background: var(--bg-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 260px;
  overflow-y: auto;
}

.hm-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hm-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0 0 0.3rem;
}

.hm-select { margin-bottom: 0.6rem; }

.hm-link {
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ── Failure path ── */
.hm-fail {
  margin-top: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn, var(--accent-2));
  border-radius: var(--radius-xs);
  background: var(--bg-dim);
}
.hm-fail-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ── Passed ── */
.hm-passed {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 0.9rem;
}
.hm-passed-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: var(--radius-full);
  background: var(--success);
  margin-top: 0.35rem;
  flex-shrink: 0;
}
.hm-passed-title { font-weight: 800; font-size: 0.95rem; color: var(--text); }
.hm-passed-sub { font-size: 0.8125rem; color: var(--text-dim); margin-top: 0.15rem; }

.hm-after { margin-top: 0.2rem; }

/* ── Instruction block (also used standalone on every organism) ── */
.ib { margin: 0.4rem 0 0; }

.ib-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.ib-tab {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.ib-tab--active {
  border-color: var(--accent);
  color: var(--accent);
}

.ib-place {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.ib-block {
  margin: 0 0 0.55rem;
  padding: 0.7rem 0.8rem;
  background: var(--bg-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow-y: auto;
}

.ib-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.ib-meta { font-size: 0.75rem; color: var(--text-muted); }
.ib-note { font-size: 0.8125rem; color: var(--text-dim); margin: 0.4rem 0; }

/* ── The organism-page wrapper for the same block ── */
.pj-org-instr {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
}
.pj-org-instr-lead {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

/* ── Per-tool setup guide + the instructions dialog (.ast-*) ── */
.ast { margin: 0.2rem 0 0.4rem; }

.ast-lead {
  margin: 0 0 0.6rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.ast-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}
.ast-tool {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.ast-tool--active { border-color: var(--accent); color: var(--accent); }
/* K2: the tool we point a first-timer at carries a small text badge, never an icon. */
.ast-tool-reco {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ast-plans, .ast-warn, .ast-note {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.ast-warn {
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--warn);
  background: var(--bg-dim);
  border-radius: var(--radius-xs);
}

.ast-steps {
  margin: 0 0 0.7rem;
  padding-left: 1.3rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.ast-steps li { margin-bottom: 0.4rem; }

.ast-cmd { margin: 0 0 0.7rem; }
.ast-cmd-text {
  margin: 0 0 0.4rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8rem;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ast-params {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.7rem;
  background: var(--bg-card);
}
.ast-params-head {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.ast-param { padding: 0.35rem 0; border-top: 1px solid var(--border-subtle, var(--border)); }
.ast-param:first-of-type { border-top: 0; padding-top: 0; }
.ast-param-label { font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.ast-param-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.ast-param-empty { font-size: 0.8125rem; font-style: italic; color: var(--text-muted); }
.ast-param-note { margin-top: 0.2rem; font-size: 0.78rem; line-height: 1.5; color: var(--text-dim); }

.ast-code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8rem;
  background: var(--bg-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.15rem 0.4rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ast-docs { font-size: 0.8125rem; font-weight: 700; }

.ast-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0.5rem 0 0.25rem;
}
.ast-select { margin-bottom: 0.6rem; }

.ast-where {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.ast-where-head {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.ast-where-path {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}

.ast-modal { max-width: 720px; }

/* The refresh result. Always says something: a button whose only effect is invisible reads as
   broken, which is the failure this panel exists to remove. */
.hm-found {
  margin: 0.55rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-dim);
}
.hm-found--ok { color: var(--success); font-weight: 600; }
