/* CP5.4 / approved A. Scoped to Roundtrips; no login, fleet dialog or other calculator styling. */
#roundtrip-page.cp54-roundtrip{--trip-blue:#237de8;--trip-green:#219653;--trip-orange:#e58925;container-type:inline-size}
.cp54-roundtrip .workspace{display:flex;flex-direction:column;gap:16px;min-width:0}.cp54-roundtrip .workspace>.form-stack,.cp54-roundtrip .result-panel{min-width:0;width:100%}.cp54-roundtrip .result-panel{display:block}.cp54-roundtrip .card{padding:18px}.cp54-roundtrip> .calc-link{margin-bottom:16px}.cp54-roundtrip .calc-link:has(.cp54-parameters){padding:0;background:#f8fafc;border:1px solid #d9e2ed}
.cp54-parameters{display:grid;grid-template-columns:minmax(230px,1.4fr) minmax(140px,.8fr) minmax(140px,.8fr) minmax(200px,1fr);align-items:start;gap:0;position:relative}.cp54-parameters>*{min-width:0;padding:14px 18px}.cp54-parameters>.field{margin:0;grid-row:1}.cp54-parameters label,.cp54-parameters summary{font-size:13px;font-weight:600;color:#526172}.cp54-parameters .input-wrap input{padding:7px 10px;font-size:17px;font-weight:650;min-height:40px}.cp54-parameters .input-wrap{margin-top:7px}.cp54-period{grid-column:2}.cp54-fuel{grid-column:3}.cp54-fixed{grid-column:4;grid-row:1}.cp54-transport{grid-column:1;grid-row:1}.cp54-parameters summary{cursor:pointer;min-height:52px;list-style:none;display:flex;flex-direction:column;justify-content:center;gap:7px;position:relative;padding-right:20px}.cp54-parameters summary:after{content:'⌄';position:absolute;right:0;top:18px;font-size:17px}.cp54-parameters details[open]>summary:after{content:'⌃'}.cp54-vehicle-label,.cp54-fixed-value{display:block;color:#152b3e;font-size:15px;font-weight:700;overflow-wrap:break-word;line-height:1.4}.cp54-parameters .fleet-grid{grid-template-columns:1fr;gap:10px}.cp54-parameters details[open]{background:white;border-radius:10px;box-shadow:0 8px 20px #1723310c}.cp54-parameters .fleet-field,.cp54-parameters .field{min-width:0}.cp54-parameters .field{margin-top:10px}.cp54-parameters .field input{width:100%;min-width:0}.cp54-parameters .cp54-more-parameters{grid-column:1/-1;padding:4px 18px;border-top:1px solid #e1e7ef;background:transparent;box-shadow:none}.cp54-more-parameters>summary{min-height:42px;display:block;padding:10px 20px 10px 0}.cp54-shared-inputs.card{border:0;background:transparent;box-shadow:none;padding:6px 0}.cp54-shared-inputs>.fields{grid-template-columns:repeat(3,minmax(0,1fr))}.cp54-more-parameters .route-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.cp54-parameters #combo-note{font-size:12px}.cp54-parameters .business-choice{margin:12px 0}.cp54-optional{margin:10px 0;font-size:13px}
#roundtrip-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.cp54-roundtrip [data-financial-leg=outbound]{grid-column:1;grid-row:1;border-color:#bdd6f6;background:linear-gradient(180deg,#edf5ff 0,#fff 110px)}.cp54-roundtrip [data-financial-leg=return]{grid-column:2;grid-row:1;border-color:#bfe3ce;background:linear-gradient(180deg,#edf9f1 0,#fff 110px)}.cp54-roundtrip .trip-leg-card{padding:16px 18px;border-radius:12px}.cp54-roundtrip .trip-leg-heading{align-items:center;gap:8px;min-height:38px;margin-bottom:8px}.cp54-roundtrip .trip-leg-heading h3{font-size:19px}.cp54-roundtrip .trip-leg-heading>span{font-size:12px}.cp54-roundtrip [data-financial-leg=outbound] .trip-leg-select{color:#1c60b7}.cp54-roundtrip [data-financial-leg=return] .trip-leg-select{color:#22783d}.cp54-roundtrip .trip-leg-select{padding:4px 0;font-weight:700;min-height:40px}.cp54-roundtrip .trip-leg-route{display:none}.cp54-roundtrip .trip-leg-status{font-size:12px;margin:8px 0}.cp54-roundtrip .trip-leg-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:10px 0}.cp54-roundtrip .trip-leg-metrics div{min-width:0}.cp54-roundtrip .trip-leg-metrics dt{font-size:12px}.cp54-roundtrip .trip-leg-metrics dd{font-size:15px;line-height:1.45;word-break:normal;overflow-wrap:break-word}.cp54-roundtrip .trip-leg-metrics div:has(dt):nth-child(n+4){font-size:13px}.cp54-roundtrip .trip-leg-adjustments>summary{font-size:13px;min-height:42px}.cp54-roundtrip .trip-leg-adjustments .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-roundtrip .trip-leg-adjustments .input-wrap input{min-width:0;width:100%;font-size:16px}.cp54-roundtrip .trip-leg-remove{margin:10px 0 0;justify-content:flex-start}.cp54-roundtrip .trip-leg-remove button{font-size:12px;padding:8px 12px;min-height:40px}.cp54-roundtrip .trip-leg-remove .hint{font-size:12px}.cp54-roundtrip .cp54-return-empty{align-self:start}
.cp54-addresses{min-width:0}.cp54-addresses .route-stops{display:grid;gap:10px;margin:0}.cp54-addresses .route-stop{grid-template-columns:12px minmax(0,1fr) auto;padding:6px 10px;min-height:66px;gap:8px;border-radius:9px;background:var(--ui-surface,white);color:var(--ui-text,#23384c);align-items:center}.cp54-addresses .route-stop>span:empty:not(.route-stop-icon){display:none}.cp54-addresses .route-stop label{display:grid;gap:4px;min-width:0}.cp54-addresses .route-stop label b{font-size:12px;font-weight:500;color:var(--ui-muted,#5c6e81)}.cp54-addresses .route-stop input{border:0;padding:2px 0;min-height:27px;min-width:0;width:100%;background:transparent;color:var(--ui-text,#18324a);font:inherit;font-size:15px}.cp54-addresses .route-stop input::placeholder{color:var(--ui-muted,#7a8b9e);font-size:13px}.cp54-addresses .route-stop .secondary{font-size:12px;min-height:40px;padding:6px 10px;min-width:52px;width:auto;display:block}.cp54-addresses .route-stop-icon{width:9px;height:9px;border:2px solid #74a4dc;border-radius:50%}.cp54-addresses .route-stop-icon-finish{border-radius:2px;background:#74a4dc}.cp54-addresses .route-point-results{grid-column:1/-1;display:grid;gap:8px;min-width:0}.cp54-addresses .route-point-results:empty{display:none}.cp54-addresses .route-coordinate-status{font-size:11px;color:var(--ui-positive,#29824a)}.cp54-point-proxy{display:grid;gap:4px;font-size:12px;color:var(--ui-muted,#5c6e81);padding:6px 12px;margin:0 0 10px;border:1px solid var(--ui-border,#d5dfd8);border-radius:9px;background:var(--ui-surface,white);min-height:66px}.cp54-point-proxy input{min-width:0;width:100%;padding:2px 0;min-height:27px;border:0;background:transparent;font-size:15px;color:var(--ui-text,#18324a)}.cp54-addresses #route-address-hint{font-size:12px;margin:8px 0}.cp54-addresses .route-stop:has([data-point^=via]){background:var(--ui-raised,#f7f9fc)}.cp54-leg-prices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}.cp54-leg-prices .field{margin:0;min-width:0}.cp54-leg-prices label{font-size:12px;min-height:32px;display:flex;align-items:center;margin:0 0 4px}.cp54-leg-prices input{font-size:16px;font-weight:650;width:100%;min-width:0;padding:8px}.cp54-leg-prices .input-wrap{min-width:0}.cp54-leg-prices .input-wrap>span{display:none}.cp54-leg-actions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}.cp54-leg-actions button{font-size:12px;min-height:40px;padding:8px 12px}.cp54-leg-actions [data-route=enable]{display:none}.cp54-build{font-size:13px;margin:6px 0}.cp54-roundtrip .cp54-deadhead{grid-row:2;grid-column:1/-1;border-left:4px solid var(--trip-orange);display:grid;grid-template-columns:minmax(180px,.8fr) minmax(0,2fr) auto;gap:0 16px;align-items:center;padding:10px 18px}.cp54-deadhead .trip-leg-heading{margin:0}.cp54-deadhead .trip-leg-heading h3{font-size:15px}.cp54-deadhead .trip-leg-heading>span{display:none}.cp54-deadhead .trip-leg-metrics{margin:5px 0}.cp54-deadhead .trip-leg-status{margin:0}.cp54-deadhead .deadhead-adjustments{font-size:13px;min-width:0}.cp54-deadhead .deadhead-adjustments[open]{grid-column:1/-1}.cp54-deadhead>.hint,.cp54-deadhead>.error{grid-column:1/-1}.cp54-deadhead .deadhead-adjustments .route-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.cp54-deadhead .trip-leg-route{display:block;font-size:14px;margin:0 0 5px}.cp54-deadhead .trip-leg-metrics dd{font-size:14px}.cp54-deadhead .trip-period-note{font-size:12px}.cp54-roundtrip #operator-fields{grid-column:1/-1}
.cp54-roundtrip #route-panel{width:100%;margin:0;padding:18px;border-radius:12px}.cp54-map-card>.combo-heading{margin:0 0 10px}.cp54-map-card>.combo-heading h2{font-size:20px}.cp54-map-card .route-tabs{display:flex;gap:6px;margin:8px 0 12px;flex-wrap:wrap}.cp54-map-card .route-tabs button{flex:1 1 110px;min-width:0;font-size:13px;min-height:42px;padding:8px 12px;border-radius:8px;background:#f6f8fb;border-color:#d5e0eb;color:#3d5067}.cp54-map-card .route-tabs button[aria-pressed=true]{background:#1b2d3d;border-color:#1b2d3d;color:white}.cp54-map-card #route-map{height:330px;border-radius:10px}.cp54-map-legend{display:flex;flex-wrap:wrap;gap:18px;font-size:12px;margin:10px 0}.cp54-map-legend span{display:flex;gap:7px;align-items:center}.cp54-map-legend span:before{content:'';width:18px;height:4px;background:var(--trip-blue);border-radius:5px}.cp54-map-legend [data-color=deadhead]:before{background:var(--trip-orange)}.cp54-map-legend [data-color=return]:before{background:var(--trip-green)}.cp54-map-card>.cp54-route-options{margin-top:10px;font-size:13px;border-top:1px solid #e0e7ee}.cp54-route-options summary,.cp54-toll-editor>summary,.cp54-cost-details>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:10px;color:#3b5266;font-weight:600;font-size:13px}.cp54-route-options>summary:before,.cp54-toll-editor>summary:before,.cp54-cost-details>summary:before{content:'+';font-size:18px;color:#698097}.cp54-route-options[open]>summary:before,.cp54-toll-editor[open]>summary:before,.cp54-cost-details[open]>summary:before{content:'−'}.cp54-route-bottom{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;margin-top:12px}.cp54-toll-summary,.cp54-route-overview{padding:16px;border:1px solid #dbe3ec;border-radius:10px;min-width:0;background:#fafcff}.cp54-section-title{display:flex;gap:12px;justify-content:space-between;align-items:center;flex-wrap:wrap}.cp54-roundtrip #route-panel .cp54-section-title h3,.cp54-roundtrip #route-panel .cp54-route-overview h3{margin:0;font-size:16px}.cp54-section-title button{font-size:12px;min-height:40px;padding:7px 12px}.cp54-pricing-status{font-size:12px;color:#52697f;margin:8px 0}.cp54-country{display:grid;grid-template-columns:minmax(0,1fr) minmax(88px,auto) minmax(74px,auto);gap:10px 12px;align-items:center;padding:8px 0;border-bottom:1px solid #dde5ee;font-size:14px;line-height:1.45}.cp54-country span{min-width:0}.cp54-country>strong{text-align:right;margin-left:0;white-space:nowrap;font-variant-numeric:tabular-nums}.cp54-country>button{justify-self:end}.cp54-country small{display:block;font-size:12px;color:#687b8d}.cp54-country-total{border:0;font-weight:700}.cp54-country-total>b{font-weight:700}.cp54-country-action-spacer{display:block;min-width:1px}.cp54-map-card .route-primary-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin:0 0 14px}.cp54-route-overview dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0}.cp54-route-overview dt{font-size:13px;color:#52697f}.cp54-route-overview dd{font-size:20px;font-weight:700;margin:6px 0;overflow-wrap:break-word}.cp54-route-bottom .hint{font-size:12px;line-height:1.6}.cp54-toll-editor{padding:4px 0;margin-top:10px;border-top:1px solid #e0e7ee}.cp54-toll-editor #route-result{padding-top:12px}.cp54-toll-editor .route-country-editor{border:1px solid #dae3ec;border-radius:10px;padding:12px;margin:12px 0}.cp54-toll-editor .route-toll-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:12px 0;font-size:14px}.cp54-toll-editor .route-toll-row>div{grid-column:1/-1}.cp54-toll-editor .route-toll-row>label{display:grid;gap:7px;align-content:start;min-width:0;font-size:13px;line-height:1.5}.cp54-toll-editor .route-toll-row>label:has([type=checkbox]){display:flex;align-items:center;gap:8px}.cp54-toll-editor .route-toll-row input:not([type=checkbox]),.cp54-toll-editor .route-toll-row select{min-height:44px}.cp54-toll-editor .route-toll-row input[type=checkbox]{width:20px;height:20px;flex-shrink:0}.cp54-toll-editor .route-tolls>summary{display:none}.cp54-toll-editor .route-price-line{font-size:14px}.cp54-roundtrip #roundtrip-calculate{font-size:13px;min-height:42px;width:auto;display:none}.cp54-roundtrip #roundtrip-error:not([hidden]){margin:12px 0}
.cp54-roundtrip .profit-summary{position:static!important;top:auto;padding:22px;border-radius:12px;display:grid;grid-template-columns:minmax(0,1.6fr) minmax(250px,1fr);gap:16px;color:#fff;box-shadow:none}.cp54-profit-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;align-items:start}.cp54-profit-grid>div{min-width:0}.cp54-profit-grid span,.cp54-profit-grid .summary-kicker{color:#b8c7d7;font-size:13px;font-weight:500;letter-spacing:normal;text-transform:none;display:block;margin:0 0 8px}.cp54-profit-grid strong,.cp54-profit-grid .big-number{font-size:24px;font-weight:700;line-height:1.3;display:block;margin:0;font-variant-numeric:tabular-nums;overflow-wrap:break-word;word-break:normal;letter-spacing:-.02em}.cp54-profit-grid .big-number{color:#78df64}.cp54-profit-grid .margin{color:#fff;border:0;border-radius:0;background:transparent;padding:0;margin:0;font-size:23px;line-height:1.35}.cp54-financial-secondary{grid-column:1/-1;display:flex;gap:22px;border:0;margin:0;padding:0;font-size:12px}.cp54-financial-secondary>div{display:flex;align-items:center;gap:8px}.cp54-financial-secondary strong{font-size:14px}.cp54-cost-chart{grid-column:2;grid-row:1;display:grid;grid-template-columns:94px minmax(0,1fr);gap:14px;align-items:center}.cp54-cost-ring{width:94px;height:94px;border-radius:50%;position:relative}.cp54-cost-ring:after{content:'';position:absolute;inset:21px;border-radius:50%;background:#14212d}.cp54-cost-legend{display:grid;gap:5px;font-size:11px;color:#e4eaf0}.cp54-cost-legend>div{display:grid;grid-template-columns:8px minmax(0,1fr) auto;gap:7px;align-items:baseline}.cp54-cost-legend i{width:7px;height:7px;display:block;border-radius:50%}.cp54-cost-legend b{white-space:nowrap;font-weight:500}.cp54-profit-value #roundtrip-toll-estimate-note{color:#f3c8a6;font-size:12px;font-weight:400;line-height:1.5}.cp54-cost-details{margin-top:8px}.cp54-cost-details .cost-card{box-shadow:none}.cp54-roundtrip #roundtrip-note{font-size:12px;line-height:1.65}.cp54-roundtrip :focus-visible{outline:3px solid #f3a062;outline-offset:3px}.cp54-roundtrip button{cursor:pointer}.cp54-roundtrip button:disabled{cursor:not-allowed;opacity:.5}.cp54-roundtrip [hidden]{display:none!important}.cp54-roundtrip .input-wrap{min-width:0}.cp54-roundtrip input,.cp54-roundtrip select{max-width:100%}
@container(max-width:1100px){.cp54-parameters{grid-template-columns:minmax(200px,1.4fr) minmax(120px,.8fr) minmax(120px,.8fr) minmax(170px,1fr)}.cp54-parameters>*{padding:12px}.cp54-roundtrip .profit-summary{grid-template-columns:1fr}.cp54-cost-chart{grid-column:1;grid-row:auto;grid-template-columns:80px minmax(0,1fr)}.cp54-cost-ring{width:80px;height:80px}.cp54-cost-ring:after{inset:18px}.cp54-cost-legend{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 20px}.cp54-roundtrip .trip-leg-card{padding:14px}.cp54-leg-prices{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-leg-prices .field:last-child{grid-column:1/-1}.cp54-leg-prices label{min-height:22px}.cp54-parameters .cp54-more-parameters{padding:4px 12px}}
@container(max-width:850px){.cp54-parameters{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-period{grid-column:2;grid-row:1}.cp54-fuel{grid-column:1;grid-row:2}.cp54-fixed{grid-column:2;grid-row:2}.cp54-parameters .cp54-more-parameters{grid-row:3}.cp54-roundtrip .trip-leg-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-roundtrip .cp54-deadhead{grid-template-columns:1fr 1.5fr}.cp54-deadhead .deadhead-adjustments{grid-column:1/-1}.cp54-more-parameters .route-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.cp54-profit-grid{gap:12px}.cp54-profit-grid strong,.cp54-profit-grid .big-number,.cp54-profit-grid .margin{font-size:21px}.cp54-route-bottom{grid-template-columns:1fr}.cp54-toll-editor .route-toll-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container(max-width:640px){#roundtrip-fields{grid-template-columns:minmax(0,1fr);gap:12px}.cp54-roundtrip [data-financial-leg=outbound]{grid-column:1;grid-row:1}.cp54-roundtrip .cp54-deadhead{grid-column:1;grid-row:2}.cp54-roundtrip [data-financial-leg=return]{grid-column:1;grid-row:3}.cp54-roundtrip .trip-leg-card{padding:14px}.cp54-roundtrip .trip-leg-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.cp54-roundtrip .trip-leg-metrics dd{font-size:14px}.cp54-roundtrip .cp54-deadhead{grid-template-columns:1fr}.cp54-deadhead .trip-leg-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.cp54-roundtrip #route-panel{padding:12px}.cp54-map-card #route-map{height:260px}.cp54-map-card .route-tabs button{flex:1 1 40%;font-size:12px}.cp54-parameters>*{padding:10px}.cp54-vehicle-label,.cp54-fixed-value{font-size:13px}.cp54-parameters .input-wrap input{font-size:16px}.cp54-more-parameters .route-grid,.cp54-shared-inputs>.fields{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-profit-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.cp54-roundtrip .profit-summary{padding:18px;gap:14px}.cp54-cost-legend{grid-template-columns:1fr}.cp54-financial-secondary{flex-wrap:wrap;gap:10px}.cp54-route-bottom{gap:12px}.cp54-toll-summary,.cp54-route-overview{padding:12px}.cp54-toll-editor .route-toll-row{grid-template-columns:1fr}.cp54-deadhead .deadhead-adjustments .route-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-roundtrip .trip-leg-heading{display:flex;flex-wrap:wrap}.cp54-roundtrip .trip-leg-heading h3{font-size:18px}.cp54-roundtrip .trip-leg-card .toolbar{gap:8px}.cp54-leg-prices .field:last-child{grid-column:auto}.cp54-leg-prices{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-leg-prices .field:first-child{grid-column:1/-1}.cp54-country{font-size:13px}.cp54-country-total{align-items:flex-start}.cp54-country-total>b{max-width:60%}}
@media(prefers-reduced-motion:reduce){.cp54-roundtrip *{scroll-behavior:auto!important;transition:none!important}}
@media print{.cp54-parameters,.cp54-build,.cp54-leg-actions,.cp54-route-options,.cp54-toll-editor,.cp54-cost-details>summary{display:none}.cp54-roundtrip .profit-summary{break-inside:avoid}}
/* Compact ordinary state; full-size controls remain in disclosures. */
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) main{max-width:1800px}
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading{min-height:100px;padding-top:20px;padding-bottom:20px;margin-bottom:18px}
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading .eyebrow{display:none}
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading h1{font-size:30px}
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading p{font-size:14px;margin:6px 0 0}
.cp54-vias{font-size:12px}.cp54-vias>summary{cursor:pointer;padding:6px 0;min-height:32px;color:#526a82;display:flex;align-items:center}.cp54-vias .route-stop{margin:8px 0}.cp54-roundtrip .trip-leg-status[hidden]{display:none}.cp54-roundtrip .trip-leg-metrics div[hidden]{display:none}.cp54-roundtrip .trip-leg-metrics dd{font-size:15px}.cp54-editor-legs{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.cp54-editor-legs button{font-size:13px;min-height:42px;padding:8px 14px}.cp54-roundtrip .cp54-deadhead .trip-leg-heading{grid-column:1}.cp54-roundtrip .cp54-deadhead>[data-leg-overview]{grid-column:2}.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments:not([open]){grid-column:3;grid-row:1}.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments[open]{grid-column:1/-1;grid-row:auto}
.cp54-roundtrip .cp54-deadhead .trip-leg-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.cp54-deadhead .trip-period-note{margin:4px 0;font-size:11px}.cp54-roundtrip .profit-summary .metric-pair{min-width:0}.cp54-roundtrip .profit-summary>*{min-width:0}.cp54-roundtrip .profit-summary .big-number{min-width:0;white-space:normal}.cp54-profit-grid .margin{max-width:100%;white-space:normal}.cp54-profit-grid #roundtrip-toll-estimate-note{max-width:100%;overflow-wrap:break-word}
@container(max-width:850px){#roundtrip-fields{grid-template-columns:1fr}.cp54-roundtrip [data-financial-leg=outbound]{grid-column:1;grid-row:1}.cp54-roundtrip [data-financial-leg=return]{grid-column:1;grid-row:3}.cp54-roundtrip .cp54-deadhead{grid-column:1;grid-row:2;grid-template-columns:1fr}.cp54-roundtrip .cp54-deadhead>[data-leg-overview]{grid-column:1}.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments:not([open]){grid-column:1;grid-row:auto}.cp54-roundtrip .trip-leg-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.cp54-leg-prices{grid-template-columns:repeat(3,minmax(0,1fr))}.cp54-leg-prices .field:last-child{grid-column:auto}}
@container(max-width:430px){.cp54-leg-prices{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-leg-prices .field:first-child{grid-column:1/-1}.cp54-leg-prices .field:last-child{grid-column:auto}}
.cp54-roundtrip .result-panel{position:static;top:auto}.cp54-roundtrip .profit-summary{position:relative!important;top:auto}.cp54-roundtrip .profit-summary:after{display:none}
.cp54-roundtrip #roundtrip-calculate{display:inline-flex;justify-self:start;min-height:40px;margin:0}.cp54-roundtrip .trip-leg-adjustments>[data-route]{margin:10px 8px 4px 0;font-size:13px;line-height:1.5;white-space:normal}.cp54-map-card .leaflet-bar a{width:38px;height:38px;line-height:38px}@media(max-width:600px){.cp54-map-card .leaflet-bar a{width:42px;height:42px;line-height:42px}}
.cp54-collapse{display:none}.cp54-leg-body{min-width:0}
@container(max-width:640px){.cp54-collapse{display:inline-block;font-size:12px;padding:6px 10px;min-height:40px}.cp54-roundtrip .trip-leg-heading>span{display:none}.cp54-roundtrip .trip-leg-heading{justify-content:space-between}.cp54-leg-is-collapsed .cp54-leg-body{display:none}}
/* Final density pass: actions sit in the heading, expanded editors stay spacious. */
.cp54-roundtrip .trip-leg-heading>.cp54-build,.cp54-roundtrip .trip-leg-heading>.cp54-leg-actions{margin:0 0 0 auto}.cp54-roundtrip .trip-leg-heading>.cp54-leg-actions button,.cp54-roundtrip .trip-leg-heading>.cp54-build{min-height:40px;padding:7px 11px;font-size:12px}.cp54-roundtrip .trip-leg-heading h3{margin:0}.cp54-addresses .route-stop label{position:relative}.cp54-addresses .route-stop{min-height:58px}.cp54-addresses .route-stops{gap:8px}.cp54-leg-prices{margin:10px 0;gap:10px}.cp54-leg-prices .field{gap:4px}.cp54-leg-prices label{min-height:20px;margin-bottom:0}.cp54-leg-prices .input-wrap{min-height:40px}.cp54-roundtrip .trip-leg-metrics{margin:8px 0;gap:10px}.cp54-roundtrip .trip-leg-adjustments>summary{min-height:38px}.cp54-roundtrip .cp54-parameters>*{padding-top:10px;padding-bottom:10px}.cp54-roundtrip .cp54-parameters>.cp54-more-parameters{padding-top:0;padding-bottom:0}.cp54-roundtrip .result-panel{margin:0;padding:0}.cp54-financial-secondary{padding:10px 14px;background:#f6f8fb;border-radius:8px;flex-wrap:wrap;color:#52667a}.cp54-financial-secondary strong{color:var(--ui-text,#18324a)}.cp54-financial-secondary span{font-size:12px}.cp54-geometry-notice{padding:10px;background:#f8f3e9;color:#77552d;border-radius:8px;font-size:13px}
@container(max-width:640px){.cp54-roundtrip .trip-leg-heading>.cp54-build,.cp54-roundtrip .trip-leg-heading>.cp54-leg-actions{margin:0}.cp54-roundtrip .trip-leg-heading{gap:8px}.cp54-roundtrip .trip-leg-heading h3{margin-right:auto}.cp54-collapse{order:3}}

/* Neutralize the former CP5.3 sticky offset after making the result a full-width section. */
.cp54-roundtrip .profit-summary{top:auto!important}
/* Conservative fallback for WebViews without container-query support. */
@supports not (container-type:inline-size){@media(max-width:1180px){.cp54-parameters{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-period{grid-column:2;grid-row:1}.cp54-fuel{grid-column:1;grid-row:2}.cp54-fixed{grid-column:2;grid-row:2}.cp54-more-parameters{grid-column:1/-1;grid-row:3}#roundtrip-fields{grid-template-columns:1fr}.cp54-roundtrip [data-financial-leg=outbound]{grid-column:1;grid-row:1}.cp54-roundtrip .cp54-deadhead{grid-column:1;grid-row:2;grid-template-columns:1fr}.cp54-roundtrip [data-financial-leg=return]{grid-column:1;grid-row:3}.cp54-roundtrip .cp54-deadhead>[data-leg-overview],.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments:not([open]){grid-column:1;grid-row:auto}.cp54-route-bottom{grid-template-columns:1fr}.cp54-roundtrip .profit-summary{grid-template-columns:1fr}.cp54-cost-chart{grid-column:1;grid-row:auto}.cp54-profit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-more-parameters .route-grid,.cp54-shared-inputs>.fields{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-leg-prices{grid-template-columns:repeat(2,minmax(0,1fr))}.cp54-toll-editor .route-toll-row{grid-template-columns:1fr}}@media(max-width:600px){.cp54-parameters>*{padding:10px}.cp54-collapse{display:block}.cp54-leg-is-collapsed .cp54-leg-body{display:none}}}
.cp54-parameters.cp54-operator{grid-template-columns:repeat(2,minmax(0,1fr))}
.cp54-map-legend [data-color=toll]:before{background:repeating-linear-gradient(90deg,#895bc4 0 3px,transparent 3px 7px)}.cp54-map-legend [data-color=crossing]:before{background:repeating-linear-gradient(90deg,#397d9a 0 7px,transparent 7px 11px)}
/* CP5.4 RC2 — tighter readable rows, one primary action, one financial frame. */
.cp54-roundtrip .cp54-parameters>*{padding:9px 14px}.cp54-roundtrip .cp54-parameters>.field{gap:3px}.cp54-parameters .input-wrap{margin-top:3px;min-height:40px}.cp54-parameters .input-wrap input{min-height:38px;font-size:16px;padding:6px 10px}.cp54-parameters summary{min-height:48px;font-size:13px;gap:5px}.cp54-fixed-value{white-space:nowrap}.cp54-roundtrip .cp54-more-parameters>summary{min-height:36px;padding-top:8px;padding-bottom:8px}.cp54-vehicle-label{font-size:15px}.cp54-roundtrip .trip-leg-card{padding:12px 15px}.cp54-roundtrip .trip-leg-heading{min-height:32px;margin-bottom:8px}.cp54-roundtrip .trip-leg-heading h3{font-size:18px}.cp54-roundtrip .trip-leg-select{min-height:32px}.cp54-point-proxy{min-height:58px;margin-bottom:8px}.cp54-leg-prices{margin:8px 0}.cp54-leg-prices label{font-size:13px}.cp54-leg-prices input{font-size:16px;padding:7px 9px}.cp54-roundtrip .trip-leg-metrics{margin:8px 0;gap:8px}.cp54-roundtrip .trip-leg-metrics dt{font-size:12px}.cp54-roundtrip .trip-leg-metrics dd{font-size:16px;line-height:1.4}.cp54-roundtrip .trip-period-note{font-size:12px;line-height:1.4;margin:6px 0}.cp54-roundtrip .trip-leg-adjustments>summary{font-size:13px;min-height:34px}.cp54-leg-actions{margin:12px 0 6px!important}.cp54-leg-actions button,.cp54-build{font-size:13px!important;min-height:42px!important}.cp54-roundtrip .cp54-deadhead{padding:10px 15px}.cp54-deadhead .trip-leg-metrics{margin:4px 0}.cp54-deadhead .trip-leg-heading h3{font-size:15px}.cp54-actions{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:10px 0 2px;min-width:0}.cp54-state{display:grid;gap:4px;min-width:0}.cp54-state strong{font-size:15px;color:#1b6e43}.cp54-state span{font-size:13px;color:#596d7f;line-height:1.45}.cp54-actions[data-state=ERROR] .cp54-state strong{color:#b23d30}.cp54-actions[data-state=DIRTY] .cp54-state strong,.cp54-actions[data-state=PARTIAL] .cp54-state strong{color:#9a661d}.cp54-actions button{min-height:46px;font-size:15px;white-space:normal;padding:11px 20px;flex:0 0 auto}.cp54-roundtrip .profit-summary{grid-template-columns:minmax(0,1fr) minmax(250px,310px);padding:22px;gap:20px}.cp54-profit-grid{gap:14px}.cp54-profit-grid strong,.cp54-profit-grid .big-number,.cp54-profit-grid .margin{font-size:28px;line-height:1.3}.cp54-profit-grid span,.cp54-profit-grid .summary-kicker{font-size:13px;color:#c8d4df}.cp54-cost-chart{grid-template-columns:84px minmax(0,1fr)}.cp54-cost-ring{width:84px;height:84px}.cp54-cost-ring:after{inset:19px}.cp54-cost-legend{font-size:12px;gap:6px}.cp54-chart-pending{grid-column:1/-1;margin:0;color:#c8d4df;font-size:14px;line-height:1.5}.cp54-toll-summary .hint,.cp54-route-overview .hint{font-size:13px;line-height:1.5}.cp54-roundtrip .cp54-pricing-status{font-size:13px}.cp54-roundtrip .cp54-map-point{background:#1e6199;color:#fff;font-size:12px;border:2px solid white}.cp54-roundtrip .cp54-country small{font-size:12px}.cp54-roundtrip #roundtrip-toll-estimate-note{font-size:12px;line-height:1.4}.cp54-roundtrip .trip-leg-remove{margin-top:6px}.cp54-roundtrip .trip-leg-remove button{min-height:40px}.cp54-roundtrip .cp54-map-card #route-map{height:310px}
@container(max-width:1100px){.cp54-roundtrip .profit-summary{grid-template-columns:1fr}.cp54-cost-chart{grid-column:1;grid-row:auto}.cp54-profit-grid strong,.cp54-profit-grid .big-number,.cp54-profit-grid .margin{font-size:26px}}
@container(max-width:640px){.cp54-actions{flex-wrap:wrap;gap:12px}.cp54-actions button{width:100%;min-height:46px}.cp54-roundtrip .cp54-parameters>*{padding:9px 11px}.cp54-parameters .cp54-vehicle-label{font-size:14px}.cp54-roundtrip .trip-leg-card{padding:12px}.cp54-roundtrip .profit-summary{padding:18px}.cp54-profit-grid strong,.cp54-profit-grid .big-number,.cp54-profit-grid .margin{font-size:25px}.cp54-cost-legend{font-size:12px}.cp54-roundtrip .cp54-map-card #route-map{height:260px}.cp54-roundtrip .trip-leg-heading>.cp54-collapse{margin-left:auto}}
.cp54-roundtrip .cp54-map-point{border-radius:50%;background:#1e6199}.cp54-roundtrip .cp54-point-label{background:#174e7c;color:white;border:2px solid white;border-radius:7px;padding:4px 7px;font-size:13px;font-weight:700;line-height:18px;box-shadow:0 2px 6px #17233133}.cp54-roundtrip .cp54-point-label:before{display:none}
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading{padding-top:16px;padding-bottom:16px;min-height:90px}body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading h1{font-size:29px;line-height:1.2;margin:0}body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading p{margin-top:4px;line-height:1.4}.cp54-roundtrip .cp54-parameters>.field{margin-top:0}.cp54-previous-estimate{color:#8a5a23!important;background:#fff8ec;padding:8px;border-radius:6px}.cp54-cost-details>#roundtrip-note{padding:10px 14px;margin:0}
/* RC2 visual acceptance: explicit row beats the shared .field row on narrow layouts. */
@container(max-width:850px){.cp54-parameters>.cp54-fuel{grid-column:1;grid-row:2}.cp54-parameters>.cp54-period{grid-column:2;grid-row:1}}
@supports not (container-type:inline-size){@media(max-width:1180px){.cp54-parameters>.cp54-fuel{grid-column:1;grid-row:2}.cp54-parameters>.cp54-period{grid-column:2;grid-row:1}.cp54-roundtrip .profit-summary{grid-template-columns:1fr}.cp54-cost-chart{grid-column:1;grid-row:auto}}}
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading h1{color:#fff}
body:has(#roundtrip-page.cp54-roundtrip:not([hidden])) .page-heading p{color:#e1e8ef}

/* CP5.4.1 existing bound fixed-cost fields, isolated modal presentation. */
.cp541-cost-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(440px,100vw);height:100dvh;max-height:100dvh;max-width:100vw;border:0;border-left:1px solid #d7e1eb;padding:24px;background:#fff;color:#192e40;box-sizing:border-box;overflow:auto;box-shadow:-8px 0 32px #152a3933}.cp541-cost-drawer::backdrop{background:#14233366}.cp541-cost-drawer>button{float:right;min-height:44px}.cp541-cost-drawer h2{font-size:21px;clear:both;padding:20px 0}.cp541-cost-body{display:grid;gap:16px}.cp541-cost-body .field{padding:0;margin:0}.cp541-cost-body input{min-height:44px;width:100%}.cp54-parameters .cp541-cost-drawer .field label{font-size:14px}.cp54-fixed>summary{cursor:pointer}.cp54-roundtrip .cp54-parameters .cp54-optional{margin:12px;font-size:13px;min-height:44px}.cp54-addresses .route-stop,.cp54-point-proxy{min-height:66px}.cp54-point-proxy{margin-bottom:8px}.cp54-addresses .route-stop label{padding-top:4px}.cp54-roundtrip .cp54-leg-prices{margin-top:10px}
@media(max-width:600px){.cp541-cost-drawer{inset:auto 0 0;width:100%;height:auto;max-height:85dvh;border-radius:18px 18px 0 0;border:0}}

.cp54-addresses{display:grid;grid-template-rows:66px 66px;gap:8px}.cp54-addresses .route-stops{display:contents}.cp54-addresses .cp54-point-proxy{margin:0}.cp54-country button{min-height:40px;font-size:12px}

/* CP5.4.2: search portal is outside card stacking/overflow contexts, below modal top layer. */
.cp542-search-portal{position:fixed!important;z-index:900;display:grid!important;gap:5px;padding:8px;margin:0;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;background:#fff;border:1px solid #aebed0;border-radius:10px;box-shadow:0 8px 25px #122b4040;font:15px/1.45 Segoe UI,Arial}.cp542-search-portal .route-search-item{white-space:normal;overflow-wrap:anywhere;min-width:0;min-height:48px;line-height:1.5;padding:12px}.cp542-search-portal .route-search-credit{font-size:12px}.cp54-route-bottom{align-items:start}

.cp542-country-inline{border:1px solid #c8d8e7;border-radius:10px;padding:14px;margin:4px 0 12px;background:#fff}.cp542-country-inline>p{font-size:13px}.cp542-country-inline .route-country-quick{display:flex;flex-wrap:wrap;gap:10px;align-items:end}.cp542-country-inline label{display:grid;gap:8px;min-width:0;max-width:100%}.cp542-country-inline input{min-height:44px;max-width:100%;box-sizing:border-box;padding:10px;border:1px solid #b5c7d8;border-radius:8px;font-size:16px}.cp542-country-inline button{min-height:44px;font-size:13px}.cp542-pass-settings>summary,.cp542-toll-sources>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:13px}.cp542-pass-settings .route-toll-row{grid-template-columns:1fr}.cp542-pass-settings .route-toll-row>div{grid-column:1}.cp542-vehicle-body .route-profile>.route-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cp542-vehicle-body .route-profile{border-top:1px solid #d5e0eb;margin-top:16px}.cp542-vehicle-body>.card{padding:0}.cp542-vehicle-body .fields{grid-template-columns:1fr!important}.cp542-vehicle-body input{min-height:44px}.cp542-vehicle-drawer .cp541-cost-body{display:none}.cp54-parameters .cp54-more-parameters>summary:after{display:none}.cp54-parameters .cp54-more-parameters>summary{display:flex;padding:10px 14px;font-size:14px}.cp54-parameters .cp54-more-parameters>summary:before{content:'⚙';margin-right:8px}

.cp54-parameters .cp54-more-parameters>summary{flex-direction:row;justify-content:flex-start;gap:8px}.cp542-vehicle-body .route-country-inputs>summary{min-height:44px;cursor:pointer}.cp542-vehicle-body .route-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cp542-vehicle-body .fleet-field{min-width:0}

/* CP5.4.3 compact, state-driven actions and consistent disclosures. */
.cp54-actions[hidden]{display:none}.cp54-roundtrip .trip-leg-card{align-self:start}.cp542-vehicle-drawer{overflow:auto!important}.cp542-vehicle-body,.cp542-vehicle-body .card,.cp542-vehicle-body .route-profile{overflow:visible;max-height:none;height:auto}.cp542-vehicle-body .route-grid{align-items:stretch}.cp542-vehicle-body .route-grid>.fleet-field{display:grid;grid-template-rows:minmax(42px,auto) 44px;gap:6px;align-content:start;font-size:14px;line-height:1.45}.cp542-vehicle-body input,.cp542-vehicle-body select{height:44px;box-sizing:border-box}.cp54-roundtrip .cp54-cost-details,.cp54-roundtrip .calculation-meta{margin:12px 0;border:1px solid #d6e1eb;border-radius:10px;background:#fff;padding:0 16px}.cp54-roundtrip .cp54-cost-details>summary,.cp54-roundtrip .calculation-meta>summary{display:flex;align-items:center;gap:10px;min-height:48px;padding:8px 0;list-style:none;font-size:14px;font-weight:600;color:#294359;cursor:pointer}.cp54-roundtrip .cp54-cost-details>summary:before,.cp54-roundtrip .calculation-meta>summary:before{content:'+';font-size:20px;line-height:1}.cp54-roundtrip .cp54-cost-details[open]>summary:before,.cp54-roundtrip .calculation-meta[open]>summary:before{content:'−'}.cp54-roundtrip .cp54-cost-details>summary:hover,.cp54-roundtrip .calculation-meta>summary:hover{color:#ce5b17}.cp54-roundtrip summary:focus-visible{outline:2px solid #e98337;outline-offset:3px}

/* CP5.4.4: shared settings component, compact field feedback and balanced cards. */
.cp54-roundtrip .cp54-parameters{align-items:stretch}.cp54-roundtrip .cp54-parameters>.cp54-transport,.cp54-roundtrip .cp54-parameters>.cp54-fixed{padding:12px 16px;background:transparent;border:0;box-shadow:none}
.cp54-roundtrip .cp54-parameters>.cp54-transport>summary,.cp54-roundtrip .cp54-parameters>.cp54-fixed>summary{display:grid;grid-template-columns:1fr auto;grid-template-rows:auto minmax(22px,auto);min-height:64px;gap:6px 10px;padding:0;align-content:center}
.cp54-roundtrip .cp54-parameters>.cp54-transport>summary:after,.cp54-roundtrip .cp54-parameters>.cp54-fixed>summary:after{display:none}.cp544-setting-title{grid-column:1;font-size:13px;color:#526172}.cp544-setting-value{grid-column:1;font-size:15px;font-weight:700;color:#192e40;line-height:1.4;overflow-wrap:anywhere}.cp544-setting-edit{grid-column:2;grid-row:1/3;align-self:center;color:#a34511;font-weight:600;font-size:13px}
.cp54-roundtrip .cp54-parameters>.field{align-self:center;padding:12px 16px}.cp544-drawer{display:none;overflow:auto!important;overscroll-behavior:contain;padding:20px!important}.cp544-drawer[open]{display:block}.cp544-drawer[data-side=left]{inset:0 auto 0 0;border-left:0;border-right:1px solid #d7e1eb;box-shadow:8px 0 32px #152a3933}.cp544-drawer[data-side=right]{inset:0 0 0 auto}.cp544-drawer h2{margin:0;padding:20px 0;font-size:21px}.cp544-fleet-controls{padding-bottom:16px;border-bottom:1px solid #d5e0eb}.cp544-fleet-controls .fleet-grid{display:grid;gap:12px}.cp544-drawer .fleet-field,.cp544-drawer .field{display:grid;gap:6px;margin:0 0 12px;line-height:1.4}.cp544-drawer .field label{font-size:14px}.cp544-drawer .input-wrap{margin:0}.cp544-drawer input,.cp544-drawer select{min-height:44px;width:100%;box-sizing:border-box}.cp544-drawer .card{padding:0!important}.cp544-drawer .cp542-vehicle-body>.route-profile{margin-bottom:0}.cp544-drawer .cp54-shared-inputs{margin-top:16px}.cp544-drawer .cp541-cost-body{display:grid;gap:8px}body:has(.cp544-drawer[open]){overflow:hidden}
.cp544-field-error{display:block;color:#a83b24;font-size:12px;line-height:1.4;margin-top:5px}.cp54-roundtrip [data-cp544-invalid]{border-color:#bd624d}.cp54-roundtrip .trip-leg-card{align-self:stretch}.cp54-roundtrip .trip-leg-remove{position:relative;height:0;margin:0;overflow:visible}.cp544-return-actions{position:absolute;right:0;top:-2px;z-index:4;text-align:right;font-size:13px}.cp544-return-actions>summary{cursor:pointer;list-style:none;min-height:32px;padding:4px 10px;border-radius:6px;color:#50657a}.cp544-return-actions>button{display:block;min-width:200px;white-space:normal;box-shadow:0 5px 15px #18304422;background:#fff}.cp544-return-actions>summary:after{content:' ⋯'}.cp54-roundtrip .cp54-actions{justify-content:flex-end;padding:0;margin:8px 0}.cp54-roundtrip .cp54-actions:has(.cp54-state[hidden]){min-height:0}.cp54-roundtrip .cp54-actions .cp54-state[hidden]{display:none}.cp54-roundtrip .cp54-map-card #route-map{height:420px}
.cp54-roundtrip>.calc-link:has(>.calculation-meta){padding:0;border:0;background:transparent;box-shadow:none;margin:0}.cp54-roundtrip .calculation-meta{margin:12px 0}.cp54-roundtrip .cp54-cost-details,.cp54-roundtrip .calculation-meta{padding:0 16px}.cp54-roundtrip .cp54-cost-details>summary,.cp54-roundtrip .calculation-meta>summary{box-sizing:border-box;height:52px;min-height:52px;border:0;border-radius:0;margin:0;padding:8px 0;background:transparent;font-size:14px;font-weight:600}
@container(max-width:850px){.cp54-roundtrip .cp54-parameters>.cp54-transport{grid-column:1;grid-row:1}.cp54-roundtrip .cp54-parameters>.cp54-fixed{grid-column:2;grid-row:1}.cp54-roundtrip .cp54-parameters>.cp54-period{grid-column:1;grid-row:2}.cp54-roundtrip .cp54-parameters>.cp54-fuel{grid-column:2;grid-row:2}.cp54-roundtrip .cp54-map-card #route-map{height:360px}}
@media(max-width:600px){.cp54-roundtrip .cp544-drawer[data-side]{inset:0;margin:0;width:100%;height:100dvh;max-height:100dvh;border:0;border-radius:0}.cp544-setting-value{font-size:14px}.cp544-setting-edit{font-size:12px}.cp54-roundtrip .cp54-parameters>.cp54-transport,.cp54-roundtrip .cp54-parameters>.cp54-fixed{padding:10px}.cp54-roundtrip .cp54-map-card #route-map{height:300px}}

.cp54-roundtrip .trip-leg-card{position:relative}.cp54-roundtrip .trip-leg-remove{position:static}.cp54-roundtrip .trip-leg-remove .cp544-return-actions{top:10px;right:12px}.cp54-roundtrip [data-financial-leg=return] .trip-leg-heading{padding-right:85px}

/* CP545 whole-area settings triggers, equal labels and quiet pristine inputs. */
.cp54-roundtrip .cp54-parameters>.cp54-transport>summary,.cp54-roundtrip .cp54-parameters>.cp54-fixed>summary{grid-template-columns:1fr;padding-right:16px}.cp544-setting-title{min-height:18px}.cp54-roundtrip .cp54-parameters>.cp54-transport>summary:after,.cp54-roundtrip .cp54-parameters>.cp54-fixed>summary:after{display:block;content:'›';position:absolute;right:0;top:50%;transform:translateY(-50%)}

/* CP546: balanced outer zones centre the equal period/fuel pair; whole-area triggers, no chevrons. */
.cp54-roundtrip .cp54-parameters{grid-template-columns:minmax(0,1fr) minmax(0,.8fr) minmax(0,.8fr) minmax(0,1fr)}
.cp54-roundtrip .cp54-parameters>.cp54-transport>summary:after,.cp54-roundtrip .cp54-parameters>.cp54-fixed>summary:after{display:none!important;content:none!important}
.cp54-roundtrip .cp54-parameters>.cp54-transport>summary,.cp54-roundtrip .cp54-parameters>.cp54-fixed>summary{padding-right:0;height:100%;box-sizing:border-box}.cp54-roundtrip .cp54-parameters>.cp54-transport,.cp54-roundtrip .cp54-parameters>.cp54-fixed{cursor:pointer}
@container(max-width:850px){.cp54-roundtrip .cp54-parameters{grid-template-columns:repeat(2,minmax(0,1fr))}}

.cp54-roundtrip .cp54-parameters>.cp54-transport>summary,.cp54-roundtrip .cp54-parameters>.cp54-fixed>summary{grid-template-rows:18px 44px;gap:7px;align-content:start;min-height:69px}.cp54-roundtrip .cp544-setting-value{align-self:center}

.cp54-roundtrip .cp54-parameters>.field{align-self:stretch;display:grid;grid-template-rows:18px 44px;gap:7px;align-content:start}.cp54-roundtrip .cp54-parameters>.field>label,.cp54-roundtrip .cp544-setting-title{line-height:18px;margin:0}.cp54-roundtrip .cp54-parameters>.field .input-wrap{margin-top:0}.cp54-roundtrip .cp54-parameters>.field input{height:44px;min-height:44px}
/* CP9-WF1: ordered via rows use the same address component, without nested cards. */
.cp54-addresses{grid-template-rows:66px 66px;grid-auto-rows:auto}
.cp54-addresses .cp54-via-list{display:grid;gap:8px;min-width:0}
.cp54-addresses .cp54-via-list:empty{display:none}
.cp54-addresses .cp54-via-list .route-stop{grid-template-columns:12px minmax(0,1fr) auto auto;margin:0}
.cp54-addresses .cp54-add-via{justify-self:start;min-height:40px;font-size:12px;padding:8px 10px;margin:0}

.cp54-addresses .cp-wf-via-actions{display:flex;gap:2px;align-items:center}.cp54-addresses .cp-wf-via-actions button{padding:4px;min-width:24px;min-height:32px}.cp54-addresses .cp-wf-via-proxy{min-width:0;white-space:normal;text-align:left;overflow-wrap:anywhere}


/* CP9-WF1 RC2: DOM order follows the route; label and input occupy separate grid rows. */
.cp54-addresses{grid-template-rows:none;grid-auto-rows:auto}
.cp54-addresses .route-stop{grid-template-columns:12px minmax(0,1fr) auto auto;grid-template-rows:20px 32px;min-height:74px;padding:8px;gap:0 6px}
.cp54-addresses .route-stop label{display:contents;padding:0}.cp54-addresses .route-stop label b{grid-column:2/-1;grid-row:1;line-height:20px;white-space:nowrap;font-size:11px}
.cp54-addresses .route-stop input{grid-column:2;grid-row:2;height:32px;min-height:32px}
.cp54-addresses .route-stop>.route-stop-icon{grid-row:2;grid-column:1}.cp54-addresses .route-stop>[data-search-point],.cp54-addresses .route-stop>[data-proxy-search]{grid-column:3;grid-row:2;align-self:center;min-height:32px;height:32px;padding:4px 8px}
.cp54-addresses .route-stop>.cp-wf-via-actions{grid-column:4;grid-row:2}
.cp54-addresses .route-point-results{grid-row:3}.cp54-addresses .cp54-add-via{max-width:100%;white-space:normal;text-align:left}

.cp54-roundtrip .cp54-addresses .route-stop>button.secondary{background:var(--ui-surface,#fff);color:var(--ui-text,#18324a);border:1px solid var(--ui-border,#d5dfd8);border-radius:7px;box-shadow:none;font-weight:500}

.cp54-roundtrip .cp54-addresses .route-stop{background:var(--ui-surface,#fff);border:1px solid var(--ui-border,#d5dfd8)}

/* WF1 approved variant A: retain the original action and its keyboard semantics. */
.cp54-roundtrip .cp54-addresses .cp54-add-via{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin:0;padding:4px 0;max-width:100%;border:0;border-radius:5px;background:transparent;box-shadow:none;color:#526b80;font-size:12px;font-weight:500;text-align:left;white-space:normal;line-height:1.4}
.cp54-roundtrip .cp54-addresses .cp54-add-via svg{flex:0 0 18px}.cp54-roundtrip .cp54-addresses .cp54-add-via span{min-width:0}
.cp54-roundtrip .cp54-addresses .cp54-add-via:hover:not(:disabled){color:#254b69;background:transparent;box-shadow:none}
.cp54-roundtrip .cp54-addresses .cp54-add-via:focus-visible{outline:2px solid #356e99;outline-offset:3px}
.cp54-roundtrip .cp54-addresses .cp54-add-via:disabled{opacity:.5;cursor:not-allowed}
.cp54-roundtrip .cp54-addresses,.cp54-roundtrip .cp54-addresses .route-stops,.cp54-roundtrip .cp54-addresses .cp54-via-list{gap:6px}

/* WF1 follow-up: separate the caption from the interactive address row. */
.cp54-roundtrip .cp54-addresses .route-stop{padding:12px;grid-template-rows:20px 32px;row-gap:6px;column-gap:6px;min-height:84px}

.cp54-addresses .route-stop:has(> .route-coordinate-status:not([hidden])) label b{grid-column:2;overflow:hidden;text-overflow:ellipsis}
.cp54-addresses .route-stop>.route-coordinate-status:not([hidden]){display:block;grid-column:3/-1;grid-row:1;justify-self:end;max-width:100%;text-align:right;color:var(--ui-muted,#52657b);font-size:11px;white-space:nowrap}
.cp54-addresses .route-stop>.route-coordinate-status[data-coordinate-state=confirmed]{color:#146c43}
.cp54-addresses .route-stop>.route-coordinate-status[data-coordinate-state=error]{color:#992b20}

/* AG-01 & AG-02: symmetrical leg cards, bidirectional freight pricing and compact disclosures. */
.cp54-roundtrip .cp54-leg-prices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:10px 0;align-items:end}
.cp54-roundtrip .cp54-leg-prices .field{display:grid;grid-template-rows:minmax(20px,auto) 40px;gap:5px;align-items:end;min-width:0;margin:0}
.cp54-roundtrip .cp54-leg-prices .field:first-child,.cp54-roundtrip .cp54-leg-prices .field:last-child{grid-column:auto}
.cp54-roundtrip .cp54-leg-prices label{font-size:12px;font-weight:600;color:var(--ui-muted,#506477);line-height:1.25;min-height:0;margin:0;display:block}
.cp54-roundtrip .cp54-leg-prices .input-wrap{height:40px;min-height:40px;border-radius:8px;border:1px solid var(--ui-border,#cdd7e1);background:var(--ui-input,#f6f8fa);padding:0;box-sizing:border-box}
.cp54-roundtrip .cp54-leg-prices input{height:38px;min-height:38px;padding:6px 10px;font-size:15px;font-weight:650;color:var(--ui-text,#192b3a);font-variant-numeric:tabular-nums;width:100%;min-width:0}
.ag01-freight-box{border:1px solid var(--ui-border,#cdd7e1);border-radius:10px;background:var(--ui-raised,#f1f4f7);padding:12px;margin:10px 0;display:grid;gap:10px;min-width:0}
.ag01-freight-top{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.15fr) minmax(0,.95fr);gap:10px;align-items:end;min-width:0}
.ag01-cost-box,.ag01-markup-field,.ag01-recommended{display:grid;grid-template-rows:minmax(20px,auto) 40px;gap:5px;align-items:end;min-width:0;margin:0}
.ag01-field-label{display:flex;align-items:center;justify-content:space-between;gap:4px;flex-wrap:nowrap;white-space:nowrap;font-size:12px;font-weight:600;color:var(--ui-muted,#506477);line-height:1.25;min-width:0}
.ag02-mode-pill{font-size:9.5px;font-weight:650;padding:1px 5px;border-radius:999px;line-height:1.3;white-space:nowrap;background:#e3eaf2;color:#44586c;flex-shrink:0}
.ag02-mode-pill[data-mode=revenue]{background:#dcebff;color:#1656a5}
[data-financial-leg=return] .ag02-mode-pill[data-mode=revenue]{background:#dcf2e4;color:#196835}
.ag01-value-box{display:flex;align-items:center;height:40px;min-height:40px;padding:0 10px;border-radius:8px;border:1px solid var(--ui-border,#cdd7e1);background:var(--ui-surface,#fafbfc);box-sizing:border-box;min-width:0}
.ag01-value-box>strong{font-size:15px;font-weight:700;color:var(--ui-text,#172d40);font-variant-numeric:tabular-nums;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ag01-recommended-box{background:#eef5ff;border-color:#b7d2f4}
.ag01-recommended-box>strong{color:#1b60b0}
[data-financial-leg=return] .ag01-recommended-box{background:#eef9f2;border-color:#b7dfc5}
[data-financial-leg=return] .ag01-recommended-box>strong{color:#1d6f38}
.ag01-markup-wrap{display:flex;align-items:center;gap:4px;background:var(--ui-input,#f6f8fa);border:1px solid var(--ui-border,#cdd7e1);border-radius:8px;padding:0 10px;height:40px;min-height:40px;box-sizing:border-box;min-width:0}
.ag01-markup-wrap input{border:0;background:transparent;padding:0;min-width:0;width:100%;font-size:15px;font-weight:650;color:var(--ui-text,#192b3a);font-variant-numeric:tabular-nums;height:38px;min-height:38px}
.ag01-markup-wrap input:focus{outline:none}
.ag01-markup-wrap:has(input:focus-visible){outline:2px solid var(--ui-accent,#ff7818);outline-offset:1px}
.ag01-markup-wrap:has(input[aria-invalid=true]){border-color:#b84533;background:#fff7f5}
.ag01-markup-wrap>span{font-size:12px;color:var(--ui-muted,#506477);font-weight:600;padding:0}
.ag01-freight-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;min-width:0}
.ag02-badges{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.ag02-badge{display:inline-flex;align-items:center;gap:4px;min-height:30px;padding:4px 9px;border-radius:999px;border:1px solid var(--ui-border,#cdd7e1);background:var(--ui-surface,#fafbfc);color:var(--ui-muted,#506477);font-size:11px;font-weight:600;line-height:1.25;cursor:pointer;white-space:nowrap}
.ag02-badge[aria-expanded=true]{border-color:var(--ui-accent,#ff7818);color:var(--ui-text,#192b3a);background:#fff4ec}
.ag02-badge.is-incomplete{border-color:#d89b48;background:#fff8ec;color:#8a5614}
.ag01-apply-btn{margin-left:auto;min-height:36px!important;height:36px;padding:6px 14px!important;font-size:12px!important;font-weight:600;white-space:nowrap;border-radius:8px;background:var(--ui-surface,#fafbfc);border:1px solid var(--ui-border,#cdd7e1);color:var(--ui-text,#192b3a)}
.ag01-freight-note{margin:0;padding:8px 10px;border-radius:7px;background:var(--ui-surface,#fafbfc);border:1px solid var(--ui-border,#dde5ee);font-size:12px;line-height:1.45;color:var(--ui-muted,#506477)}
.ag01-freight-bottom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px;padding-top:9px;border-top:1px solid var(--ui-border,#d8e1ea);min-width:0}
.ag01-freight-bottom>.ag01-metric{display:grid;grid-template-rows:minmax(18px,auto) auto;gap:3px;align-items:end;min-width:0}
.ag01-freight-bottom>.ag01-metric>span{font-size:11px;font-weight:500;color:var(--ui-muted,#506477);line-height:1.25}
.ag01-freight-bottom>.ag01-metric>strong{font-size:15px;font-weight:700;color:var(--ui-text,#172d40);font-variant-numeric:tabular-nums;line-height:1.35;overflow-wrap:anywhere}
.ag01-metric>strong.is-loss{color:var(--ui-negative,#b53636)!important}
.cp54-roundtrip [data-leg-overview] .trip-leg-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:10px 0 6px;padding:8px 0 4px;border-top:1px solid var(--ui-border,#e1e8f0)}
.cp54-roundtrip [data-leg-overview] .trip-leg-metrics dt{font-size:12px;font-weight:500;color:var(--ui-muted,#506477);margin:0 0 2px}
.cp54-roundtrip [data-leg-overview] .trip-leg-metrics dd{font-size:15px;font-weight:700;line-height:1.35;margin:0;font-variant-numeric:tabular-nums}
@container(max-width:520px){
 .cp54-roundtrip .cp54-leg-prices{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cp54-roundtrip .cp54-leg-prices .field:first-child{grid-column:1/-1}
 .ag01-freight-top{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ag01-freight-top>.ag01-recommended{grid-column:1/-1}
 .ag01-freight-toolbar{flex-direction:column;align-items:stretch}
 .ag01-apply-btn{margin-left:0;width:100%;min-height:40px!important;height:40px}
 .ag02-badge{white-space:normal;text-align:left}
}
@container(max-width:310px){
 .cp54-roundtrip .cp54-leg-prices{grid-template-columns:1fr}
 .cp54-roundtrip .cp54-leg-prices .field:first-child{grid-column:auto}
 .ag01-freight-top{grid-template-columns:1fr}
 .ag01-freight-top>.ag01-recommended{grid-column:auto}
 .ag01-freight-bottom{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ag01-freight-bottom>.ag01-metric:last-child{grid-column:1/-1}
 .cp54-roundtrip [data-leg-overview] .trip-leg-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cp54-roundtrip [data-leg-overview] .trip-leg-metrics>div:not([hidden]):last-of-type{grid-column:1/-1}
}
/* CP3: three shared parameters and symmetric per-leg periods. */
.cp54-roundtrip .cp54-parameters{grid-template-columns:minmax(200px,1.3fr) minmax(130px,.8fr) minmax(200px,1.2fr)}
.cp54-roundtrip .cp54-parameters>.cp54-fuel{grid-column:2;grid-row:1}.cp54-roundtrip .cp54-parameters>.cp54-fixed{grid-column:3;grid-row:1}
.cp54-roundtrip .cp-leg-period{margin:0 0 16px;max-width:240px;min-width:0}
.cp54-roundtrip .cp-leg-period label{display:block;font-size:13px;font-weight:600;color:#526172;margin-bottom:7px}
.cp54-roundtrip .cp-leg-period .input-wrap input{min-height:44px;width:100%;padding:8px 12px;font-size:17px;font-weight:650}
.cp54-roundtrip .cp3-total-duration{grid-column:1/-1;font-size:13px;color:#526172}
@container(max-width:680px){.cp54-roundtrip .cp54-parameters{grid-template-columns:1fr 1fr}.cp54-roundtrip .cp54-parameters>.cp54-fixed{grid-column:1/-1;grid-row:2}.cp54-roundtrip .cp54-parameters>.cp54-fuel{grid-column:2;grid-row:1}}
@container(max-width:380px){.cp54-roundtrip .cp54-parameters{grid-template-columns:1fr}.cp54-roundtrip .cp54-parameters>.cp54-fuel{grid-column:1;grid-row:2}.cp54-roundtrip .cp54-parameters>.cp54-fixed{grid-column:1;grid-row:3}.cp54-roundtrip .cp-leg-period{max-width:none}}
.cp54-roundtrip .profit-summary .cp3-total-duration{color:#c8d5e1}
/* Stable native empty-leg disclosure: one header/summary position in both states. */
.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments{display:contents!important}
.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments::details-content{display:contents}
.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments>[data-deadhead-toggle]{grid-column:3;grid-row:1;justify-self:end;align-self:start;cursor:pointer;white-space:nowrap;min-height:40px;padding:10px 6px;list-style:none}
.cp54-roundtrip .cp54-deadhead .deadhead-edit-body{grid-column:1/-1;grid-row:2;min-width:0;border-top:1px solid #d6e1eb;padding-top:12px}
.cp54-roundtrip .cp54-deadhead>.deadhead-sources,.cp54-roundtrip .cp54-deadhead>p{grid-column:1/-1;font-size:12px;min-width:0}
.cp54-roundtrip .cp54-deadhead .trip-leg-heading h3{font-size:16px}
@container(max-width:850px){.cp54-roundtrip .cp54-deadhead{grid-template-columns:minmax(0,1fr) auto}.cp54-roundtrip .cp54-deadhead>.trip-leg-heading{grid-column:1;grid-row:1}.cp54-roundtrip .cp54-deadhead>.deadhead-adjustments>[data-deadhead-toggle]{grid-column:2;grid-row:1}.cp54-roundtrip .cp54-deadhead>[data-leg-overview]{grid-column:1/-1;grid-row:2}.cp54-roundtrip .cp54-deadhead .deadhead-edit-body{grid-row:3}}
.cp54-roundtrip .deadhead-edit-body[hidden]{display:none!important}

/* Empty-leg cost uses the same dt/dd KPI component as distance, tolls and fuel. */
#roundtrip-page .cp54-deadhead [data-leg-overview=deadhead] .trip-leg-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
#roundtrip-page .cp54-deadhead [data-leg-overview=deadhead] .trip-leg-metrics>div{grid-column:auto}
@container(max-width:850px){#roundtrip-page .cp54-deadhead [data-leg-overview=deadhead] .trip-leg-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
