/* Lifecycle Prompt Builder tool-specific styles.
   Tokens (colors, radius, shadow, type scale, spacing) come from /shared/styles.css.
   Header, panel, and field patterns mirror /tools/decision-record/styles.css.
   The prompt-block visual mirrors /tools/prompts/. */

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate-800);
  background: var(--slate-50);
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: var(--cosai-navy);
  color: #fff;
  border-bottom: 3px solid var(--cosai-blue);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-shield { width: 34px; height: 34px; flex: none; }
.header-title { font-size: var(--text-lg); font-weight: 700; line-height: 1.1; }
.header-sub { font-size: var(--text-xs); color: var(--slate-300); margin-top: 2px; }
.header-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.4);
}
.header-home {
  color: #bfdbfe;
  text-decoration: none;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.header-home:hover { color: #fff; text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.layout { max-width: 1180px; margin: 0 auto; padding: 22px 24px 60px; }
.intro-block { margin: 22px 0 20px; }
.intro-block__title { font-size: var(--text-2xl); color: var(--cosai-navy); margin: 0 0 8px; }
.intro-block__lede { font-size: var(--text-base); color: var(--slate-600); line-height: 1.55; max-width: 74ch; margin: 0; }
.intro-block__lede a { color: var(--cosai-blue); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.prompt-side { position: sticky; top: 16px; padding: 0; background: transparent; border: none; box-shadow: none; }
@media (max-width: 880px) { .prompt-side { position: static; } }

/* ── Form ───────────────────────────────────────────────── */
.fs { border: none; margin: 0; padding: 0; }
.fs__legend {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--cosai-navy);
  padding: 0 0 10px;
  border-bottom: 2px solid var(--cosai-blue-soft);
  width: 100%;
  margin-bottom: 16px;
}
.field { margin-bottom: 16px; }
.field__label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--slate-700); margin-bottom: 4px; }
.field__hint { font-weight: 400; color: var(--slate-400); }
.field__input {
  width: 100%;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--slate-800);
  background: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.field__input:focus { outline: 2px solid var(--cosai-blue); outline-offset: 1px; border-color: var(--cosai-blue); background: #fff; }
.field__note { font-size: var(--text-xs); color: var(--slate-500); line-height: 1.5; margin: 5px 0 0; font-style: italic; }

/* ── Resolution card ────────────────────────────────────── */
.resolve {
  margin-top: 18px;
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--cosai-blue);
  border-radius: var(--radius);
  background: var(--slate-50);
  padding: 12px 14px;
}
.resolve__row { display: flex; gap: 10px; padding: 5px 0; align-items: baseline; }
.resolve__row + .resolve__row { border-top: 1px solid var(--slate-100); }
.resolve__k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-500); min-width: 130px; flex: none; }
.resolve__v { font-size: var(--text-sm); color: var(--cosai-navy); font-weight: 600; }
.resolve__v--warn { color: var(--status-warn); font-weight: 600; }

/* ── Prompt block (mirrors /tools/prompts/) ─────────────── */
.prompt-block {
  background: var(--cosai-navy);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.prompt-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.prompt-block__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
  line-height: 1.3;
}
.prompt-block__copy {
  flex: none;
  font-size: var(--text-xs);
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.prompt-block__copy:hover { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.9); }
.prompt-block__copy--copied { color: #6ee7b7 !important; border-color: rgba(110,231,183,0.3) !important; }
.prompt-block pre {
  margin: 0;
  padding: 18px 20px;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 72vh;
  overflow-y: auto;
  font-family: var(--font-mono, ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace);
}

/* ── Recipe matrix (static fallback) ────────────────────── */
.recipe { margin-top: 40px; }
.recipe__title { font-size: var(--text-xl); color: var(--cosai-navy); margin: 0 0 8px; }
.recipe__lede { font-size: var(--text-sm); color: var(--slate-600); line-height: 1.55; max-width: 78ch; margin: 0 0 16px; }
.recipe__foot { font-size: var(--text-xs); color: var(--slate-500); line-height: 1.55; margin: 14px 0 0; }
.recipe__foot a, .recipe__lede a { color: var(--cosai-blue); font-weight: 600; }

.table-scroll { overflow-x: auto; }
.recipe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.recipe-table th, .recipe-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: top;
}
.recipe-table th {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-500);
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}
.recipe-table tr:last-child td { border-bottom: none; }
.recipe-table td:first-child { color: var(--slate-800); }
.recipe-table td strong { color: var(--cosai-navy); font-family: var(--font-mono); margin-right: 4px; }
.recipe-table a { color: var(--cosai-blue); font-weight: 600; }
.recipe-table__ref {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--slate-500) !important;
}

/* ── Footnote ───────────────────────────────────────────── */
.footnote {
  margin-top: 32px;
  font-size: var(--text-xs);
  color: var(--slate-500);
  line-height: 1.6;
  max-width: 88ch;
}
