/**
 * @file help.css
 * @description Styles for the AI Help Prompt page — warm white aesthetic,
 *   DM Sans body text, JetBrains Mono for the prompt code block.
 * @version-history
 *   v1.0.0 — 2026-03-23 — Initial implementation
 *   v1.1.0 — 2026-06-02 — Copied-state selector .hlp-copied → .copied (CopyButton component migration)
 *   v2.0.0 — 2026-07-28 — Two-tab shell (.hlp-tabs/.hlp-tab), human help (.hlp-steps/-questions/
 *     -answer/-stuck) and the rendered-markdown prompt box (.hlp-prompt-rendered). The page used
 *     to print the prompt's markdown source at a human who clicked "Help".
 *   v2.1.0 — 2026-08-08 — .hlp-copy-btn deleted — it reimplemented .btn-primary exactly (same gradient, same hover
 *       lift) and .hlp-copy-btn.copied reimplemented .btn-primary.success. Only the wider CTA
 *       footprint survives, as a container rule.
 */

/* ── Container ── */
.hlp-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* ── Card ── */
.hlp-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg, 16px);
  padding: 40px 36px;
  box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.08));
}

/* ── Title ── */
.hlp-title {
  font-family: var(--font);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.3;
}

/* ── Description ── */
.hlp-desc {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 28px;
}

/* ── Prompt wrapper ── */
.hlp-prompt-wrapper {
  background: var(--bg-surface, var(--card-bg-alt));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm, 8px);
  max-height: 480px;
  overflow-y: auto;
  margin-bottom: 20px;
}

/* ── Prompt text ── */
.hlp-prompt-text {
  margin: 0;
  padding: 20px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 2;
}

.hlp-prompt-text code {
  font-family: inherit;
  background: none;
  padding: 0;
}

/* ── Loading ── */
.hlp-loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}

/* ── Error ── */
.hlp-error {
  padding: 20px;
  color: var(--accent);
  text-align: center;
  font-family: var(--font);
}

/* ── Copy button ──
   The button itself is the shared .btn-primary (same gradient, same hover lift, and its
   .copied state is the same green) — all this view adds is the wider CTA footprint. */
.hlp-agent .btn-primary { min-width: 180px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hlp-container {
    padding: 24px 16px 48px;
  }
  .hlp-card {
    padding: 24px 20px;
  }
  .hlp-title {
    font-size: 1.4rem;
  }
  .hlp-prompt-wrapper {
    max-height: 360px;
  }
}

/* ── Two audiences, two tabs (v2.0.0, 2026-07-28) ────────────────────────────
   The page used to be the agent prompt alone, printed as markdown SOURCE. The
   human tab is the default; the prompt now renders through <Markdown>. */
.hlp-tabs { display: flex; gap: .5rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--border); }
.hlp-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: .6rem .9rem; margin-bottom: -1px; cursor: pointer;
  color: var(--text-dim); font-size: .95rem; font-weight: 600; font-family: inherit;
}
.hlp-tab:hover { color: var(--text); }
.hlp-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.hlp-steps { margin: 0 0 1.75rem; padding-left: 1.3rem; line-height: 1.8; }
.hlp-steps a { color: var(--accent); }
.hlp-questions { display: grid; gap: .5rem; margin-bottom: 1.75rem; }
.hlp-answer { margin: 0; color: var(--text-dim); font-size: .9rem; line-height: 1.6; }
.hlp-stuck { display: flex; gap: .75rem; flex-wrap: wrap; }

/* The rendered prompt is long; keep it scrollable inside its own box rather than
   letting it push the endpoint list off the bottom of a phone screen. */
.hlp-prompt-rendered { max-height: 60vh; overflow-y: auto; margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface, var(--bg-dim)); }
.hlp-prompt-rendered table { display: block; overflow-x: auto; max-width: 100%; }
.hlp-endpoints { margin: .9rem 0 0; padding-left: 1.2rem; display: grid; gap: .4rem; color: var(--text-dim); font-size: .88rem; }
.hlp-endpoints code { background: var(--code-bg); padding: .1rem .4rem; border-radius: .25rem; }
