/* ══════════════════════════════════════════════════════════
   AI BUILDS: shared layer for every recipe page
   (potpie.html, required-move.html). Load it after the
   page's own <style> so these rules win.

   1. Spacing rhythm: one scale for tags, headings and bodies
   2. Prompt composer: "From my prompt" as a chat box
══════════════════════════════════════════════════════════ */

.cs-page {
  --sp-tag: 12px;        /* small tag → the heading it labels */
  --sp-title: 14px;      /* section heading → its body copy */
  --sp-title-sm: 8px;    /* step / card heading → its body copy */
  --sp-content: 40px;    /* section text → the block it introduces */
  --sp-media: 32px;      /* step text → its prompt or screens */
  --sp-media-stack: 16px;/* screens → more screens */
  --sp-step: 72px;       /* one step → the next */
}

/* ── 1. Spacing rhythm ─────────────────────────────────── */

/* Small tags sit tight on top of what they label */
.cs-page .cs-section-label,
.cs-page .rc-step-meta,
.cs-page .cs-buyer-label,
.cs-page .rc-prompt-label {
  margin-top: 0;
  margin-bottom: var(--sp-tag);
}
.cs-page .rc-prompt-label { margin-bottom: 8px; }

/* Section heading → body, body → whatever it introduces */
.cs-page .cs-section-heading { margin-top: 0; margin-bottom: var(--sp-title); line-height: 1.1; }
.cs-page .cs-body p + p { margin-top: 16px; }

.cs-page .cs-section-heading + .rc-ingredients,
.cs-page .cs-section-heading + .rc-offmenu,
.cs-page .cs-section-heading + .cs-buyers,
.cs-page .cs-section-heading + .cs-process-list,
.cs-page .cs-body + * {
  margin-top: var(--sp-content);
}
/* A tag that leads straight into content (no heading) */
.cs-page .cs-section-label + .cs-body,
.cs-page .cs-section-label + .cs-outcomes-cards { margin-top: 0; }

/* Steps: tag → title → one line, then the media */
.cs-page .cs-process-item { padding: 0; }
.cs-page .cs-process-item:not(:first-child) { margin-top: var(--sp-step); }
.cs-page .cs-process-item .rc-step-meta { margin-bottom: 8px; line-height: 1.2; }
.cs-page .cs-process-title { margin-top: 0; margin-bottom: 4px; line-height: 1.3; }
.cs-page .cs-process-desc { margin: 0; line-height: 1.55; }
.cs-page .cs-process-item .rc-prompt { margin: var(--sp-media) 0 0; max-width: none; width: 100%; }

.cs-page .cs-process-item + .rc-shot,
.cs-page .cs-process-item + .rc-story,
.cs-page .cs-process-item + .rm-plate,
.cs-page .cs-process-item + .rm-wires,
.cs-page .cs-process-item + .rm-refs { margin-top: var(--sp-media); }

.cs-page .rc-shot + .rc-shot,
.cs-page .rm-wires + .rm-plate,
.cs-page .rm-plate + .rm-plate { margin-top: var(--sp-media-stack); }

/* Cards: tag → heading → body */
.cs-page .cs-buyer-heading { margin-top: 0; margin-bottom: 10px; }

@media (max-width: 768px) {
  .cs-page {
    --sp-title: 10px;
    --sp-content: 32px;
    --sp-media: 24px;
    --sp-step: 56px;
  }
}

/* ── 2. Prompt composer ────────────────────────────────── */

.cs-page .rc-prompt {
  max-width: none;
  padding: 16px 16px 12px 20px;
  background: #FFFFFF;
  border: 1px solid #E3E0D6;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(60, 50, 30, 0.06);
}
.cs-page .rc-prompt-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #A39E93;
}
.cs-page .rc-prompt p {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  color: #3D3929;
  padding-right: 8px;
}
.rc-prompt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.rc-prompt-plus {
  width: 30px;
  height: 30px;
  border: 1px solid #E3E0D6;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #6B6659;
}
.rc-prompt-model {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;  /* the page's tight tracking squeezes "Claude Code" */
  color: #6B6659;
}
/* Dropdown chevron drawn with borders so it centres on the label
   (a "⌄" glyph sits on the baseline and reads low and tiny) */
.rc-prompt-model::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.rc-prompt-send {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #C96442;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .cs-page .rc-prompt { padding: 14px 12px 10px 16px; border-radius: 18px; }
  .cs-page .rc-prompt p { font-size: 15px; }
}
