/* Coherence Workbench — shared cross-system state, evidence, exceptions, and continuations. */
.coherence-page {
  --coherence-blue: #8bbcff;
  --coherence-violet: #c6a6ff;
  --coherence-cyan: #7ef2ef;
  background:
    radial-gradient(circle at 16% 3%, rgba(139, 188, 255, .08), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(198, 166, 255, .055), transparent 26rem),
    var(--ink);
}

.coherence-page main {
  min-height: 100vh;
}

.coherence-page .site-header {
  border-bottom-color: rgba(139, 188, 255, .16);
  background: rgba(7, 17, 15, .88);
}

.local-badge {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  justify-self: end;
  padding: .68rem .9rem;
  border: 1px solid rgba(139, 188, 255, .28);
  color: var(--paper-soft);
  font: 700 .62rem/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.local-badge i,
.storage-state i {
  width: .42rem;
  height: .42rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coherence-blue);
  box-shadow: 0 0 .8rem rgba(139, 188, 255, .6);
}

.coherence-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .58fr);
  gap: clamp(3rem, 8vw, 9rem);
  width: min(1500px, calc(100% - 2 * var(--pad)));
  min-height: 760px;
  align-items: center;
  margin-inline: auto;
  padding: clamp(10rem, 15vw, 14rem) 0 clamp(5rem, 9vw, 9rem);
}

.coherence-hero-grid {
  position: absolute;
  z-index: -1;
  inset: 4rem calc(50% - 50vw) 0;
  overflow: hidden;
  opacity: .2;
  background-image:
    linear-gradient(rgba(139, 188, 255, .13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 188, 255, .13) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 66%, transparent 100%);
}

.coherence-hero-copy {
  max-width: 930px;
}

.coherence-hero-copy h1 {
  max-width: 1000px;
  margin: 1rem 0 1.6rem;
  font-size: clamp(4rem, 8vw, 8.9rem);
  line-height: .84;
}

.coherence-hero-copy h1 em {
  color: var(--coherence-blue);
}

.coherence-hero-copy > p:not(.eyebrow) {
  max-width: 780px;
  margin: 0;
  color: var(--paper-soft);
  font-size: clamp(1.06rem, 1.55vw, 1.3rem);
  line-height: 1.7;
}

.primitive-line {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  align-items: center;
  margin-top: 2.4rem;
  color: var(--muted);
  font: 700 .6rem/1.5 var(--mono);
  letter-spacing: .06em;
}

.primitive-line span {
  color: var(--paper-soft);
}

.primitive-line i {
  color: var(--coherence-blue);
  font-style: normal;
}

.coherence-boundary {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 3vw, 2.3rem);
  border: 1px solid rgba(139, 188, 255, .26);
  background: linear-gradient(150deg, rgba(19, 36, 31, .96), rgba(3, 8, 6, .94));
  box-shadow: 16px 16px 0 rgba(139, 188, 255, .025);
}

.coherence-boundary::after {
  position: absolute;
  right: -7rem;
  bottom: -7rem;
  width: 16rem;
  height: 16rem;
  border: 1px solid rgba(139, 188, 255, .11);
  border-radius: 50%;
  content: "";
}

.coherence-boundary > div {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font: 700 .58rem/1 var(--mono);
}

.coherence-boundary > div span {
  color: var(--muted);
}

.coherence-boundary > div strong {
  color: var(--coherence-blue);
}

.coherence-boundary ul {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: .45rem 0;
  list-style: none;
}

.coherence-boundary li {
  display: flex;
  gap: .8rem;
  padding: .72rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: .88rem;
}

.coherence-boundary li::before {
  color: var(--coherence-blue);
  content: "✓";
}

.coherence-boundary > p {
  position: relative;
  z-index: 1;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.55;
}

.workspace {
  width: min(1500px, calc(100% - 2 * var(--pad)));
  margin: 0 auto clamp(6rem, 10vw, 10rem);
  border: 1px solid rgba(139, 188, 255, .22);
  background: rgba(5, 13, 11, .9);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .28);
}

.workspace-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(19, 36, 31, .72);
}

.object-control,
.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.object-control label,
.filter-control {
  color: var(--muted);
  font: 700 .58rem/1 var(--mono);
  letter-spacing: .06em;
}

.object-control select,
.filter-control select,
.work-dialog select,
.inspector select,
.continuation-detail select {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--ink-soft);
  color: var(--paper);
  font: 650 .76rem/1.2 var(--mono);
}

.object-control select {
  min-width: 220px;
  padding: .65rem 2rem .65rem .75rem;
}

.icon-button,
.quiet-button,
.panel-button,
.text-button,
.field-link,
.exception-card,
.continuation-card {
  cursor: pointer;
}

.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(139, 188, 255, .3);
  background: rgba(139, 188, 255, .08);
  color: var(--coherence-blue);
  font: 400 1.25rem/1 var(--mono);
}

.quiet-button,
.text-button {
  border: 0;
  background: transparent;
  color: var(--paper-soft);
  font: 700 .62rem/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.quiet-button {
  padding: .7rem .8rem;
  border: 1px solid var(--line);
}

.quiet-button:hover,
.text-button:hover {
  color: var(--coherence-blue);
  border-color: rgba(139, 188, 255, .35);
}

.danger-button:hover {
  color: var(--red);
  border-color: rgba(255, 120, 141, .35);
}

.storage-state {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  color: var(--muted);
  font: 650 .58rem/1 var(--mono);
}

.workspace-metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--line);
}

.workspace-metrics > div {
  min-width: 0;
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--line);
}

.workspace-metrics > div:last-child {
  border-right: 0;
}

.workspace-metrics span {
  display: block;
  overflow: hidden;
  margin-bottom: .35rem;
  color: var(--muted);
  font: 700 .54rem/1 var(--mono);
  letter-spacing: .06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-metrics strong {
  color: var(--paper);
  font: 720 1.45rem/1 var(--display);
}

.workspace-metrics .metric-alert strong {
  color: var(--red);
}

.workspace-metrics .metric-intentional strong {
  color: var(--amber);
}

.work-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.work-tabs button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .2rem .8rem;
  min-height: 5.25rem;
  align-content: center;
  padding: 1rem 1.25rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: rgba(14, 29, 25, .45);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.work-tabs button:last-child {
  border-right: 0;
}

.work-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.work-tabs button[aria-selected="true"] {
  background: rgba(139, 188, 255, .07);
  color: var(--paper);
}

.work-tabs button[aria-selected="true"]::after {
  background: var(--coherence-blue);
  box-shadow: 0 0 1rem rgba(139, 188, 255, .45);
}

.work-tabs span {
  grid-row: 1 / 3;
  color: var(--coherence-blue);
  font: 700 .58rem/1.2 var(--mono);
}

.work-tabs strong {
  font: 720 1rem/1 var(--display);
}

.work-tabs small {
  font: 600 .56rem/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.coherence-page .work-panel {
  display: block;
  width: 100%;
  min-height: 620px;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  color: var(--paper);
}

.coherence-page .work-panel[hidden] {
  display: none;
}

.panel-heading,
.subhead {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
}

.panel-heading {
  margin-bottom: 1.75rem;
}

.coherence-page .panel-heading p {
  margin: 0 0 .4rem;
  color: var(--coherence-blue);
  font: 700 .58rem/1 var(--mono);
  letter-spacing: .08em;
}

.panel-heading h2 {
  margin: 0;
  font: 720 clamp(1.8rem, 3.3vw, 3rem)/1 var(--display);
  letter-spacing: -.025em;
}

.panel-button {
  flex: 0 0 auto;
  padding: .75rem 1rem;
  border: 1px solid rgba(139, 188, 255, .38);
  background: rgba(139, 188, 255, .1);
  color: var(--coherence-blue);
  font: 750 .62rem/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.panel-button:hover {
  background: var(--coherence-blue);
  color: var(--ink);
}

.reconcile-layout,
.queue-layout,
.continuation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr);
  gap: 1.25rem;
  align-items: start;
}

.matrix-frame {
  overflow: auto;
  max-height: 650px;
  border: 1px solid var(--line);
  background: rgba(7, 17, 15, .62);
}

.state-matrix {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .76rem;
}

.state-matrix th,
.state-matrix td {
  min-width: 170px;
  padding: .9rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.state-matrix th:first-child,
.state-matrix td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  min-width: 190px;
  background: #0b1815;
}

.state-matrix thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #10221d;
  color: var(--paper-soft);
  font: 700 .62rem/1.35 var(--mono);
}

.state-matrix thead th:first-child {
  z-index: 4;
}

.state-matrix th:last-child,
.state-matrix td:last-child {
  border-right: 0;
}

.state-matrix tbody tr:last-child td {
  border-bottom: 0;
}

.state-matrix tbody tr:hover td,
.state-matrix tbody tr.selected td {
  background: rgba(139, 188, 255, .045);
}

.state-matrix tbody tr:hover td:first-child,
.state-matrix tbody tr.selected td:first-child {
  background: #10211d;
}

.system-head strong,
.system-head small,
.matrix-value small {
  display: block;
}

.system-head strong {
  margin-bottom: .25rem;
  color: var(--paper);
}

.system-head small,
.matrix-value small {
  color: var(--muted);
  font-size: .54rem;
  text-transform: uppercase;
}

.field-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  text-align: left;
  font: 700 .72rem/1.35 var(--mono);
}

.status-pill {
  display: inline-flex;
  margin-top: .55rem;
  padding: .28rem .42rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 750 .5rem/1 var(--mono);
  letter-spacing: .05em;
}

.status-pill.same {
  border-color: rgba(132, 247, 198, .3);
  color: var(--mint);
}

.status-pill.different {
  border-color: rgba(255, 120, 141, .38);
  color: var(--red);
}

.status-pill.intentional {
  border-color: rgba(255, 199, 102, .4);
  color: var(--amber);
}

.matrix-value {
  max-width: 240px;
  overflow-wrap: anywhere;
  color: var(--paper-soft);
  font: 600 .7rem/1.5 var(--mono);
}

.matrix-value.empty {
  color: var(--muted);
  font-style: italic;
}

.matrix-value small {
  margin-top: .45rem;
}

.inspector,
.exception-inspector,
.continuation-detail {
  min-height: 390px;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: rgba(14, 29, 25, .64);
}

.inspector-label {
  margin: 0 0 .4rem;
  color: var(--coherence-blue);
  font: 700 .55rem/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.inspector h3,
.exception-inspector h3,
.continuation-detail h3 {
  margin: 0;
  font: 720 1.45rem/1.05 var(--display);
}

.canonical-card {
  margin: 1.1rem 0;
  padding: 1rem;
  border-left: 2px solid var(--coherence-blue);
  background: rgba(139, 188, 255, .06);
}

.canonical-card span,
.canonical-card small {
  display: block;
  color: var(--muted);
  font: 650 .54rem/1.4 var(--mono);
  text-transform: uppercase;
}

.canonical-card strong {
  display: block;
  margin: .45rem 0;
  overflow-wrap: anywhere;
  color: var(--paper);
  font: 650 .8rem/1.45 var(--mono);
}

.observation-list,
.plan-list {
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}

.observation-list li,
.plan-list li {
  display: grid;
  grid-template-columns: minmax(90px, .35fr) 1fr;
  gap: .8rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .7rem;
}

.observation-list span,
.plan-list span {
  color: var(--muted);
  font: 650 .57rem/1.4 var(--mono);
}

.observation-list strong,
.plan-list strong {
  overflow-wrap: anywhere;
  color: var(--paper-soft);
  font: 600 .67rem/1.45 var(--mono);
}

.plan-list b {
  display: inline-block;
  min-width: 4.6rem;
  color: var(--coherence-blue);
  font-size: .54rem;
}

.plan-list .preserve b,
.plan-list .attest b {
  color: var(--amber);
}

.inspector form,
.exception-inspector form,
.continuation-detail form,
.work-dialog form {
  display: grid;
  gap: .9rem;
}

.inspector label,
.exception-inspector label,
.continuation-detail label,
.work-dialog label {
  display: grid;
  gap: .4rem;
  color: var(--muted);
  font: 700 .55rem/1.3 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.inspector input,
.inspector textarea,
.exception-inspector input,
.exception-inspector textarea,
.continuation-detail input,
.continuation-detail textarea,
.work-dialog input,
.work-dialog textarea,
.work-dialog select {
  width: 100%;
  padding: .72rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: 0;
  background: rgba(3, 8, 6, .72);
  color: var(--paper);
  font: 600 .72rem/1.5 var(--mono);
  text-transform: none;
}

.inspector input:focus,
.inspector textarea:focus,
.exception-inspector input:focus,
.exception-inspector textarea:focus,
.continuation-detail input:focus,
.continuation-detail textarea:focus,
.work-dialog input:focus,
.work-dialog textarea:focus,
.work-dialog select:focus {
  border-color: var(--coherence-blue);
  box-shadow: 0 0 0 2px rgba(139, 188, 255, .1);
}

.form-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.form-actions {
  margin-top: .2rem;
}

.form-actions .panel-button {
  flex: 1 1 190px;
}

.form-actions .quiet-button {
  flex: 0 1 auto;
}

.attest-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(340px, 1.15fr);
  gap: 2rem;
  align-items: start;
}

.subhead {
  min-height: 2rem;
  margin-bottom: .8rem;
  align-items: center;
}

.subhead h3 {
  margin: 0;
  font: 710 1rem/1 var(--display);
}

.subhead > span,
.subhead div {
  color: var(--muted);
  font: 600 .55rem/1.4 var(--mono);
}

.subhead div {
  display: flex;
  gap: .45rem;
}

.evidence-list,
.receipt-chain,
.exception-list,
.continuation-list {
  display: grid;
  gap: .7rem;
}

.evidence-card {
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(14, 29, 25, .52);
}

.evidence-card header,
.receipt-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.evidence-card h4,
.receipt-card h4 {
  margin: 0;
  font: 690 .85rem/1.3 var(--display);
}

.evidence-card header span,
.receipt-card header span {
  flex: 0 0 auto;
  color: var(--coherence-blue);
  font: 700 .5rem/1.3 var(--mono);
  text-transform: uppercase;
}

.evidence-card p {
  margin: .7rem 0;
  color: var(--paper-soft);
  font-size: .74rem;
  line-height: 1.55;
}

.evidence-card dl,
.receipt-card dl,
.exception-facts,
.continuation-facts {
  margin: 0;
}

.evidence-card dl > div,
.receipt-card dl > div,
.exception-facts > div,
.continuation-facts > div {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: .7rem;
  padding: .45rem 0;
  border-top: 1px solid var(--line);
  font: 600 .57rem/1.45 var(--mono);
}

.evidence-card dt,
.receipt-card dt,
.exception-facts dt,
.continuation-facts dt {
  color: var(--muted);
}

.evidence-card dd,
.receipt-card dd,
.exception-facts dd,
.continuation-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--paper-soft);
}

.chain-status {
  margin-bottom: .7rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 650 .58rem/1.4 var(--mono);
}

.chain-status.valid {
  border-color: rgba(132, 247, 198, .32);
  color: var(--mint);
}

.chain-status.invalid {
  border-color: rgba(255, 120, 141, .35);
  color: var(--red);
}

.receipt-chain {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: receipt;
}

.receipt-card {
  position: relative;
  padding: 1rem 1rem 1rem 2.8rem;
  border: 1px solid var(--line);
  background: rgba(14, 29, 25, .52);
  counter-increment: receipt;
}

.receipt-card::before {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--coherence-blue);
  font: 700 .58rem/1 var(--mono);
  content: counter(receipt, decimal-leading-zero);
}

.receipt-card + .receipt-card::after {
  position: absolute;
  top: -.72rem;
  left: 1.23rem;
  width: 1px;
  height: .72rem;
  background: var(--coherence-blue);
  content: "";
}

.filter-control {
  display: flex;
  gap: .65rem;
  align-items: center;
}

.filter-control select {
  padding: .65rem 2rem .65rem .7rem;
}

.exception-card,
.continuation-card {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(14, 29, 25, .52);
  color: var(--paper);
  text-align: left;
}

.exception-card:hover,
.exception-card.selected,
.continuation-card:hover,
.continuation-card.selected {
  border-color: rgba(139, 188, 255, .38);
  background: rgba(139, 188, 255, .06);
}

.exception-card header,
.continuation-card header {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
}

.exception-card strong,
.continuation-card strong {
  font: 700 .78rem/1.3 var(--display);
}

.exception-card header span,
.continuation-card header span,
.continuation-status {
  padding: .25rem .38rem;
  border: 1px solid rgba(255, 120, 141, .35);
  color: var(--red);
  font: 750 .48rem/1 var(--mono);
}

.exception-card header span.resolved,
.continuation-card header span.done {
  border-color: rgba(132, 247, 198, .3);
  color: var(--mint);
}

.continuation-card header span.active {
  border-color: rgba(139, 188, 255, .35);
  color: var(--coherence-blue);
}

.exception-card p,
.continuation-card p {
  margin: .65rem 0 0;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.45;
}

.exception-inspector > p,
.continuation-detail > p {
  color: var(--paper-soft);
  font-size: .75rem;
}

.exception-facts,
.continuation-facts {
  margin: 1rem 0;
}

.pattern-bank {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

#pattern-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}

.pattern-card {
  padding: .9rem;
  border: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: .7rem;
}

.pattern-card span {
  display: block;
  margin-bottom: .45rem;
  color: var(--coherence-blue);
  font: 700 .52rem/1 var(--mono);
  text-transform: uppercase;
}

.next-action {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(139, 188, 255, .3);
  background: rgba(139, 188, 255, .06);
}

.next-action span {
  display: block;
  margin-bottom: .45rem;
  color: var(--coherence-blue);
  font: 750 .52rem/1 var(--mono);
}

.next-action strong {
  display: block;
  color: var(--paper);
  font-size: .78rem;
  line-height: 1.5;
}

.event-timeline {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.event-timeline li {
  position: relative;
  padding: 0 0 1rem 1.2rem;
  border-left: 1px solid var(--line-strong);
}

.event-timeline li::before {
  position: absolute;
  top: .25rem;
  left: -.28rem;
  width: .48rem;
  height: .48rem;
  border: 1px solid var(--coherence-blue);
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.event-timeline span,
.event-timeline small {
  display: block;
  color: var(--muted);
  font: 650 .52rem/1.4 var(--mono);
}

.event-timeline p {
  margin: .3rem 0 0;
  color: var(--paper-soft);
  font-size: .68rem;
}

.empty-state {
  padding: 2rem 1rem;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: .76rem;
  text-align: center;
}

.alpha-contract {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  gap: clamp(3rem, 9vw, 9rem);
  width: min(1180px, calc(100% - 2 * var(--pad)));
  margin: 0 auto clamp(7rem, 12vw, 12rem);
}

.alpha-contract h2 {
  margin: .8rem 0 0;
  font: 720 clamp(2.4rem, 5vw, 4.7rem)/.98 var(--display);
  letter-spacing: -.035em;
}

.alpha-contract dl {
  margin: 0;
}

.alpha-contract dl > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.alpha-contract dt {
  color: var(--coherence-blue);
  font: 700 .58rem/1.5 var(--mono);
  text-transform: uppercase;
}

.alpha-contract dd {
  margin: 0;
  color: var(--paper-soft);
  font-size: .86rem;
}

.coherence-footer {
  border-top-color: rgba(139, 188, 255, .18);
}

.work-dialog {
  width: min(680px, calc(100% - 2rem));
  max-height: min(860px, calc(100vh - 2rem));
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(139, 188, 255, .34);
  border-radius: 0;
  background: #0b1815;
  color: var(--paper);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .7);
}

.work-dialog::backdrop {
  background: rgba(3, 8, 6, .82);
  backdrop-filter: blur(8px);
}

.work-dialog form {
  padding: 1.25rem;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.dialog-head span {
  color: var(--coherence-blue);
  font: 700 .55rem/1 var(--mono);
  letter-spacing: .06em;
}

.dialog-head h2 {
  margin: .45rem 0 0;
  font: 720 1.8rem/1 var(--display);
}

.dialog-head > button {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}

.check-label {
  display: flex !important;
  flex-direction: row;
  gap: .65rem !important;
  align-items: center;
  padding: .75rem;
  border: 1px solid var(--line);
}

.check-label input {
  width: auto;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
}

.dialog-actions {
  justify-content: end;
  padding-top: .25rem;
}

.toast {
  position: fixed;
  z-index: 500;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: min(420px, calc(100% - 2.5rem));
  padding: .85rem 1rem;
  transform: translateY(2rem);
  border: 1px solid rgba(139, 188, 255, .4);
  background: #10211d;
  color: var(--paper);
  font: 650 .68rem/1.45 var(--mono);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-color: rgba(255, 120, 141, .45);
  color: var(--red);
}

@media (max-width: 1120px) {
  .coherence-page .site-header {
    grid-template-columns: auto auto 1fr auto;
  }

  .coherence-page .nav-toggle {
    grid-column: 3;
  }

  .local-badge {
    grid-column: 4;
  }

  .coherence-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .coherence-boundary {
    max-width: 680px;
  }

  .workspace-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .workspace-metrics > div:nth-child(3) {
    border-right: 0;
  }

  .workspace-metrics > div:nth-child(-n+3) {
    border-bottom: 1px solid var(--line);
  }

  .reconcile-layout,
  .queue-layout,
  .continuation-layout,
  .attest-layout {
    grid-template-columns: 1fr;
  }

  .inspector,
  .exception-inspector,
  .continuation-detail {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .local-badge {
    display: none;
  }

  .coherence-hero {
    width: calc(100% - 2rem);
    padding-top: 9rem;
  }

  .coherence-hero-copy h1 {
    font-size: clamp(3.5rem, 16vw, 6rem);
  }

  .workspace {
    width: calc(100% - 1rem);
  }

  .workspace-toolbar,
  .panel-heading,
  .subhead {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-actions {
    width: 100%;
  }

  .storage-state {
    flex: 1 1 100%;
  }

  .work-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-tabs button:nth-child(2) {
    border-right: 0;
  }

  .work-tabs button:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  #pattern-list,
  .alpha-contract {
    grid-template-columns: 1fr;
  }

  .alpha-contract {
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .coherence-hero {
    width: calc(100% - 1.5rem);
    padding-bottom: 4rem;
  }

  .coherence-hero-copy h1 {
    font-size: clamp(3.15rem, 17vw, 5rem);
  }

  .primitive-line {
    align-items: start;
    flex-direction: column;
  }

  .primitive-line i {
    transform: rotate(90deg);
  }

  .workspace-toolbar,
  .coherence-page .work-panel {
    padding-inline: .8rem;
  }

  .object-control,
  .object-control select {
    width: 100%;
  }

  .object-control .icon-button {
    width: 100%;
  }

  .workspace-actions .quiet-button {
    flex: 1 1 calc(33% - .65rem);
  }

  .workspace-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace-metrics > div:nth-child(3) {
    border-right: 1px solid var(--line);
  }

  .workspace-metrics > div:nth-child(2n) {
    border-right: 0;
  }

  .workspace-metrics > div:nth-child(-n+4) {
    border-bottom: 1px solid var(--line);
  }

  .work-tabs button {
    min-height: 4.8rem;
    padding: .8rem;
  }

  .work-tabs small {
    display: none;
  }

  .panel-heading h2 {
    font-size: 1.75rem;
  }

  .form-grid,
  .alpha-contract dl > div,
  .evidence-card dl > div,
  .receipt-card dl > div,
  .exception-facts > div,
  .continuation-facts > div {
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  .receipt-card {
    padding-left: 1rem;
  }

  .receipt-card::before,
  .receipt-card + .receipt-card::after {
    display: none;
  }

  .alpha-contract {
    width: calc(100% - 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}

@media print {
  .coherence-page .site-header,
  .workspace-actions,
  .work-tabs,
  .panel-button,
  .form-actions,
  .work-dialog,
  .toast {
    display: none !important;
  }

  .workspace,
  .work-panel,
  .matrix-frame,
  .inspector,
  .exception-inspector,
  .continuation-detail {
    border-color: #777;
    background: #fff;
    color: #000;
    box-shadow: none;
  }
}

/* September workbench: put the work above the fold and support recovery. */
.coherence-hero{min-height:0;padding:2.5rem 0;gap:2rem;grid-template-columns:1fr auto}
.coherence-hero h1{font-size:clamp(2rem,3.3vw,3.2rem);margin:.7rem 0 1rem}
.coherence-hero-copy>p:not(.eyebrow){font-size:1rem;max-width:70ch}
.coherence-hero-grid,.primitive-line,.coherence-boundary{display:none}
.coherence-page .site-header{background:var(--ink)}
.workspace{padding-top:0}.workspace-toolbar{flex-wrap:wrap;gap:1rem}.workspace-actions{flex-wrap:wrap}
.recovery-banner{border:1px solid var(--amber);padding:1.5rem;margin-bottom:1.5rem;background:var(--panel)}
.recovery-banner p{margin:.5rem 0;font-size:1rem}
button:disabled{opacity:.45;cursor:not-allowed}
.coherence-page .brand strong{font-size:1.5rem}.coherence-page .brand small{font-size:.65rem}
@media(max-width:760px){.coherence-hero{grid-template-columns:1fr;padding-block:1.5rem}.coherence-page .local-badge{display:none}.workspace-actions{justify-content:flex-start}.workspace-actions>button{min-height:40px}}
.state-matrix{font-size:.875rem}.state-matrix thead th{font-size:.75rem}.matrix-value{font-size:.875rem}.matrix-value small{font-size:.75rem}.workspace-actions button,.object-control label,.storage-state{font-size:.75rem}.coherence-page [data-panel] h2{font-size:clamp(1.5rem,2.4vw,2.1rem)}
#comparison-policy{width:100%;max-width:100%;min-width:0;background:var(--panel);color:var(--paper);padding:.65rem;border:1px solid var(--line);font-size:.875rem}
