/* Copyright (C) Rein Ytterberg */
/* All scene alternatives contribute to the grid's intrinsic height.
   Invisible panels reserve their space, preventing movement on selection. */
.agreements-page {
  overflow-wrap: break-word;
}
.agreement-opening {
  padding-top: 52px;
  padding-bottom: 40px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 45px;
}
.agreement-opening h1 {
  font-size: clamp(3rem, 5.5vw, 5.5rem);
}
.agreement-opening em,
.story-title em,
.robot-layout em,
.agreement-close em {
  color: var(--blue);
}
.agreement-opening p {
  max-width: 370px;
  font-size: 1.08rem;
}
.chain-story {
  padding-bottom: 65px;
}
.story-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 26px;
}
.story-title h2,
.robot-layout h2 {
  font-size: clamp(2.2rem, 3.5vw, 3.6rem);
}
.story-title p {
  max-width: 340px;
}
.scene-switch {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.scene-switch button {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: inherit;
  padding: 10px 0;
  font-weight: 700;
  font-size: 1rem;
}
.scene-switch button span {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}
.scene-switch button[aria-pressed='true'] {
  border-color: var(--blue);
  color: var(--blue);
}
.wide-stage {
  position: relative;
  background: #eaf0fa;
  overflow: hidden;
}
.wide-stage > img {
  width: 100%;
  aspect-ratio: 3/1;
  object-fit: cover;
  height: auto;
}
.stage-captions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #122644;
  color: white;
  text-align: center;
  gap: 10px;
  padding: 13px 10px;
  font-size: 0.9375rem;
}
.travelling-link {
  position: absolute;
  bottom: 49px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: #144bdd55;
}
.travelling-link i {
  position: absolute;
  left: 0;
  top: -4px;
  width: 11px;
  height: 11px;
  background: #ed4b0a;
  border: 2px solid white;
  border-radius: 50%;
}
.interactive-story[data-active='1'] .travelling-link i {
  left: 50%;
}
.interactive-story[data-active='2'] .travelling-link i {
  left: 100%;
  background: #197144;
}
.travelling-link i {
  transition:
    left 1s ease,
    background 1s ease;
}
.stable-stack {
  display: grid;
  isolation: isolate;
}
.scene-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  grid-area: 1/1;
  min-width: 0;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.18s ease;
}
.scene-panel[aria-hidden='true'] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.consequence-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding: 28px 0 22px;
}
.consequence-strip > div + div {
  border-left: 1px solid #b8c8e1;
  padding-left: 28px;
}
.consequence-strip span {
  display: block;
  color: #345077;
  font-size: 0.875rem;
  margin-bottom: 10px;
}
.consequence-strip strong {
  display: block;
  font-size: clamp(1.3rem, 2.1vw, 1.9rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.consequence-strip p {
  font-size: 1rem;
}
.story-outcome {
  max-width: none;
  padding: 17px 22px;
  background: #eaf0ff;
  font-size: 1rem;
}
.story-outcome.alert {
  background: #ffdfcc;
}
.story-outcome.resolved {
  background: #d9efe4;
}
.claims-band {
  background: #eaf0fa;
  padding: 58px 0;
}
.claims-band .story-outcome {
  background: white;
}
.exchange-section {
  padding-top: 65px;
  padding-bottom: 60px;
}
.document-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 4px solid var(--blue);
  background: #f0f4fc;
}
.document-pair > div {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.document-pair > div + div {
  background: #142647;
  color: #fff;
}
.document-pair span {
  font-size: 0.9375rem;
}
.document-pair b {
  display: block;
  font-size: 1.25rem;
}
.document-pair code {
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  overflow-wrap: anywhere;
  color: #144bdd;
}
.document-pair strong {
  font-size: clamp(1.7rem, 2.5vw, 2.5rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.red-text {
  color: #a62621;
}
.context-links {
  display: flex;
  gap: 25px;
  margin-top: 24px;
  color: var(--blue);
  text-underline-offset: 5px;
}
.robot-band {
  background: #112442;
  color: #fff;
  padding: 55px 0;
}
.robot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.robot-layout em {
  color: #9dbbff;
}
.robot-story > p {
  margin: 22px 0;
}
.robot-layout img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}
.robot-story {
  min-width: 0;
}
.robot-story .scene-switch {
  margin-bottom: 8px;
}
.robot-story .consequence-strip {
  gap: 12px;
  padding: 8px 0 18px;
}
.robot-story .consequence-strip > div + div {
  padding-left: 12px;
}
.robot-story .consequence-strip strong {
  font-size: 1.25rem;
}
.robot-band .scene-switch button[aria-pressed='true'] {
  color: #aec8ff;
  border-color: #aec8ff;
}
.robot-band .consequence-strip span {
  color: #abc5eb;
}
.robot-band .story-outcome {
  background: #203a62;
}
.invoice-section {
  padding-top: 65px;
  padding-bottom: 60px;
}
.invoice-section .consequence-strip {
  border-top: 1px solid var(--rule);
}
.invoice-section .consequence-strip > div:last-child strong {
  font-size: 3rem;
  color: var(--blue);
}
.agreement-close {
  padding: 50px 0;
  background: #eaf0ff;
}
.agreement-close > .wrap {
  display: flex;
  gap: 35px;
  justify-content: space-between;
  align-items: center;
}
.agreement-close h2 {
  font-size: clamp(2.2rem, 3.5vw, 3.5rem);
}
.agreement-close .cta {
  flex-shrink: 0;
}
@media (max-width: 850px) {
  .agreement-opening,
  .story-title {
    display: block;
  }
  .agreement-opening p,
  .story-title p {
    margin-top: 20px;
    max-width: 600px;
  }
  .robot-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .robot-layout figure {
    grid-row: 1;
  }
  .consequence-strip {
    gap: 18px;
  }
  .consequence-strip > div + div {
    padding-left: 18px;
  }
  .scene-switch {
    gap: 14px;
  }
  .stage-captions {
    font-size: 0.875rem;
  }
  .agreement-close > .wrap {
    display: block;
  }
  .agreement-close .cta {
    margin-top: 25px;
  }
}
@media (max-width: 580px) {
  .agreement-opening {
    padding-top: 32px;
  }
  .wide-stage > img {
    aspect-ratio: 2/1;
    object-fit: cover;
  }
  .stage-captions {
    gap: 8px;
    padding: 10px 8px;
    font-size: 0.875rem;
  }
  .travelling-link {
    display: none;
  }
  .consequence-strip {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 22px;
  }
  .consequence-strip > div + div {
    padding: 18px 0 0;
    border-left: 0;
    border-top: 1px solid #b8c8e1;
  }
  .consequence-strip span {
    margin-bottom: 5px;
  }
  .consequence-strip strong {
    margin-bottom: 7px;
  }
  .document-pair,
  .robot-layout {
    grid-template-columns: 1fr;
  }
  .document-pair > div {
    padding: 22px;
    gap: 12px;
  }
  .robot-story .consequence-strip > div + div {
    padding: 12px 0 0;
  }
  .scene-switch button {
    font-size: 0.9375rem;
  }
  .scene-switch {
    gap: 10px 18px;
  }
  .claims-band,
  .robot-band {
    padding: 40px 0;
  }
  .exchange-section,
  .invoice-section {
    padding-top: 45px;
    padding-bottom: 45px;
  }
  .chain-story {
    padding-bottom: 40px;
  }
  .story-outcome {
    padding: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene-panel,
  .travelling-link i {
    transition: none;
  }
}

/* Commercial consequences and recognisable customer conversations. */
.risk-scene,
.misunderstanding {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: 30px 0;
}
.case-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #a02d20;
}
.risk-narrative h3 {
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
}
.risk-narrative p + p {
  margin-top: 14px;
}
.change-record,
.hold-record,
.agreement-checks {
  padding: clamp(20px, 3vw, 32px);
  background: #f0f4fc;
}
.record-row {
  display: grid;
  gap: 5px;
  padding: 14px 0;
}
.record-row + .record-row {
  border-top: 1px solid #b8c8e1;
}
.record-row strong {
  font-size: 1.6rem;
}
.record-row b {
  color: #a62621;
}
.record-row .record-ok {
  color: #14633e;
}
.record-verdict {
  margin-top: 14px;
}
.hold-record {
  background: #fff0ea;
  border-top: 5px solid #c52c20;
}
.hold-stamp {
  display: inline-block;
  color: #a62621;
  border: 2px solid currentColor;
  padding: 6px 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transform: rotate(-2deg);
}
.hold-record dl {
  margin: 24px 0 18px;
}
.hold-record dl > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 14px;
  border-bottom: 1px solid #e9c5ba;
  padding: 8px 0;
}
.hold-record dd {
  margin: 0;
  font-weight: 700;
}
.cost-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.875rem;
}
.cost-trail span {
  padding: 5px 9px;
  background: #ffdbcc;
}
.who-pays {
  display: block;
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1.1;
  margin: 20px 0 8px;
  color: #a62621;
}
.agreement-checks {
  background: #e6f3eb;
}
.agreement-checks h4 {
  font-size: 1.3rem;
}
.agreement-checks ol {
  padding-left: 24px;
  margin: 18px 0 0;
}
.agreement-checks li {
  padding: 8px 0 8px 8px;
}
.agreement-checks li::marker {
  color: #14633e;
  font-weight: 800;
}
.agreement-checks li span {
  display: block;
  margin-top: 4px;
}
.consequence-story .story-outcome a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.conversation blockquote {
  margin: 0 32px 12px 0;
  padding: 16px 20px;
  border-radius: 18px 18px 18px 0;
  background: #eaf0ff;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  line-height: 1.25;
  font-weight: 700;
}
.conversation blockquote + blockquote {
  margin: 0 0 20px 32px;
  border-radius: 18px 18px 0 18px;
  background: #ffe3d7;
}
.conversation blockquote span {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 7px;
}
.dispute-visual {
  text-align: center;
}
.dispute-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dispute-values > div {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 10px;
  border-top: 4px solid #144bdd;
  background: #f0f4fc;
}
.dispute-values > div + div {
  background: #fff0ea;
  border-color: #c52c20;
}
.dispute-values strong {
  font-size: clamp(1.35rem, 2.7vw, 2.5rem);
  letter-spacing: -0.05em;
}
.dispute-values span {
  font-size: 0.9375rem;
}
.dispute-visual h3 {
  margin: 22px 0 0;
  color: #a62621;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.2;
}
.agreement-answer {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 26px;
  padding: 24px 28px;
  background: #142647;
  color: white;
}
.agreement-answer h4 {
  font-size: 1.5rem;
  line-height: 1.15;
}
.agreement-answer span {
  display: block;
  margin-top: 10px;
  color: #bed0ff;
  font-size: 0.9375rem;
}
@media (max-width: 700px) {
  .risk-scene,
  .misunderstanding {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 0;
  }
  .agreement-answer {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px;
  }
  .dispute-values strong {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
}

/* Keep story controls immediately beside the content they change. */
.chain-story > .scene-switch,
.claims-band .scene-switch {
  margin-top: 20px;
  margin-bottom: 0;
}
.loss-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 16px 20px;
  background: #a62621;
  color: white;
}
.loss-warning strong {
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  line-height: 1.1;
}
.cost-record {
  padding: 22px;
}
.cost-record dl {
  margin: 18px 0;
}
.cost-record dt {
  flex: 1 1 200px;
}
.cost-record dd {
  font-variant-numeric: tabular-nums;
}
.loss-total {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #a62621;
}
.loss-total strong {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.cost-basis {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.4;
}
.real-penalty {
  border-top: 1px solid #e9c5ba;
  padding-top: 12px;
  margin-top: 14px;
}
.cost-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* The email remains usable when a mail handler or clipboard API is unavailable. */
.workflow-contact {
  min-width: 0;
  max-width: 100%;
}
.workflow-contact > p {
  margin-top: 12px;
  font-size: 0.9375rem;
}
.email-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.email-copy input {
  min-width: 0;
  width: 11.5em;
  max-width: 100%;
  font: inherit;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #91a8ca;
  border-radius: 6px;
}
.email-copy button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #91a8ca;
  border-radius: 6px;
  color: #18395e;
  background: #fff;
}
#workflow-email-status {
  max-width: 28em;
}
