/* V5 Stage A: shared semantic role and measure owner, scoped to eight opt-ins.
   V4 Selection, destination IA, card edges, colors and existing handlers remain. */
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] {
  min-width: 0;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] > [data-v5-role] {
  min-width: 0;
  grid-column: 1 / -1;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] [data-v5-measure="execution"],
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] [data-v5-measure="execution"] :is(p,ul,ol),
.visual-v4 .consumer-detail[data-v5-grammar-detail] [data-v5-measure="execution"] :is(p,ul,ol) {
  max-width: none;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] [data-v5-measure="reading"] :is(p,ul,ol),
.visual-v4 .consumer-detail[data-v5-grammar-detail] :is(.consumer-detail-facts,.secondary-content) :is(p,ul,ol) {
  max-width: 66ch;
}
/* Legacy 42rem list-item and 54rem handoff rails left empty desktop space.
   Short execution conditions may use the card; long Detail reading retains 66ch. */
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] :is(.simple-supporting-facts,.timed-supporting-facts,.choice-supporting-facts,.complex-supporting-facts,.migration-supporting-facts) {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  width: 100%;
  max-width: none;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] :is(.simple-supporting-facts,.timed-supporting-facts,.choice-supporting-facts,.complex-supporting-facts,.migration-supporting-facts) > li,
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] :is(.complex-primary-action,.complex-execution-handoff,.execution-action-help,.frontstage-core-price > small) {
  max-width: none;
  min-width: 0;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] [data-v5-task-role="primary-current"] {
  margin-top: 8px;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] [data-v5-task-role="next-arrival"] {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--vs-border, #dfe5df);
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] [data-v5-action-role="backup"] {
  border-top: 1px solid var(--vs-border, #dfe5df);
  padding-top: 10px;
  color: var(--vs-secondary, #526158);
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .v5-backup-label {
  font-size: .8rem;
  font-weight: 650;
  color: var(--vs-secondary, #526158);
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] [data-v5-action-role="primary"] > p {
  margin: 5px 0 0;
  max-width: none;
  color: var(--vs-secondary, #526158);
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .v5-contextual-date {
  justify-self: start;
  max-width: 100%;
  min-height: 44px;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .consumer-action-row {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  justify-items: start;
  gap: 8px;
  max-width: none;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .consumer-action-row > *,
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] :is(.phase4-external-handoff,.phase4-search-handoff,.complex-execution-handoff,.migration-primary-action) {
  min-width: 0;
  max-width: none;
  width: 100%;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .phase4-search-handoff {
  grid-template-columns: minmax(0,1fr) auto;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] a[href] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] :is(.choice-frontstage-options,.complex-path-options,.presentation-choice-options) {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr));
}
.visual-v4 .consumer-detail[data-v5-grammar-detail] {
  min-width: 0;
}
.visual-v4 .consumer-detail[data-v5-grammar-detail] :is(.consumer-detail-primary,.detail-hero) {
  max-width: none;
}
@media (max-width: 767px) {
  .visual-v4 .ia-destination-section .execution-card[data-v5-grammar] :is(.choice-frontstage-options,.complex-path-options,.presentation-choice-options),
  .visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .phase4-search-handoff {
    grid-template-columns: minmax(0,1fr);
  }
  .visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .consumer-action-row > * {
    max-width: 100%;
  }
}

/* Stage B shared mobile Detail repair: existing secondary links must wrap. */
@media (max-width: 767px) {
  .visual-v4 .consumer-detail[data-v5-grammar-detail] .secondary-execution-path { grid-template-columns: minmax(0,1fr); }
  .visual-v4 .consumer-detail[data-v5-grammar-detail] .secondary-execution-path > * { min-width: 0; overflow-wrap: anywhere; }
}
/* Existing source-owned primary Copy and backup link use approved action tokens. */
.visual-v4 .execution-card[data-v5-grammar] [data-v5-action-role="primary"] .execution-action-main > button[data-copy-text]:not([data-copy-presentation="compact"]) { min-height: 44px; padding: 10px 16px; background: var(--vs-action); color: #fff; border-color: var(--vs-action); font-size: 1rem; font-weight: 600; }
.visual-v4 .execution-card[data-v5-grammar] [data-v5-action-role="backup"] .phase4-primary-link { background: transparent; border: 1px solid var(--vs-border); color: var(--vs-action); }

/* A four-option Choice may use at most two columns, and only while each
   column retains the existing 240px minimum. This is container-width based. */
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] :is(.choice-frontstage-options,.complex-path-options,.presentation-choice-options).visual-choice-count-4 {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,max(240px,calc((100% - 12px)/2))),1fr));
}

/* An explicit action role owns the actual control, including Copy. The
   legacy visual-primary-copy class cannot re-promote backup/arrival copies. */
.visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) [data-v5-action-role="primary"] :is(button[data-copy-text]:not([data-copy-presentation="compact"]),a[href]) {
  min-height: 44px;
  padding: 10px 16px;
  background: var(--vs-action);
  border: 1px solid var(--vs-action);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: normal;
}
.visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) :is([data-v5-action-role="backup"],[data-v5-action-role="arrival-utility"],[data-v5-action-role="reference"]) :is(button[data-copy-text]:not([data-copy-presentation="compact"]),a[href]) {
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--vs-border);
  border-radius: 10px;
  color: var(--vs-action);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  white-space: normal;
}

/* S1: source-owned copy and booking controls use their existing mature roles. */
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] .consumer-action-row > :is(a.phase4-primary-link,.phase4-external-handoff) { width:auto; max-width:100%; }
.visual-v4 :is(.execution-card,.consumer-detail) [data-copy-presentation="compact"] { max-width:100%; min-width:0; }
.visual-v4 :is(.execution-card,.consumer-detail) button[data-copy-presentation="compact"] { background:transparent; color:var(--vs-action); border:0; border-radius:0; padding:8px 0; min-width:44px; min-height:44px; font-size:1rem; font-weight:400; text-decoration:underline; text-underline-offset:3px; width:auto; justify-self:start; }
.visual-v4 :is(.execution-card,.consumer-detail) .consumer-price-status { margin:4px 0; font-size:1rem; font-weight:400; color:var(--vs-secondary); text-transform:none; }

/* Keep legacy nested nodes for source-owned copy value corrections. */
@media(min-width:768px){
 .visual-v4 .secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main { display:contents; }
 .visual-v4 .secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main > span { grid-column:1;grid-row:1; }
 .visual-v4 .secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main > strong { grid-column:2;grid-row:1; }
 .visual-v4 .secondary-execution-path[data-copy-presentation="compact"] > .execution-action-help { grid-column:3;grid-row:1;margin:0; }
 .visual-v4 .secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main > button { grid-column:4;grid-row:1; }
}
@media(max-width:767px){
 .visual-v4 .secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main {display:grid;grid-template-columns:minmax(0,1fr);gap:4px;}
 .visual-v4 .secondary-execution-path[data-copy-presentation="compact"] > .execution-action-help {margin:0;}
}


/* Copy layout: mature name/condition/last Copy row, preserving nested legacy selectors. */
@media(min-width:768px){
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"],
 .visual-v4 #detail-dialog[data-ui-v4-canary] .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] {display:grid;grid-template-columns:auto minmax(110px,auto) minmax(220px,1fr) auto;gap:7px 12px;align-items:baseline;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main {display:contents;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main > span {grid-column:1;grid-row:1;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main > strong {grid-column:2;grid-row:1;min-width:0;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] > .execution-action-help {grid-column:3;grid-row:1;min-width:0;margin:0;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main > button {grid-column:4;grid-row:1;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-layout="value-row"] {grid-template-columns:auto minmax(110px,1fr) auto;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-layout="value-row"] > .execution-action-main > button {grid-column:3;}
 .visual-v4 .execution-card[data-v5-grammar] .simple-execution-handoff.secondary-execution-path[data-copy-layout="map-name"] {grid-template-columns:minmax(0,1fr) auto;width:fit-content;gap:12px;}
 .visual-v4 .execution-card[data-v5-grammar] .simple-execution-handoff.secondary-execution-path[data-copy-layout="map-name"] > .execution-action-main > strong {grid-column:1;}
 .visual-v4 .execution-card[data-v5-grammar] .simple-execution-handoff.secondary-execution-path[data-copy-layout="map-name"] > .execution-action-main > button {grid-column:2;}
}
@media(max-width:767px){
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] {display:grid;grid-template-columns:minmax(0,1fr);gap:4px;align-items:start;}
 .visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"] > .execution-action-main {display:flex;flex-wrap:wrap;gap:8px 10px;align-items:baseline;}
}
.visual-v4 :is(.execution-card,.consumer-detail) [data-repair-yalong-product] {max-width:100%;min-width:0;}
.visual-v4 .consumer-background-sources li {margin:3px 0;}
.visual-v4 .consumer-background-sources a,.visual-v4 .consumer-source-reference a {background:transparent;border:0;padding:0;font-weight:400;text-decoration:underline;}


.visual-v4 .execution-card[data-v5-grammar] [data-repair-yalong-product] a.phase4-primary-link {display:inline-flex;width:auto;max-width:100%;justify-self:start;}

/* Long labels in the existing compact copy row must stay inside their track. */
.visual-v4 :is(.execution-card[data-v5-grammar],.consumer-detail[data-v5-grammar-detail]) .simple-execution-handoff[data-copy-presentation="compact"] > .execution-action-main > :is(span,strong) {
 min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;
}
/* L03: execution facts inherit the card measure, overriding V4's logical
   760px reading rail. Long secondary Detail prose keeps its reading measure. */
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar][data-ui-v4-canary] .migration-supporting-facts[data-v5-measure="execution"] {
 max-inline-size:none;
}

/* Internal date recovery only: retain the existing primary/outlined hierarchy. */
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] button.consumer-recovery-cta,
.consumer-detail button.consumer-recovery-cta {
  width: auto;
  max-width: 100%;
  min-height: 44px;
  justify-self: start;
  align-self: start;
  white-space: normal;
  overflow-wrap: anywhere;
}
.visual-v4 .ia-destination-section .execution-card[data-v5-grammar] button.primary-button.consumer-recovery-cta,
.consumer-detail button.primary-button.consumer-recovery-cta {
  border-radius: 10px;
}

/* Clarity: plain adjacent channel text and existing copy controls. */
.frontstage-core-price > .mc7-onsite-label { font-size:14px; font-weight:600; color:var(--vs-text,#204233); flex:0 0 auto; }
.mc7-map-address { font-size:12px; font-weight:400; color:var(--vs-secondary,#526158); }
.mc7-map-copy { min-height:44px; min-width:44px; }

/* Clarity map rows: keep the map label and Copy readable; retain arrival help below. */
@media(min-width:768px){
.visual-v4 .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"]:has(.mc7-map-copy) {grid-template-columns:auto minmax(110px,1fr) auto !important;}
.visual-v4 .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"]:has(.mc7-map-copy) > .execution-action-main > span {white-space:nowrap;}
.visual-v4 .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"]:has(.mc7-map-copy) > .execution-action-main > .mc7-map-copy {grid-column:3 !important;grid-row:1;white-space:nowrap;}
.visual-v4 .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"]:has(.mc7-map-copy) > .execution-action-main > .mc7-map-address {grid-column:2;grid-row:2;}
.visual-v4 .simple-execution-handoff.secondary-execution-path[data-copy-presentation="compact"]:has(.mc7-map-copy) > .execution-action-help {grid-column:1 / -1 !important;grid-row:auto !important;}
}
