/* Refinements from the September 2026 visual review. Keep this stylesheet last
   so the screen and A4 print layouts share the same final component tuning. */

@media screen and (min-width: 901px), print {
  /* Center the copy vertically in the oversized narrative bands. */
  .hero-band {
    align-items: center;
  }

  .hero-band > div:first-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  .hero-band h3 {
    margin: 0;
    line-height: 1.3;
  }

  .hero-band p {
    max-width: 560px;
    line-height: 1.6;
  }

  .hero-mark {
    align-self: center;
    line-height: 1;
  }

  /* Lifecycle gate: improve the two decision choices without crowding them. */
  #lifecycle .grid-2 > .panel h3 {
    font-size: 15px;
    line-height: 1.3;
  }

  #lifecycle .grid-2 > .panel .list li {
    font-size: 12px;
    line-height: 1.5;
  }

  #lifecycle .decision {
    grid-template-columns: minmax(90px, .72fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
  }

  #lifecycle .decision-label {
    justify-content: center;
    padding: 10px 8px;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
  }

  #lifecycle .decision-path {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px;
  }

  #lifecycle .decision-path b {
    margin-bottom: 5px;
    font-size: 11px;
    line-height: 1.35;
  }

  #lifecycle .decision-path small {
    font-size: 10px;
    line-height: 1.5;
  }

  #lifecycle .decision + .note {
    font-size: 10.5px;
    line-height: 1.5;
  }

  /* Cable production lanes: increase step readability while keeping all six
     process steps on a single, evenly aligned row. */
  #cable-flow .lane-wrap {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  #cable-flow .lane-name {
    display: flex;
    align-items: center;
    padding-top: 0;
    font-size: 10px;
  }

  #cable-flow .lane {
    gap: 5px;
  }

  #cable-flow .lane-step {
    display: grid;
    place-items: center;
    min-height: 58px;
    padding: 8px 5px;
    font-size: 10px;
    line-height: 1.4;
  }

  /* Stretch each industry prototype to its companion knowledge column; use
     the added height to give fields, evidence rows, and gate summary breathing
     room instead of leaving a blank lower half. */
  .page:not(.cover):not(#back-cover) .industry-proto {
    align-items: stretch;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-screen {
    display: flex;
    align-self: stretch;
    min-height: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-title {
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.35;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .status {
    padding: 3px 7px;
    font-size: 10px;
    line-height: 1.3;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-field-grid {
    gap: 8px;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-field {
    min-height: 50px;
    padding: 8px;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-field label {
    font-size: 10px;
    line-height: 1.3;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-field b {
    font-size: 11.5px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-table {
    margin-top: 0;
    font-size: 10.5px;
    line-height: 1.4;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-table th,
  .page:not(.cover):not(#back-cover) .industry-proto .proto-table td {
    padding: 8px 6px;
  }

  .page:not(.cover):not(#back-cover) .industry-proto .proto-screen::after {
    margin-top: 0;
    padding: 10px 11px;
    font-size: 10.5px;
    line-height: 1.5;
  }

  /* Final-page contact cards: keep the QR codes generous and labels explicit. */
  #back-cover .back-contact-heading {
    margin-bottom: 3mm;
  }

  #back-cover .back-contact-heading strong {
    font-size: 13px;
  }

  #back-cover .back-contact-heading span {
    font-size: 10px;
  }

  #back-cover .back-contact-card {
    min-height: 55mm;
    gap: 5px;
    padding: 7px 6px;
  }

  #back-cover .back-contact-card strong {
    font-size: 11px;
  }

  #back-cover .back-contact-card img {
    width: 33mm;
    height: 33mm;
  }

  #back-cover .back-contact-card small {
    font-size: 9px;
  }
}


/* Keep the handbook's floating navigation in the outer gutter on wide screens;
   let it return to normal document flow when that gutter is too narrow. */
@media screen and (min-width: 1140px) {
  .screen-toolbar {
    top: 50%;
    left: calc(50% + 105mm + 12px);
    right: auto;
    width: 140px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 7px;
    border-radius: 10px;
    transform: translateY(-50%);
  }

  .screen-toolbar a,
  .screen-toolbar button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 38px;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    white-space: nowrap;
  }

  .screen-toolbar .primary {
    justify-content: center;
    min-height: 42px;
    text-align: center;
  }
}

@media screen and (max-width: 1139px) {
  .screen-toolbar {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    flex-flow: row wrap;
    justify-content: center;
    transform: none;
    border-radius: 0 0 8px 8px;
  }
}

/* The sample MES navigation rails are interface details, not footnotes. */
.app-nav {
  padding: 12px 8px;
}

.app-nav .app-brand {
  gap: 6px;
  margin-bottom: 14px;
  font-size: 10px;
  line-height: 1.3;
}

.app-nav .app-mark {
  width: 21px;
  height: 21px;
  font-size: 10px;
}

.app-nav .nav-item {
  margin: 2px 0;
  padding: 7px 6px;
  font-size: 9.5px;
  line-height: 1.4;
}

.app-nav .nav-item:before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
}

.ai-center-nav-title {
  font-size: 11px;
  line-height: 1.3;
}

.ai-center-nav-title small {
  font-size: 9px;
}

.ai-center-nav-item {
  margin: 4px 0;
  padding: 8px 7px;
  font-size: 9.5px;
  line-height: 1.35;
}

@media screen and (max-width: 560px) {
  .app-nav .app-brand {
    font-size: 9px;
  }

  .app-nav .nav-item {
    padding: 6px 4px;
    font-size: 8.5px;
    line-height: 1.35;
  }
}

/* Keep the AI workbench's final evidence and summary bands clear of the folio. */
@media screen and (min-width: 901px), print {
  #ai-prototype.page:not(.cover):not(#back-cover) {
    gap: 5px;
  }

  #ai-prototype > .section-rule + .grid-2 > .panel {
    min-height: 0;
    padding: 10px;
  }

  #ai-prototype > .section-rule + .grid-2 .list {
    gap: 5px;
  }

  #ai-prototype > .note.orange {
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
  }

  #ai-prototype .case-evidence-band {
    min-height: 0;
    padding: 8px 10px;
  }

  #ai-prototype .case-evidence-head {
    margin-bottom: 5px;
  }

  #ai-prototype .case-evidence-grid {
    gap: 6px;
  }

  #ai-prototype .case-evidence-grid > div {
    min-height: 0;
    padding: 6px 7px;
  }

  #ai-prototype.page:not(.cover):not(#back-cover) .case-evidence-grid label {
    font-size: 9px;
    line-height: 1.3;
  }

  #ai-prototype.page:not(.cover):not(#back-cover) .case-evidence-grid p {
    font-size: 10.5px;
    line-height: 1.4;
  }

  #ai-prototype.page:not(.cover):not(#back-cover) > .page-endbar {
    min-height: 68px;
    padding: 8px 11px;
    font-size: 10.5px;
    line-height: 1.4;
  }

  /* Compact but still prominent three-line value statement; avoid an orphaned
     final character in the narrow quote column. */
  #delivery .quote-band {
    justify-content: center;
    padding: 18px 14px;
  }

  #delivery .quote-band p {
    font-size: 16px;
    line-height: 1.55;
  }
}
