/* Brief page component. Same markup on the landing demo and on brief/template.html.
   The client's own accent arrives as --accent from brief.json. */

.brief {
  --accent: var(--chrome);
  background: var(--deep);
  border-radius: var(--r-surface);
  overflow: hidden;
  color: var(--chrome);
}
.brief__head {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: start;
  padding: clamp(18px, 3vw, 30px) clamp(18px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
}
.brief__id { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; color: var(--steel-hi); }
.brief__id img { width: 20px; height: 20px; }
.brief__title { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; margin: 4px 0 0; }
.brief__meta { color: var(--steel-hi); grid-column: 1; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.brief__meta span { white-space: nowrap; }
.brief__status {
  grid-column: 2; grid-row: 2 / span 2; align-self: center;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-hi); color: var(--chrome);
}
.brief__status i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.brief__status.ok i { background: var(--bite); }
@media (max-width: 600px) {
  .brief__head { grid-template-columns: 1fr; }
  .brief__status { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }
}

.brief__grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); }
.bcell { background: var(--deep); padding: clamp(18px, 2.6vw, 28px) clamp(18px, 3vw, 32px); min-width: 0; }
.bcell h4 { margin: 0 0 12px; font: 500 0.75rem/1.2 var(--font-mono); letter-spacing: 0.02em; color: var(--steel-hi); }
.bcell p { color: var(--chrome); font-size: 1rem; line-height: 1.55; max-width: 60ch; }
.bcell--idea .idea { font-weight: 750; font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem); line-height: 1.08; letter-spacing: -0.035em; color: var(--accent); max-width: 22ch; text-wrap: balance; }

.swatches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
.swatches li { display: grid; grid-template-columns: 40px 1fr; gap: 0 10px; align-items: start; }
.swatches .chipc { width: 40px; height: 40px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line-hi); grid-row: span 3; align-self: start; }
.swatches em { font: 450 0.8125rem/1.3 var(--font-display); font-style: normal; color: var(--steel-hi); }
.swatches b { font-weight: 650; font-size: 0.9375rem; line-height: 1.2; }
.swatches span { font: 500 0.75rem/1.3 var(--font-mono); color: var(--steel-hi); }

.typespec { display: grid; gap: 14px; }
.typespec div { display: grid; gap: 2px; }
.typespec .s { font-size: 2.25rem; line-height: 1; letter-spacing: -0.04em; color: var(--chrome); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typespec .s.m { font-family: var(--font-mono); font-size: 0.9375rem; letter-spacing: 0.04em; line-height: 1.4; }
.typespec span { font: 500 0.75rem/1.3 var(--font-mono); color: var(--steel-hi); }

.frames { list-style: none; margin: 0 calc(clamp(18px, 3vw, 32px) * -1); padding: 2px clamp(18px, 3vw, 32px) 6px; display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: clamp(18px, 3vw, 32px); scrollbar-width: thin; scrollbar-color: var(--line-hi) transparent; -webkit-overflow-scrolling: touch; }
.frames li { scroll-snap-align: start; display: grid; gap: 8px; align-content: start; }
.frames .f { position: relative; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--abyss); box-shadow: inset 0 0 0 1px var(--line); }
.frames .f img { width: 100%; height: 100%; object-fit: cover; }
.frames .t { font: 600 0.75rem/1 var(--font-mono); color: var(--accent); }
.frames p { font-size: 0.8125rem; line-height: 1.4; color: var(--steel-hi); }
@media (min-width: 1100px) { .frames { grid-auto-flow: row; grid-template-columns: repeat(8, 1fr); grid-auto-columns: auto; overflow: visible; } }

.script { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.script li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: baseline; }
.script .t { font: 500 0.75rem/1 var(--font-mono); color: var(--steel-hi); }
.script b { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; }
.bcell .sound { margin-top: 16px; color: var(--steel-hi); font-size: 0.9375rem; }

.brief__act { display: grid; gap: 16px; align-content: start; }
.brief__act .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.brief__act textarea { min-height: 88px; }
.brief__act .status { font-size: 0.9375rem; color: var(--steel-hi); min-height: 1.4em; }
.brief__act .status[data-kind="error"] { color: #FF8A6B; }
.brief__act .status[data-kind="pending"] { color: var(--chrome); }
.brief__act .status[data-kind="ok"] { color: var(--chrome); }

@media (min-width: 900px) {
  .brief__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bcell--idea { grid-column: span 2; }
  .bcell--board { grid-column: 1 / -1; }
  .bcell--script { grid-column: span 1; }
  .bcell--act { grid-column: span 2; }
}

/* compact mode (landing demo): the long reading folds away so Approve stays close */
.bcell--more { padding: 0; }
.bcell--more > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 18px clamp(18px, 3vw, 32px); min-height: 56px; font-weight: 650; font-size: 1rem; -webkit-tap-highlight-color: transparent; }
.bcell--more > summary::-webkit-details-marker { display: none; }
.bcell--more > summary .mono { font-size: 0.75rem; color: var(--steel-hi); font-weight: 500; }
.bcell--more > summary::after { content: "+"; font: 500 1.25rem/1 var(--font-mono); color: var(--chrome); margin-left: auto; transition: transform 200ms var(--ease-out); }
.bcell--more[open] > summary::after { transform: rotate(45deg); }
.bmore { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .bcell--more { grid-column: 1 / -1; }
  .bmore { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .brief--compact .bcell--act { grid-column: 1 / -1; }
  .brief__act .field { max-width: 640px; }
}
