/* content-assist app UI — consumes ICB bemorebookkeeper-v4.2 tokens
   (colors_and_type.css + paper-grain.css, installed verbatim).
   Design-gate dials 27Aug26h: variance 4 / motion 2 / density 4 (review 6).
   The page ground is the campaign gradient; content sits on the D-021 sheet:
   grained --surface-warm (#FAFAF7 — NOT --surface-paper, see the token trap
   recorded in _progress.json open_questions). */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--fg-body);
  background-image: linear-gradient(178deg, #cfeeea 0%, #ddf3f0 26%, #eef9f7 52%, #FAFAF7 76%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.sheet {
  max-width: 640px;
  margin: 48px auto 96px;
  padding: 48px 40px 56px;
  background-color: var(--surface-warm);
  background-image: var(--paper-grain);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(34,43,98,0.06), 0 12px 40px rgba(34,43,98,0.10);
}
.sheet--wide { max-width: 960px; }

@media (max-width: 700px) {
  .sheet { margin: 0; border-radius: 0; padding: 32px 20px 48px; min-height: 100vh; }
}

/* header */
.masthead { margin-bottom: 40px; }
.masthead .eyebrow {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--icb-teal); font-weight: 600; margin: 0 0 10px;
}
.masthead h1 {
  font-family: var(--font-display); color: var(--fg-primary);
  font-size: 28px; line-height: 1.2; font-weight: 800; margin: 0 0 8px;
}
.masthead p { color: var(--fg-muted); font-size: 15px; margin: 0; max-width: 46ch; }
.masthead .rule { height: 3px; width: 56px; background: var(--icb-gold); border: 0; margin: 18px 0 0; }

/* form fields — one thought per field, conversational labels */
.field { margin: 0 0 30px; }
.field > label, .field > .label {
  display: block; font-family: var(--font-display); font-weight: 700;
  color: var(--fg-primary); font-size: 16px; margin-bottom: 6px;
}
.field .hint { font-size: 13px; color: var(--fg-muted); margin: 0 0 10px; }
.field .optional { font-weight: 400; color: var(--fg-subtle); font-size: 13px; }

textarea, input[type="text"], input[type="date"], select {
  width: 100%; font: inherit; font-size: 15px; color: var(--fg-body);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--icb-teal);
  box-shadow: 0 0 0 3px rgba(43,113,140,0.15);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* quote slots */
.quote-slot { border: 1px solid var(--hairline); border-left: 3px solid var(--icb-gold);
  border-radius: var(--radius-sm); padding: 14px 14px 12px; margin-bottom: 12px; background: var(--surface); }
.quote-slot textarea { min-height: 64px; margin-bottom: 8px; }
.quote-slot .remove { float: right; background: none; border: 0; color: var(--fg-subtle); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.quote-slot .remove:hover { color: var(--icb-red); }

.btn-secondary {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--icb-navy);
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 16px; cursor: pointer; transition: border-color 120ms ease, background 120ms ease;
}
.btn-secondary:hover { border-color: var(--icb-navy); background: var(--surface); }

/* checkbox row */
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--icb-navy); }
.check-row label { font-size: 15px; color: var(--fg-body); font-weight: 500; }
.reveal { margin-top: 12px; }

/* file upload */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius-md);
  padding: 22px 16px; text-align: center; color: var(--fg-muted); font-size: 14px;
  cursor: pointer; transition: border-color 120ms ease; background: var(--surface);
}
.dropzone:hover { border-color: var(--icb-teal); }
.dropzone input { display: none; }
.ref-list { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; color: var(--fg-muted); }
.ref-list li { padding: 4px 0; border-bottom: 1px solid var(--hairline-soft); display: flex; justify-content: space-between; }
.ref-list .ok { color: var(--aquamarine-dark); }
.ref-list .fail { color: var(--icb-red); }

/* categorisation block — visually quieter, D-010 categorisation-last */
.cat-block { border-top: 1px solid var(--hairline); margin-top: 40px; padding-top: 32px; }
.cat-block .section-note { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-subtle); margin: 0 0 22px; font-weight: 600; }

/* submit */
.btn-primary {
  display: block; width: 100%; font: inherit; font-size: 16px; font-weight: 700;
  color: var(--fg-on-dark); background: var(--icb-navy); border: 0;
  border-radius: var(--radius-sm); padding: 15px 20px; cursor: pointer;
  transition: background 120ms ease;
}
.btn-primary:hover { background: var(--icb-navy-dark); }
.btn-primary:disabled { background: var(--fg-subtle); cursor: not-allowed; }
.submit-note { text-align: center; font-size: 13px; color: var(--fg-muted); margin-top: 10px; }

.error-box { background: #fdf2f2; border: 1px solid rgba(202,47,55,0.3); color: var(--icb-red);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.success-box { background: #f0faf8; border: 1px solid rgba(45,169,157,0.35); color: var(--aquamarine-dark);
  border-radius: var(--radius-sm); padding: 16px; font-size: 15px; }
.success-box a { color: var(--icb-navy); font-weight: 600; }

/* ---- review dashboard (density 6) ---- */
.queue { list-style: none; margin: 0; padding: 0; }
.queue-item {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  background: var(--surface); padding: 14px 16px; margin-bottom: 10px;
  transition: border-color 120ms ease;
}
.queue-item:hover { border-color: var(--icb-teal); }
.queue-item .row1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.queue-item .msg { font-weight: 600; color: var(--fg-primary); font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .meta { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }

.chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip--submitted, .chip--forwarded { background: rgba(107,114,128,0.12); color: var(--fg-muted); }
.chip--drafting { background: rgba(241,177,39,0.18); color: #8a6413; }
.chip--rendered, .chip--pending_review { background: rgba(43,113,140,0.14); color: var(--icb-teal); }
.chip--approved { background: rgba(45,169,157,0.16); color: var(--aquamarine-dark); }
.chip--rejected { background: rgba(202,47,55,0.12); color: var(--icb-red); }

.render-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.render-strip img { max-height: 420px; border-radius: var(--radius-xs);
  box-shadow: 0 2px 12px rgba(34,43,98,0.15); }

/* CTA three-column (D-009) */
.cta-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin: 8px 0 18px; }
@media (max-width: 700px) { .cta-grid { grid-template-columns: 1fr; } }
.cta-col { border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--surface); padding: 12px; }
.cta-col h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-subtle); }
.cta-col label { display: flex; gap: 8px; align-items: baseline; font-size: 14px; padding: 6px 4px; border-radius: var(--radius-xs); cursor: pointer; }
.cta-col label:hover { background: var(--surface-alt); }
.cta-col input { accent-color: var(--icb-navy); }
.cta-col .none { font-size: 13px; color: var(--fg-subtle); font-style: italic; }

.action-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.btn-approve { font: inherit; font-weight: 700; font-size: 15px; color: var(--fg-on-dark);
  background: var(--aquamarine-dark); border: 0; border-radius: var(--radius-sm); padding: 12px 24px; cursor: pointer; }
.btn-approve:disabled { background: var(--fg-subtle); cursor: not-allowed; }
.btn-reject { font: inherit; font-weight: 600; font-size: 15px; color: var(--icb-red);
  background: none; border: 1px solid rgba(202,47,55,0.4); border-radius: var(--radius-sm); padding: 12px 24px; cursor: pointer; }

.detail-block { margin: 26px 0; }
.detail-block h3 { font-family: var(--font-display); color: var(--fg-primary); font-size: 15px; margin: 0 0 10px; }
.kv { font-size: 14px; line-height: 1.7; }
.kv dt { display: inline; font-weight: 600; color: var(--fg-primary); }
.kv dd { display: inline; margin: 0 0 0 4px; }
.kv .pair { margin-bottom: 2px; }
details.spec pre { background: var(--icb-navy); color: #dbe2f7; font-size: 12px;
  border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; }

/* preview page states */
.status-line { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--fg-muted); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--icb-gold); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.preview-cta { font-size: 14px; color: var(--fg-muted); margin-top: 14px; }
.preview-cta strong { color: var(--fg-primary); }
