.harness-demo {
  --brief-ink: #192f2c;
  --brief-paper: #f5f1e6;
  --brief-accent: #ff7950;
  --brief-trace: #8ba99c;
  --brief-mono: 'IBM Plex Mono', Consolas, monospace;
  container-type: inline-size;
  min-width: 0;
  width: min(100%, 700px);
  color: var(--brief-ink);
  align-self: center;
}

.brief-instrument {
  overflow: hidden;
  background: var(--brief-paper);
  border: 1px solid #a5a99a;
  border-radius: 8px;
  box-shadow: 0 4px 0 -1px #c6c7b8, 0 15px 32px -20px #162a2455;
}

.brief-toolbar, .brief-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brief-toolbar {
  padding: 12px clamp(13px, 4cqw, 28px);
  border-bottom: 1px solid #c4c4b7;
  background: #e7e5d9;
  font: 600 12px/1.3 'DM Sans', Arial, sans-serif;
}

.brief-toolbar > span:first-child, .brief-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brief-mark {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  background: radial-gradient(circle, var(--brief-ink) 1.5px, transparent 2px) center / 6px 6px content-box, var(--brief-accent);
  padding: 3px;
}

.brief-mode, .brief-inputs small, .brief-unit > span:last-child, .brief-result-label, .brief-result li small {
  font: 500 10px/1.4 var(--brief-mono);
  letter-spacing: .055em;
  text-transform: uppercase;
}

.brief-heading {
  padding: clamp(18px, 4.8cqw, 30px) clamp(13px, 4cqw, 28px) 17px;
}

.brief-heading h3 {
  color: var(--brief-ink);
  font: 500 clamp(27px, 5.7cqw, 36px)/1.06 Georgia, 'Times New Roman', serif;
  letter-spacing: -.045em;
  margin: 0;
}

.brief-heading p {
  color: #485953;
  font: 400 clamp(13px, 2.5cqw, 15px)/1.5 'DM Sans', Arial, sans-serif;
  margin: 7px 0 0;
}

.brief-map {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(12px, .48fr) minmax(40px, .65fr) minmax(12px, .43fr) minmax(40px, .65fr);
  align-items: center;
  margin: 0 clamp(9px, 2.4cqw, 15px);
  padding: clamp(15px, 3.5cqw, 25px);
  border: 1px solid #132c25;
  border-radius: 5px;
  background: radial-gradient(circle, #b0d4ac2f .75px, transparent .95px) 0 0 / 10px 10px, #233f39;
  box-shadow: inset 0 1px 3px #142c29;
}

.brief-inputs {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.brief-picker { margin: 0; padding: 0; min-width: 0; border: 0; }
.brief-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.brief-inputs li { position: relative; }
.brief-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px clamp(6px, 2cqw, 14px);
  border: 1px solid #78988b;
  border-radius: 3px;
  color: #f7f7e9;
  background: #2b4b43;
  cursor: pointer;
}

.brief-option:hover { border-color: #d5dfc7; }
.brief-option input { appearance: none; width: 12px; height: 12px; flex: none; border: 1px solid #a6bda8; border-radius: 50%; margin: 0; }
.brief-option:has(:focus-visible) { outline: 2px solid #ffe9cb; outline-offset: 2px; }
.brief-option input:focus-visible { outline: 0; }
.brief-option:has(:checked) { color: #fff5e4; border-color: #f6aa77; background: #425246; }
.brief-option input:checked { background: radial-gradient(circle, #ffc08e 38%, transparent 43%); border-color: #ffbc87; }
.brief-option > span { display: grid; }
.brief-inputs small { color: #c8dacb; font-size: 9px; }
.brief-option:has(:checked) small { color: #f3c39c; }
.brief-inputs strong { font: 600 clamp(11px, 2.3cqw, 14px)/1.2 'DM Sans', Arial, sans-serif; }

.brief-inputs li::after, .brief-wire::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d8e2cd;
  position: absolute;
  top: 50%;
  right: -3px;
  transform: translateY(-50%);
}

.brief-merge { display: grid; align-self: stretch; grid-template-rows: repeat(3, 1fr); gap: 8px; }
.brief-merge i { position: relative; }
.brief-merge i::before, .brief-wire { content: ''; background: var(--brief-trace); height: 1px; }
.brief-merge i::before { position: absolute; left: 0; right: 50%; top: 50%; }
.brief-merge i:nth-child(2)::before { right: 0; }
.brief-merge i:first-child::after, .brief-merge i:last-child::after {
  content: ''; position: absolute; width: 1px; background: var(--brief-trace); left: 50%; height: calc(100% + 8px);
}
.brief-merge i:first-child::after { top: 50%; }
.brief-merge i:last-child::after { bottom: 50%; }

.brief-unit {
  position: relative;
  height: clamp(49px, 13cqw, 80px);
  display: grid;
  place-items: center;
  border: 1px solid #78988b;
  border-radius: 5px;
  background: #354f46;
}

.brief-unit > span:last-child {
  position: absolute; top: calc(100% + 7px);
  color: #d9e8d8; white-space: nowrap; font-size: 9px;
}
.brief-agent { background: #f3c99b; border-color: #f1dbb6; }
.brief-chip { position: relative; width: 32px; height: 32px; display: grid; place-items: center; }
.brief-chip::before, .brief-chip::after {
  content: ''; position: absolute; inset: 0 5px;
  background: repeating-linear-gradient(90deg, transparent 0 2px, #284038 2px 4px, transparent 4px 6px);
}
.brief-chip::after { transform: rotate(90deg); }
.brief-chip i {
  z-index: 1; display: grid; place-items: center; width: 24px; height: 24px;
  background: #f6cea2; border: 2px solid #284038; border-radius: 3px;
}
.brief-chip i::after { content: ''; width: 9px; height: 9px; border: 1px solid #284038; transform: rotate(45deg); }
.brief-wire { position: relative; }
.brief-sheet {
  display: flex; align-items: center; justify-content: center;
  width: 23px; height: 29px; border: 1.5px solid #dae6d5; border-radius: 2px;
}
.brief-sheet i { width: 12px; height: 10px; background: repeating-linear-gradient(#dae6d5 0 1px, transparent 1px 4px); }

.brief-controls { padding: 16px clamp(13px, 4cqw, 28px); flex-wrap: wrap; }
.brief-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.harness-demo [hidden] { display: none; }
.brief-revise {
  min-height: 40px; padding: 2px; border: 0; background: transparent; color: #334d41;
  font: 600 13px/1.3 'DM Sans', Arial, sans-serif; text-decoration: underline; text-underline-offset: 3px;
}
.brief-status { font: 500 clamp(10px, 2cqw, 12px)/1.4 var(--brief-mono); color: #39554a; }
.brief-status > i { width: 7px; height: 7px; border-radius: 50%; background: #4f7956; }
.brief-action, .brief-link {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 15px; min-height: 42px; border: 1px solid #773b21;
  background: var(--brief-accent); color: #1f2b23; border-radius: 4px;
  font: 700 13px/1.25 'DM Sans', Arial, sans-serif; cursor: pointer; text-decoration: none;
}
.brief-action:hover, .brief-link:hover { background: #ff986f; }
.brief-actions :focus-visible { outline: 3px solid #075e64; outline-offset: 3px; }
.brief-action[aria-disabled=true] { cursor: progress; }
.brief-action i, .brief-link i { font: normal 18px/1 Arial, sans-serif; }
.brief-result { margin: 0 clamp(9px, 2.4cqw, 15px); padding: 15px clamp(13px, 3.4cqw, 24px); border-radius: 5px; background: #233f39; color: #fbf5e8; }
.brief-result-label { color: #ffbd8b; }
.brief-result ol { list-style: none; counter-reset: task; margin: 8px 0 0; padding: 0; }
.brief-result li { counter-increment: task; display: grid; grid-template-columns: 21px 1fr; align-items: baseline; gap: 0 8px; border-top: 1px solid #708b7e80; padding: 8px 0; }
.brief-result li::before { content: counter(task, decimal-leading-zero); grid-row: span 2; font: 500 11px/1.3 var(--brief-mono); color: #e5b18f; }
.brief-result li small { color: #c4d4c5; font-size: 9px; }
.brief-result li span { font: 500 clamp(12px, 2.5cqw, 14px)/1.35 'DM Sans', Arial, sans-serif; }
.harness-demo[data-stage=approved] .brief-result-label { color: #d0e5af; }
@media (prefers-reduced-motion: no-preference) {
  .harness-demo[data-stage=reading] .brief-merge i::before,
  .harness-demo[data-stage=drafting] .brief-wire {
    height: 2px;
    background: linear-gradient(90deg, #91ab97 15%, #ffe3a3 50%, #91ab97 85%) 0 0 / 200% 100%;
    animation: brief-flow 450ms linear infinite;
  }
}
@keyframes brief-flow { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@container (max-width: 355px) {
  .brief-map { padding: 15px 9px; grid-template-columns: minmax(0, 1.65fr) .22fr minmax(35px, .52fr) .17fr minmax(35px, .52fr); }
  .brief-mode { font-size: 8px; }
  .brief-controls { gap: 7px; }
  .brief-action, .brief-link { padding-inline: 10px; }
  .brief-option { gap: 4px; }
  .brief-option input { width: 10px; height: 10px; }
}
