/* Copyright (C) Rein Ytterberg */
/* Site-wide interaction contract: controls have button surfaces; static labels
   do not. Scenario results remain inline beside their controls. */
h1 br,
h2 br,
h3 br {
  display: initial !important;
}
.scene-switch,
.ai-choices,
.resource-tabs,
.build-controls,
.feedback-controls,
.condition-tabs,
.event-steps,
.exchange-tabs,
.exception-tabs,
.story-tabs,
.obstacle-tabs,
.claim-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: stretch;
}
:is(
    .scene-switch,
    .ai-choices,
    .resource-tabs,
    .build-controls,
    .feedback-controls,
    .condition-tabs,
    .event-steps,
    .exchange-tabs,
    .exception-tabs,
    .story-tabs,
    .obstacle-tabs,
    .claim-tabs
  )
  > button {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 8px;
  margin: 0;
  border: 1px solid #91a8ca;
  border-radius: 6px;
  background: #edf3ff;
  color: #18395e;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  box-shadow: none;
}
:is(
    .scene-switch,
    .ai-choices,
    .resource-tabs,
    .build-controls,
    .feedback-controls,
    .condition-tabs,
    .event-steps,
    .exchange-tabs,
    .exception-tabs,
    .story-tabs,
    .obstacle-tabs,
    .claim-tabs
  )
  > button:is([aria-pressed='true'], [aria-selected='true']) {
  background: #144bdd;
  color: white;
  border-color: #144bdd;
}
:is(button, a):focus-visible {
  outline: 3px solid #e78700;
  outline-offset: 3px;
}
.shop-document {
  text-decoration: none !important;
  color: #263d58;
  cursor: default;
}
.media-detail-link {
  display: inline-block;
  border: 1px solid #144bdd;
  border-radius: 6px;
  padding: 10px 14px;
  background: #144bdd;
  color: white !important;
  text-decoration: none;
}
.space-factors {
  display: flex !important;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px !important;
}
.space-factors span {
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  padding: 0 !important;
  cursor: default;
}
#offer-check {
  cursor: pointer;
}
#offer-result:not(:empty) {
  background: #dbeee4;
  padding: 14px;
  border-left: 4px solid #187343;
  margin-top: 12px;
}
.life-art {
  overflow: visible;
}
.life-art > img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}
#example-photo {
  width: 100%;
  font: inherit;
  color: #144bdd;
  border: 1px solid #91a8ca;
  border-radius: 5px;
  padding: 12px;
  cursor: pointer;
}
#example-photo-dialog img {
  max-height: 70dvh;
  object-fit: contain;
}
.generated-document > .ai-choices {
  margin-bottom: 16px;
}
.warehouse-section > .scene-decision {
  position: static;
  display: flex;
  margin: 0;
  background: #edf3ff;
  color: #18395e;
  padding: 16px;
}
.resource-livecaption {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: #182c4d;
  color: white;
}
.resource-livecaption b {
  font-size: 1.3rem;
}
@media (max-width: 760px) {
  :is(
    .scene-switch,
    .ai-choices,
    .resource-tabs,
    .build-controls,
    .feedback-controls,
    .condition-tabs,
    .event-steps,
    .exchange-tabs,
    .exception-tabs,
    .story-tabs,
    .obstacle-tabs,
    .claim-tabs
  ) {
    gap: 4px !important;
    padding-block: 8px !important;
    margin-block: 8px !important;
  }
  :is(
      .scene-switch,
      .ai-choices,
      .resource-tabs,
      .build-controls,
      .feedback-controls,
      .condition-tabs,
      .event-steps,
      .exchange-tabs,
      .exception-tabs,
      .story-tabs,
      .obstacle-tabs,
      .claim-tabs
    )
    > button {
    font-size: 0.875rem !important;
    padding: 9px 4px !important;
    line-height: 1.15;
  }
  .scene-switch button > span {
    display: none;
  }
  .impact-art img,
  .space-art img,
  .space-resource-art img {
    height: auto;
    max-height: 190px;
    object-fit: contain;
  }
  .impact-art figcaption,
  .space-art figcaption {
    padding: 8px;
  }
  .source-material {
    display: grid;
    grid-template-columns: 80px 1fr;
    text-align: left;
    gap: 6px 14px;
  }
  .source-material img {
    grid-row: 1 / 4;
    height: 90px;
    width: 80px;
  }
  .source-material h3 {
    font-size: 1.3rem;
    margin: 0;
  }
  .source-lines {
    display: none;
  }
  .source-material > p {
    margin: 0;
  }
  .document-connector {
    display: none;
  }
  .document-workbench {
    gap: 16px;
  }
  .generated-document {
    padding: 16px;
    box-shadow: none;
  }
  .generated-document h3 {
    font-size: 1.5rem;
    min-height: 0;
  }
  .generated-document .ai-panel {
    gap: 12px;
  }
  .impact-results {
    gap: 12px;
    padding: 14px 0;
  }
  .impact-results > div + div {
    padding-top: 12px;
  }
  .impact-results h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }
  .impact-results span {
    margin-bottom: 4px;
  }
  .ai-answer {
    padding: 12px;
    font-size: 1rem;
  }
  .life-identity {
    position: static;
    width: auto;
    padding: 8px;
    background: #eaf1fc;
  }
  .life-paths {
    display: none;
  }
  .life-art {
    margin: 0;
  }
  .marketplace-section .media-bridge {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .marketplace-section .api-bridge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
  }
  .api-bridge p {
    margin: 0;
  }
  .scene-order {
    position: static;
    padding: 10px;
  }
  .warehouse-scene img {
    max-height: 220px;
    object-fit: contain;
    height: auto;
  }
  #resource-dialog .offer-image {
    display: none;
  }
  #resource-dialog .offer-content {
    grid-template-columns: 1fr;
  }
  #resource-dialog .offer-body {
    padding: 16px;
  }
  #resource-dialog h2 {
    font-size: 1.4rem;
  }
  .job-comparison {
    gap: 10px;
  }
}
/* A resource check replaces the details in the same dialog. */
#resource-dialog.check-complete .offer-content {
  display: none;
}
#resource-dialog.check-complete #offer-result {
  margin-top: 12px;
}
:is(
    .scene-switch,
    .ai-choices,
    .resource-tabs,
    .build-controls,
    .feedback-controls,
    .condition-tabs,
    .event-steps,
    .exchange-tabs,
    .exception-tabs,
    .story-tabs,
    .obstacle-tabs,
    .claim-tabs
  )
  > button:is([aria-pressed='true'], [aria-selected='true']) {
  color: white !important;
}
@media (max-width: 760px) {
  #story-panel,
  .illustrated-exception {
    display: flex;
    flex-direction: column;
  }
  #story-panel .story-copy,
  .illustrated-exception #issue-panel {
    order: -1;
  }
  #story-panel > figure,
  .illustrated-exception > img {
    max-height: 200px;
  }
  #story-panel > figure img {
    height: 200px;
    object-fit: contain;
  }
}

/* Keep inline mobile results compact; the actual content stays on the page. */
@media (max-width: 760px) {
  :is(.ai-choices, .resource-tabs, .build-controls, .scene-switch, .story-tabs, .obstacle-tabs) {
    scroll-margin-top: 12px;
  }
  .impact-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0;
  }
  .impact-results > div {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 5px 12px;
    align-items: start;
  }
  .impact-results > div > span {
    display: none;
  }
  .impact-results > div + div {
    padding: 10px 0 0;
    border-left: 0;
  }
  .impact-results h3 {
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
  }
  .impact-results p {
    font-size: 0.9375rem;
    line-height: 1.3;
  }
  .ai-answer {
    font-size: 0.9375rem;
    padding: 12px;
  }
  .job-comparison {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 0;
  }
  .job-comparison > div {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 10px;
    padding: 8px 0;
    min-height: 0;
  }
  .job-comparison b {
    font-size: 1rem;
  }
}

/* Approved interaction system: controls and their result are one unit. */
html {
  scroll-behavior: auto;
}
site-header {
  position: relative;
}
.site-header {
  background: #12243f;
}
.adaptive-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.scenario-unit {
  min-width: 0;
  order: 0;
}
.scenario-art {
  min-width: 0;
  order: 1;
  margin: 0;
  width: 100%;
}
.scenario-art img,
img.scenario-art {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}
.scenario-result {
  min-width: 0;
}
.scenario-unit > :is(.scene-switch, .resource-tabs, .story-tabs, .exception-tabs, .exchange-tabs) {
  margin: 0 0 8px;
}
.scenario-unit .scene-panel {
  align-content: start;
}
.scenario-unit h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.12;
}
.scenario-unit p {
  font-size: 1rem;
  line-height: 1.4;
}
:is(
  .scene-switch,
  .resource-tabs,
  .build-controls,
  .feedback-controls,
  .condition-tabs,
  .event-steps,
  .exchange-tabs,
  .exception-tabs,
  .story-tabs,
  .obstacle-tabs,
  .claim-tabs,
  .story-navigation,
  .language-switch,
  .route-stops
) {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}
:is(
    .scene-switch,
    .resource-tabs,
    .build-controls,
    .feedback-controls,
    .condition-tabs,
    .event-steps,
    .exchange-tabs,
    .exception-tabs,
    .story-tabs,
    .obstacle-tabs,
    .claim-tabs,
    .story-navigation,
    .language-switch,
    .route-stops
  )
  > button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 9px 4px;
  border: 1px solid #91a8ca;
  border-radius: 5px 5px 0 0;
  background: #f8faff;
  color: #18395e;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.15;
  box-shadow:
    inset 0 1px 0 #ffffff70,
    0 2px 2px #10243c18;
  text-decoration: none;
}
:is(
    .scene-switch,
    .resource-tabs,
    .build-controls,
    .feedback-controls,
    .condition-tabs,
    .event-steps,
    .exchange-tabs,
    .exception-tabs,
    .story-tabs,
    .obstacle-tabs,
    .claim-tabs,
    .story-navigation,
    .language-switch,
    .route-stops
  )
  > button:is([aria-pressed='true'], [aria-selected='true'], [aria-current='step']) {
  background: #144bdd;
  border-color: #144bdd;
  color: white;
  box-shadow: inset 0 2px 3px #081b5338;
}
.scene-switch button > span {
  display: none;
}
.cta {
  background: var(--orange);
  border-radius: 0;
}
.compact-risk {
  display: grid;
  gap: 14px;
  padding: 16px 0;
}
.risk-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.risk-comparison > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 4px solid #278259;
  background: #e9f5ed;
}
.risk-comparison > .risk-bad {
  background: #fff0eb;
  border-color: #b52c27;
}
.risk-comparison b {
  font-size: 1.15rem;
}
.compact-cost {
  margin: 0;
}
.compact-cost > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #d7bdb9;
}
.compact-cost dd {
  margin: 0;
  font-weight: 700;
  color: #a62621;
  white-space: nowrap;
}
.compact-checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.compact-checks li {
  display: grid;
  gap: 4px;
  border-left: 4px solid #268052;
  padding-left: 12px;
}
.cost-source-note {
  font-size: 14px;
  margin-top: 14px;
}
.loss-warning {
  margin-bottom: 14px;
}
.consequence-story .story-outcome {
  padding: 12px;
}
.story-copy {
  padding: 14px 0;
}
.story-copy blockquote {
  font-size: clamp(1.3rem, 2vw, 2rem);
  margin-block: 14px;
}
.story-copy p {
  margin-block: 10px;
}
.warehouse-section .scene-decision {
  position: static;
  display: flex;
  padding: 14px;
  background: #edf3ff;
  color: #18395e;
}
.scenario-unit .job-comparison {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px 0;
}
.scenario-unit .job-comparison > div {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
  padding: 8px 0;
  border: 0;
}
.scenario-unit .job-comparison b {
  font-size: 1rem;
}
.real-screenshot-frame {
  position: relative;
  display: block;
  background: #192433;
  padding: 17px 8px 10px;
  border: 1px solid #465363;
  border-radius: 14px;
  width: 100%;
  cursor: zoom-in;
}
.real-screenshot-frame::before {
  content: '';
  position: absolute;
  top: 6px;
  left: calc(50% - 2px);
  width: 5px;
  height: 5px;
  background: #708098;
  border-radius: 50%;
}
.screenshot-zoom {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #6883a6;
  border-radius: 5px;
  background: white;
  color: #15263d;
  box-shadow: 0 2px 4px #15263d30;
}
.screen-button img {
  height: auto;
  max-height: none;
  object-fit: contain;
}
.priority-messages span span {
  display: inline;
}
.ai-page {
  --line: #c1cde0;
}
.ai-page main .contact {
  display: block;
}
.damage-photo-static {
  overflow: hidden;
}
.damage-photo-static .claim-photo {
  display: block;
}
.draft-stage {
  border: 8px solid #192433;
  border-top-width: 18px;
  border-radius: 14px;
}
/* Real controls on the purchase-order demonstration remain touch-sized. */
.draft-stage .screenshot-hotspot {
  min-height: 44px;
  min-width: 70px;
  font-size: 14px;
  border: 1px solid #8796a9;
  background: #f7f8fa;
  color: #15263d;
}
#warning-investigate {
  background: #1761c2;
  color: white;
}
.screenshot-viewer::backdrop {
  background: #081323dc;
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media (min-width: 780px) and (max-width: 1279px) {
  .adaptive-example {
    grid-template-columns: 1.08fr 1fr;
    align-items: center;
    gap: 28px;
  }
  .scenario-unit {
    grid-column: 1;
    grid-row: 1;
  }
  .scenario-art {
    grid-column: 2;
    grid-row: 1;
  }
}
@media (min-width: 1280px) {
  .adaptive-example {
    grid-template-columns: 1fr;
  }
  .scenario-art {
    order: -1;
  }
  .scenario-unit {
    width: min(100%, 840px);
  }
  .obstacle-layout .scenario-art {
    max-width: 980px;
    justify-self: center;
  }
}
@media (max-width: 779px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .scenario-unit p {
    font-size: 15px;
    line-height: 1.3;
  }
  .scenario-unit h3 {
    font-size: 1.35rem;
  }
  .scenario-unit .story-outcome {
    font-size: 15px;
    padding: 10px;
  }
  .scenario-unit .cost-basis {
    font-size: 13px;
  }
  .compact-risk {
    gap: 10px;
    padding: 8px 0;
  }
  .compact-cost {
    font-size: 14px;
  }
  .risk-comparison > div {
    padding: 8px;
  }
  .consequence-strip {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0;
  }
  .consequence-strip > div {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 4px 10px;
  }
  .consequence-strip > div + div {
    padding-left: 0;
    border-left: 0;
  }
  .consequence-strip span {
    grid-column: 1;
    margin: 0;
    font-size: 13px;
  }
  .consequence-strip strong {
    grid-column: 1;
    font-size: 16px;
    margin: 0;
  }
  .consequence-strip p {
    grid-column: 2;
    grid-row: 1 / 3;
  }
  .misunderstanding {
    grid-template-columns: 1fr;
    padding: 10px 0;
    gap: 12px;
  }
  .conversation blockquote {
    padding: 8px 12px;
    font-size: 17px;
    margin: 0 0 6px;
  }
  .conversation blockquote span {
    font-size: 12px;
  }
  .dispute-visual {
    padding: 12px;
  }
  .dispute-values {
    margin-bottom: 8px;
  }
  .dispute-values strong {
    font-size: 22px;
  }
  .dispute-values span {
    font-size: 13px;
  }
  .agreement-answer {
    display: block;
    padding: 12px;
  }
  .agreement-answer h4 {
    font-size: 16px;
    margin: 0 0 8px;
  }
  .agreement-answer h4 br {
    display: none;
  }
  .agreement-answer h4 br::after {
    content: ' ';
  }
  #condition-panel {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    padding: 14px;
  }
  .condition-visual {
    min-height: 60px;
    height: 60px;
    padding: 5px;
  }
  .condition-visual span {
    font-size: 18px;
  }
  .condition-link {
    margin-top: 10px;
  }
  #event-panel {
    padding: 14px 0;
  }
  .event-copy {
    padding: 0;
  }
  .event-record {
    padding: 10px;
    margin-top: 12px;
  }
  #flow-panel {
    display: grid;
    grid-template-columns: 1fr;
  }
  #flow-panel > div,
  #issue-panel > div {
    padding: 12px;
  }
  #flow-panel h3,
  #issue-panel h3 {
    font-size: 21px;
    margin: 8px 0;
  }
  #flow-panel p,
  #issue-panel p {
    font-size: 15px;
    line-height: 1.3;
    margin-top: 8px;
  }
  #issue-panel {
    display: block;
  }
  .source-trail {
    display: none;
  }
  .feedback-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .feedback-source,
  .feedback-action,
  .twin-record {
    padding: 10px;
  }
  .feedback-stage h3 {
    font-size: 18px;
    margin: 4px 0;
  }
  .feedback-stage p,
  .feedback-stage li {
    font-size: 14px;
    line-height: 1.3;
  }
  .feedback-stage ol {
    padding-left: 20px;
    margin: 6px 0 0;
  }
  .feedback-connector {
    display: none;
  }
  .life-art {
    margin-top: 0;
  }
  .life-identity {
    display: none;
  }
  .journey-control {
    padding: 10px 0;
    margin: 0;
  }
  .route-caption label {
    display: none;
  }
  .route-slider {
    margin-block: 4px;
    height: 58px;
  }
  .route-stops button {
    font-size: 12px;
    padding-inline: 1px;
  }
  .stage-story {
    padding: 14px 0;
  }
  .stage-story h2 {
    font-size: 25px;
  }
  .stage-story p {
    margin-top: 10px;
  }
  .rule-tags {
    margin-top: 10px;
  }
  .rule-tags span {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
  }
  .scene-shell {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .scene-shell .journey-scene {
    height: 100%;
  }
  .app-sidebar {
    display: none;
  }
  .app-layout {
    display: block;
  }
  .claim-workspace {
    padding: 12px;
  }
  .claim-panel {
    padding: 12px 0;
  }
  .report-evidence {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .damage-photo-static .claim-photo {
    height: 100px;
  }
  .agreement-review {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .agreement-review > div {
    padding: 0;
  }
  .agreement-review p {
    font-size: 14px;
    line-height: 1.3;
  }
  .agreement-context {
    padding: 8px;
    gap: 4px;
  }
  .claim-actions {
    flex-wrap: wrap;
  }
  .screenshot-hotspot#warning-cancel {
    left: auto;
    right: 108px;
    top: auto;
    bottom: 10px;
    width: 80px;
  }
  .screenshot-hotspot#warning-investigate {
    left: auto;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: 94px;
  }
  .draft-stage {
    padding-bottom: 60px;
    aspect-ratio: auto;
    background: #e9edf3;
  }
  .draft-stage > img {
    height: auto;
  }
  .insurer-screen .app-titlebar {
    flex-wrap: wrap;
  }
  .handover-story .story-meta {
    display: none;
  }
  .handover-panel .stage-heading {
    padding: 10px 0;
    margin-bottom: 10px;
  }
  .handover-panel .stage-heading h2 {
    font-size: 23px;
  }
  .handover-panel .stage-heading p {
    font-size: 14px;
    line-height: 1.3;
  }
  .setup-layout,
  .coverage-layout,
  .takeover-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .guide-content,
  .setup-result,
  .role-pass,
  .candidate-area {
    padding: 12px;
  }
  .guide-content h3 {
    font-size: 23px;
    margin: 10px 0;
  }
  .guide-content p,
  .setup-result p,
  .role-pass p {
    font-size: 14px;
    line-height: 1.3;
  }
  .guide-content .person-line,
  .login-cycle {
    display: none;
  }
  .action-row {
    margin-top: 10px;
    gap: 8px;
  }
  .setup-result .result-heading {
    display: none;
  }
  .billboard-reminder {
    padding: 10px;
  }
  .role-pass {
    display: none;
  }
  .candidates {
    gap: 8px;
  }
  .candidates > button {
    padding: 8px;
  }
  .candidates .person {
    display: none;
  }
  .coverage-result {
    padding: 10px;
    margin: 8px 0;
  }
  .billboard-row {
    padding: 10px;
  }
  .billboard-row small {
    display: none;
  }
  .handover-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
  }
  .handover-tools > p,
  .handover-tools > h3 {
    display: none;
  }
  .handover-tools button {
    padding: 8px;
    font-size: 14px;
  }
  .story-navigation button {
    font-size: 14px;
  }
  .story-navigation button span {
    display: none;
  }
  .access-tags span {
    background: transparent;
    border: 0;
    padding: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
.billboard-real {
  height: auto;
  margin: 0 0 12px;
  overflow: visible;
}
.billboard-screen-open {
  padding: 0;
  border: 0;
  width: 100%;
  background: transparent;
  cursor: zoom-in;
}
.billboard-screen-open img {
  width: 100%;
  height: auto;
}
.billboard-zoom {
  position: absolute;
  bottom: -15px;
  right: 10px;
}
@media (max-width: 779px) {
  .wrap {
    padding-inline: 0;
  }
  .grid-balanced {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .api-contact > *,
  .api-agreements > *,
  .api-workbench > * {
    min-width: 0;
  }
  .feedback-stage :is(.feedback-source, .feedback-action, .twin-record) {
    min-height: 0;
    gap: 5px;
  }
  .feedback-stage .reserved-copy {
    min-height: 0;
  }
  .feedback-stage .reserved-copy > span {
    font: inherit;
    margin: 0;
  }
  .feedback-stage li {
    padding: 5px 0;
  }
  .feedback-stage h3 {
    min-height: 0;
  }
  .assembly-board {
    grid-template-columns: 1fr !important;
  }
  .supplier-tree {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 5px;
  }
  .source-node {
    padding: 7px;
    border-left-width: 2px;
  }
  .source-node > span,
  .source-node b,
  .source-node small,
  .source-node .reserved-copy > span {
    font-size: 12px;
    line-height: 1.25;
  }
  .source-node small {
    margin: 2px 0 0;
  }
  .merge-lines {
    display: none;
  }
  .assembled-product {
    display: grid;
    grid-template-columns: 65px 1fr;
    gap: 3px 10px;
    padding: 8px;
  }
  .assembled-product > img {
    grid-row: 1 / 6;
    grid-column: 1;
    width: 65px;
    height: 65px;
  }
  .assembled-product > :not(img) {
    grid-column: 2;
  }
  .assembled-product .product-owner {
    display: none;
  }
  .assembled-product h3 {
    font-size: 18px;
    margin: 0;
  }
  .variant-switch {
    justify-content: center;
    margin: 0;
    gap: 6px;
  }
  .variant-switch button {
    min-height: 36px;
    padding: 5px 10px;
  }
  #product-config,
  #product-config > span {
    font-size: 13px;
    line-height: 1.2;
  }
  .assembly-recipe {
    gap: 5px;
    margin: 0;
  }
  .assembly-recipe > span {
    min-height: 0;
    padding: 2px;
    font-size: 12px;
  }
  .customer-gate {
    display: block;
    padding: 10px;
  }
  .customer-gate > span,
  .customer-gate .gate-rule {
    display: none;
  }
  .gate-symbol {
    float: left;
    width: 26px;
    height: 26px;
    font-size: 24px;
    margin: 0 8px 0 0;
  }
  .customer-gate h3 {
    font-size: 18px;
    margin: 0 0 8px;
  }
  .customer-gate p,
  .customer-gate a {
    font-size: 14px;
    line-height: 1.3;
  }
  .customer-gate .reserved-copy > span {
    font: inherit;
  }
  .customer-gate a {
    display: inline-block;
    margin-top: 8px;
  }
  .restriction-trace {
    padding: 12px;
  }
  .trace-heading {
    grid-template-columns: 1fr;
  }
  .trace-stop {
    display: none;
  }
  .trace-heading h3 {
    font-size: 19px;
  }
  .trace-heading p {
    font-size: 14px;
    line-height: 1.3;
    margin-top: 8px;
  }
  .trace-scroll {
    display: none;
  }
  .trace-caption {
    display: none;
  }
  .mobile-trace {
    display: grid;
    gap: 0;
    list-style: none;
    padding: 0 0 0 12px;
    margin: 14px 0 0;
  }
  .mobile-trace li {
    padding: 5px 0 5px 14px;
    border-left: 3px solid #b91c35;
    font-size: 14px;
  }
  .mobile-trace b {
    color: #a22235;
  }
  .build-explanation {
    padding: 10px 0;
    font-size: 14px;
  }
  .history-comparison {
    padding: 12px 0;
    margin-top: 10px;
  }
  .draft-stage,
  .draft-status {
    min-width: 0;
  }
  .draft-section {
    overflow: visible;
  }
  .handover-tools .person-line {
    display: none;
  }
  .handover-tools .tool-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
  }
  .handover-tools .tool-buttons button {
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    font-size: 13px;
  }
  .handover-panel .action-row {
    flex-direction: row;
    align-items: center;
  }
  .handover-panel .action-row button {
    font-size: 14px;
    padding: 10px;
  }
  .billboard-row {
    min-height: 0;
  }
  .handover-panel .stage-heading p {
    margin-top: 6px;
  }
  .coverage-result {
    min-height: 0;
  }
  .coverage-result li {
    padding: 2px 0;
    font-size: 14px;
  }
}
.mobile-trace {
  display: none;
}
@media (max-width: 779px) {
  .mobile-trace {
    display: grid;
  }
}
.insurance-warning-live {
  position: absolute;
  right: 4%;
  top: 34%;
  width: 430px;
  max-width: 90%;
  background: white;
  color: #15263d;
  padding: 20px;
  box-shadow: 0 8px 28px #0005;
  border: 1px solid #8c99a8;
  border-top: 5px solid #e9a21a;
  border-radius: 5px;
}
.insurance-warning-live h3 {
  font:
    bold 21px/1.2 Arial,
    sans-serif;
}
.insurance-warning-live p {
  margin: 10px 0;
  font:
    16px/1.4 Arial,
    sans-serif;
}
.insurance-warning-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.insurance-warning-live .screenshot-hotspot {
  position: static !important;
  width: auto !important;
  min-width: 80px;
  min-height: 44px;
  padding: 8px 12px;
}
.draft-stage.warning-dismissed .insurance-warning-live {
  visibility: hidden;
}
@media (max-width: 779px) {
  .draft-stage {
    padding-bottom: 0;
  }
  .insurance-warning-live {
    position: static;
    width: 100%;
    max-width: none;
    padding: 14px;
    box-shadow: none;
    border-radius: 0;
  }
  .draft-stage > img {
    width: 100%;
  }
}
/* Compact dialogue panels remain legible at mobile and tablet widths. */
.misunderstanding {
  gap: 16px;
  padding: 16px 0;
}
.conversation blockquote {
  padding: 10px 14px;
  font-size: 20px;
}
.dispute-visual {
  padding: 16px;
}
.dispute-values strong {
  font-size: 28px;
}
.agreement-answer {
  padding: 14px;
  gap: 18px;
}
.agreement-answer p {
  font-size: 15px;
  line-height: 1.35;
}
@media (max-width: 779px) {
  .misunderstanding {
    gap: 8px;
    padding: 8px 0;
  }
  .conversation blockquote {
    font-size: 16px;
    padding: 8px;
  }
  .dispute-visual {
    padding: 10px;
  }
  .dispute-values strong {
    font-size: 22px;
  }
  .dispute-visual h3 {
    font-size: 18px;
  }
  .agreement-answer h4 br {
    display: initial;
  }
  .guide-content p {
    margin-bottom: 8px;
  }
  .handover-panel .window-title {
    padding: 8px 12px;
  }
  .handover-panel .stage-heading p {
    display: none;
  }
  .handover-tools .tool-buttons {
    width: 100%;
  }
  .handover-panel .role-confirmation {
    margin: 8px 0;
    font-size: 14px;
  }
  .handover-panel .setup-layout {
    gap: 8px;
  }
  .handover-tools .tool-buttons button {
    line-height: 1.2;
  }
  .source-views {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .source-views > div {
    min-width: 0;
    font-size: 12px;
    text-align: center;
  }
  .source-views > div .helmet-photo {
    width: 100%;
    height: 44px;
  }
  .gallery-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
  }
  .gallery-thumbnails > button {
    flex: 1;
    min-width: 0;
  }
  .gallery-thumbnails small {
    font-size: 11px;
  }
  .gallery-tools {
    gap: 5px;
  }
  .gallery-tools button {
    font-size: 14px;
    padding: 8px;
  }
  .product-stage {
    min-height: 0;
    height: 290px;
  }
  .source-documents {
    min-width: 0;
  }
}
.handover-panel {
  align-self: start;
}
.handover-panel .stage-heading {
  margin: 12px 0 16px;
}
.handover-panel .role-pass {
  padding: 16px;
}
.handover-panel .role-pass h3 {
  font-size: 26px;
}
.handover-panel .role-rule {
  padding: 10px 0;
}
.handover-panel .candidate-area {
  padding: 14px;
}
.handover-panel .candidate-area h3 {
  font-size: 22px;
  margin-bottom: 12px;
}
.handover-panel .coverage-result h4 {
  margin: 8px 0;
  font-size: 18px;
}
.handover-panel .coverage-result ul {
  margin: 6px 0;
}
@media (max-width: 779px) {
  .handover-story {
    font-size: 15px;
    line-height: 1.35;
  }
  .handover-panel .stage-heading {
    margin: 4px 0 8px;
  }
  .handover-panel .stage-heading h2 {
    font-size: 21px;
  }
  .handover-panel .candidate-area {
    padding: 10px;
  }
  .handover-panel .candidate-area h3 {
    font-size: 20px;
    margin-bottom: 10px;
  }
  .handover-panel .billboard-row {
    font-size: 14px;
    line-height: 1.3;
    gap: 4px;
    padding: 9px 10px;
  }
  .handover-panel .billboard-row b span {
    font-size: 20px;
  }
  .handover-panel .billboard-row strong {
    font-size: 14px;
  }
  .handover-panel .coverage-result {
    padding: 5px;
    margin: 6px 0;
  }
  .handover-panel .coverage-result h4 {
    margin: 4px 0;
  }
  .handover-panel .candidates button {
    gap: 5px;
  }
  .handover-panel #assign-role {
    font-size: 14px;
    padding: 10px;
  }
  .handover-panel .role-confirmation {
    min-height: 0;
  }
  .coverage-route {
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr);
    gap: 5px;
  }
  .coverage-route > div {
    min-width: 0;
  }
  .coverage-route b {
    font-size: 14px;
  }
  .coverage-route span:not(.route-link) {
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .knowledge-matrix {
    width: 100%;
    table-layout: fixed;
  }
  .knowledge-matrix td,
  .knowledge-matrix th {
    overflow-wrap: anywhere;
    padding: 8px;
  }
  .navigation-menu {
    min-width: 0;
    width: min(265px, calc(100vw - 40px));
  }
}
@media (max-width: 359px) {
  main h1 {
    font-size: 36px !important;
  }
  .chain-heading h2,
  .edi-pilot h2,
  .edi-opening h1 {
    font-size: 30px;
  }
  .agreement-answer {
    padding: 10px;
  }
  .agreement-answer p {
    font-size: 14px;
  }
  #flow-panel > div {
    padding: 10px;
  }
  #flow-panel p {
    margin-top: 6px;
  }
}
/* Manufacturer media are plain thumbnails, not duplicate remote controls. */
.source-views > div {
  min-width: 0;
  text-align: center;
}
.source-views > div .helmet-photo {
  display: block;
  height: 75px;
}
.source-views > div small {
  font-size: 12px;
}
.handover-story .billboard-row {
  padding: 12px 16px;
  gap: 5px;
  font-size: 15px;
  line-height: 1.35;
}
.handover-story .billboard-row b span {
  font-size: 22px;
}
.handover-story .handover-tools {
  padding: 16px;
}
.handover-story .handover-tools h3 {
  font-size: 25px;
}
.handover-story .tool-buttons button {
  padding: 10px;
  font-size: 15px;
}
.draft-images {
  position: relative;
  aspect-ratio: 1251 / 880;
}
.draft-images > img {
  width: 100%;
  height: auto;
}
.draft-images #issue-mask {
  display: block;
}
.attachment-name {
  display: block;
  padding: 8px 0;
  font-size: 14px;
}
.journey-record-count {
  font-weight: 700;
  color: #144bdd;
}
#document-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 20px;
}
#document-dialog form {
  text-align: right;
  margin-bottom: 14px;
}
.document-close {
  min-height: 44px;
  border: 1px solid #91a8ca;
  background: #edf3ff;
  padding: 8px 12px;
}
@media (max-width: 779px) {
  .handover-story .handover-tools {
    padding: 0;
  }
  .handover-story .billboard-row {
    font-size: 14px;
    padding: 9px 10px;
  }
  .handover-story .tool-buttons button {
    font-size: 13px;
    padding: 8px 4px;
  }
  .draft-stage {
    aspect-ratio: auto;
  }
  .fishbone-scroll {
    overflow: visible;
  }
  .fishbone {
    min-width: 0;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
    padding: 14px;
    position: relative;
  }
  .fish-connections,
  .fish-merge,
  .fish-return-label {
    display: none;
  }
  .fish-node,
  .fish-node.main-node {
    position: relative;
    inset: auto;
    transform: none;
    width: auto;
    min-width: 0;
  }
  .fish-node.main-node {
    grid-column: 2;
    background: white;
  }
  .fish-node.main-node::after {
    content: '↓';
    position: absolute;
    bottom: -22px;
    left: 45%;
    color: #144bdd;
    font-size: 22px;
  }
  .fish-node[data-chain-node='3']::after {
    display: none;
  }
  .fish-node.branch-node::after {
    content: '→';
    position: absolute;
    right: -15px;
    top: 50%;
    color: #144bdd;
  }
  .fish-node[data-chain-node='0'] {
    grid-row: 1 / 4;
    align-self: center;
  }
  .fish-node[data-chain-node='1'] {
    grid-row: 4 / 6;
    align-self: center;
  }
  .fish-node[data-chain-node='2'] {
    grid-row: 6;
  }
  .fish-node[data-chain-node='3'] {
    grid-row: 7;
  }
  .fish-node.branch-node {
    grid-column: 1;
  }
  .fish-node[data-chain-node='4'] {
    grid-row: 1;
  }
  .fish-node[data-chain-node='5'] {
    grid-row: 2;
  }
  .fish-node[data-chain-node='6'] {
    grid-row: 3;
  }
  .fish-node[data-chain-node='7'] {
    grid-row: 4;
  }
  .fish-node[data-chain-node='8'] {
    grid-row: 5;
  }
  .fish-node[data-chain-node='9'] {
    grid-row: 6;
  }
  .fish-node[data-chain-node='10'] {
    grid-row: 7;
  }
  .fish-node b {
    font-size: 14px;
  }
  .fish-node > span {
    font-size: 12px;
  }
  .fish-thumb {
    height: 45px;
  }
  .configuration-unit .history-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }
  .configuration-unit .history-link {
    display: none;
  }
  .configuration-unit .history-comparison > div {
    padding: 0;
  }
  .configuration-unit .history-comparison b {
    font-size: 15px;
  }
  .configuration-unit .history-comparison p,
  .configuration-unit .history-comparison span {
    font-size: 12px;
    line-height: 1.3;
  }
  .configuration-unit .history-comparison > p {
    grid-column: 1 / -1;
  }
  .configuration-unit .build-explanation {
    font-size: 13px;
    line-height: 1.3;
    padding: 8px 0;
  }
}
.story-meta {
  display: none;
}
.handover-story .story-navigation {
  padding-block: 4px;
}
@media (max-width: 779px) {
  .configuration-unit .build-explanation {
    display: none;
  }
}
