/* Discovery starts behind the shared transparent header on every entry. */
@layer pbb-company-controls {
 html body.discovery-active,html body.discovery-active main,html body.discovery-active #discovery#discovery,html body.discovery-active #discovery#discovery .discovery-page-inner{padding-top:0!important;margin-top:0!important;top:auto!important}
 html body.discovery-active #discovery#discovery .discovery-page-inner>.discovery-video-banner{margin-top:0!important;top:0!important;transform:none!important;border-top:0!important}
 html body.discovery-active #discovery#discovery #duel-next.pbb-real-dice{transform:scale(1.44)!important;transform-origin:center center!important}
 @media(max-width:900px){
  html body.discovery-active #discovery#discovery #duel-next.pbb-real-dice{transform:scale(.86)!important;transform-origin:center center!important}
  html body.discovery-active #discovery#discovery .budget-editorial-grid .budget-dice{width:100px!important;height:100px!important;overflow:visible!important}
 }
 html body.discovery-active #discovery#discovery #duel-next.pbb-dice-fallback .pbb-dice-cube{zoom:1.3}
}

/* Three desktop reductions with a touch and keyboard accessible rail. */
@layer pbb-company-controls {
 html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list{display:flex!important;flex-wrap:nowrap!important;width:100%!important;max-width:1320px!important;margin:20px auto 0!important;gap:20px!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#f58b32 #ffffff15;align-items:stretch!important;justify-content:flex-start!important;padding:0 0 16px!important;box-sizing:border-box!important;touch-action:pan-x pan-y}
 html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list>.pbb-art-card{flex:0 0 calc((100% - 40px)/3)!important;width:calc((100% - 40px)/3)!important;max-width:none!important;min-width:0!important;margin:0!important;scroll-snap-align:start;scroll-snap-stop:normal}
 html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list:focus-visible{outline:2px solid #f58b32;outline-offset:4px}
 @media(max-width:1000px){
  html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list{gap:12px!important}
  html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list>.pbb-art-card{flex-basis:calc((100% - 12px)/2)!important;width:calc((100% - 12px)/2)!important}
 }
}

/* Valuation labels use their own line instead of sharing the input's track. */
@layer pbb-company-controls {
 html body #sell#sell #pbb-valuation-form .sg-fields{margin-top:0!important;display:grid!important;gap:18px!important;min-width:0!important}
 html body #sell#sell #pbb-valuation-form .sg-fields label:not(.sg-consent){position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto!important;align-items:start!important;gap:8px!important;min-width:0!important;height:auto!important;margin:0!important;padding:0!important}
 html body #sell#sell #pbb-valuation-form .sg-fields label[hidden]{display:none!important}
 html body #sell#sell #pbb-valuation-form .sg-fields :is(.gle-field-label,.sg-vin-heading){position:static!important;inset:auto!important;transform:none!important;display:block!important;white-space:normal!important;line-height:1.5!important;font-size:14px!important;margin:0!important;padding:0!important;min-height:21px!important;overflow-wrap:anywhere!important}
 html body #sell#sell #pbb-valuation-form .sg-fields :is(input:not([type=checkbox]):not([hidden]),select,.orange-select-trigger,.orange-trigger){position:relative!important;inset:auto!important;transform:none!important;box-sizing:border-box!important;width:100%!important;min-width:0!important;min-height:48px!important;height:48px!important;font-size:16px!important;line-height:1.4!important;padding:10px 16px!important;margin:0!important}
 html body #sell#sell #pbb-valuation-form .sg-fields :is(.gle-vin-shell,.gle-mileage-shell,.orange-select){display:block!important;position:relative!important;width:100%!important;min-width:0!important;margin:0!important}
 html body #sell#sell #pbb-valuation-form .sg-fields .gle-vin-shell{display:grid!important;gap:8px!important}
 html body #sell#sell #pbb-valuation-form .sg-fields #sg-vin-scan{position:static!important;inset:auto!important;transform:none!important;width:max-content!important;max-width:100%!important;justify-self:end!important;height:40px!important;min-height:40px!important;margin:0!important;padding:8px 14px!important;font-size:12px!important}
 html body #sell#sell #pbb-valuation-form .sg-fields .gle-mileage-shell input{padding-right:65px!important}
 html body #sell#sell #pbb-valuation-form .sg-fields .gle-unit{top:24px!important;right:16px!important;transform:translateY(-50%)!important}
 html body #sell#sell #pbb-valuation-form .sg-fields .sg-title-actions{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important}
 html body #sell#sell #pbb-valuation-form .sg-fields .sg-consent{height:auto!important;min-height:44px!important;align-items:center!important;white-space:normal!important}
 html body #sell#sell #pbb-valuation-form .sg-fields .sg-consent input{width:78px!important;height:42px!important;flex:0 0 78px!important}
}

/* Compact finance workspace immediately below the short film banner. */
@layer pbb-company-controls {
 html body #finance#finance>.studio-banner{height:200px!important;min-height:200px!important;max-height:200px!important;padding:0!important;margin:0!important}
 html body #finance#finance>.studio-banner .studio-banner-copy{position:absolute!important;top:100px!important;left:5%!important;transform:none!important;padding:0!important;margin:0!important}
 html body #finance#finance>.studio-banner .studio-banner-copy h1{font-size:26px!important;line-height:1.2!important;margin:0!important}
 html body #finance#finance>.studio-banner .studio-banner-copy :is(.eyebrow,p:not(.eyebrow)),html body #finance#finance>.studio-banner .studio-banner-index{display:none!important}
 html body #finance#finance>.studio-body.paper{padding:16px 5% 22px!important}
 html body #finance#finance>.studio-body.paper>.editorial-heading{display:none!important}
 html body #finance#finance .finance-studio{display:grid!important;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;align-items:start!important;gap:24px!important;max-width:1200px!important;margin:0 auto!important}
 html body #finance#finance .monthly-result{grid-column:1!important;grid-row:1!important;align-self:start!important;min-height:0!important;padding:18px!important;margin:0!important;gap:8px!important}
 html body #finance#finance #finance-calculator{grid-column:2!important;grid-row:1!important;display:grid!important;gap:8px!important;margin:0!important;padding:0!important;min-width:0!important}
 html body #finance#finance #finance-calculator .form-grid{display:contents!important}
 html body #finance#finance #finance-calculator label{position:relative!important;display:grid!important;grid-template-columns:120px minmax(0,1fr)!important;align-items:center!important;gap:8px!important;min-height:40px!important;margin:0!important;padding:0!important;font-size:12px!important;line-height:1.35!important;min-width:0!important}
 html body #finance#finance #finance-calculator label :is(input:not([type=range]),select,.orange-select-trigger,.orange-trigger,.finance-car-search){box-sizing:border-box!important;width:100%!important;min-width:0!important;height:40px!important;min-height:40px!important;margin:0!important;padding:8px 12px!important;font-size:14px!important;line-height:1.3!important}
 html body #finance#finance #finance-calculator :is(.finance-car-picker,.orange-select){min-width:0!important;width:100%!important;margin:0!important}
 html body #finance#finance #finance-calculator :is(.apr-reference-note,.credit-down-note){grid-column:1/-1!important;font-size:10px!important;line-height:1.4!important;margin:0!important}
 html body #finance#finance #finance-calculator .range-label{grid-template-columns:120px minmax(0,1fr) 36px!important}
 html body #finance#finance #finance-calculator input[type=range]{width:100%!important;min-width:0!important;margin:0!important;height:32px!important}
 html body #finance#finance .monthly-result>.eyebrow{margin:0!important;font-size:9px!important}
 html body #finance#finance .monthly-result .monthly-amount{margin:0!important;font-size:42px!important;line-height:1.1!important}
 html body #finance#finance .monthly-result .payment-bar{height:4px!important;margin:6px 0!important}
 html body #finance#finance .monthly-result .payment-breakdown{margin:0!important;gap:0!important}
 html body #finance#finance .monthly-result .payment-breakdown p{padding:6px!important;gap:4px!important;margin:0!important;font-size:10px!important}
 html body #finance#finance .monthly-result .payment-breakdown strong{font-size:17px!important}
 html body #finance#finance .monthly-result>.right-actions{margin:4px 0 0!important}
 html body #finance#finance .monthly-result :is(.primary,.preapproval-entry){min-height:40px!important;height:40px!important;min-width:0!important;font-size:14px!important;padding:8px 16px!important}
 html body #finance#finance .monthly-result>.small-note{font-size:10px!important;line-height:1.4!important;margin:4px 0 0!important}
 @media(max-width:700px){
  html body #finance#finance>.studio-banner{height:168px!important;min-height:168px!important;max-height:168px!important}
  html body #finance#finance>.studio-banner .studio-banner-copy{top:88px!important;left:20px!important}
  html body #finance#finance>.studio-banner .studio-banner-copy h1{font-size:23px!important}
  html body #finance#finance>.studio-body.paper{padding:10px 16px 16px!important}
  html body #finance#finance .finance-studio{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  html body #finance#finance .monthly-result{grid-row:1!important;grid-column:1!important;padding:12px!important;gap:5px!important}
  html body #finance#finance #finance-calculator{grid-row:2!important;grid-column:1!important;gap:6px!important}
  html body #finance#finance #finance-calculator label{grid-template-columns:112px minmax(0,1fr)!important;min-height:44px!important;font-size:12px!important}
  html body #finance#finance #finance-calculator label :is(input:not([type=range]),select,.orange-select-trigger,.orange-trigger,.finance-car-search){height:44px!important;min-height:44px!important;font-size:16px!important}
  html body #finance#finance #finance-calculator .range-label{grid-template-columns:112px minmax(0,1fr) 32px!important}
  html body #finance#finance .monthly-result .monthly-amount{font-size:34px!important}
 }
}

/* Center the die and lower it while retaining its roll animation. */
@layer pbb-company-controls {
 html body.discovery-active #discovery#discovery #duel-next.pbb-real-dice{translate:0 24px!important}
}

/* Left-aligned banner copy directly over a single bottom button row. */
@layer pbb-company-controls {
 html body #discovery#discovery .discovery-video-banner{height:240px!important;min-height:240px!important;max-height:240px!important;margin-bottom:16px!important;overflow:visible!important}
 html body #discovery#discovery .discovery-video-banner>video{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:cover!important}
 html body #discovery#discovery .discovery-banner-copy{top:auto!important;bottom:56px!important;left:4%!important;right:4%!important;width:auto!important;transform:none!important;text-align:left!important}
 html body #discovery#discovery .discovery-banner-copy>.eyebrow{margin:0 0 6px!important;font-size:9px!important}
 html body #discovery#discovery .discovery-banner-copy>h1{margin:0!important;max-width:none!important;font-size:30px!important;line-height:1.2!important}
 html body #discovery#discovery .discovery-banner-controls{top:auto!important;bottom:0!important;left:4%!important;right:4%!important;width:auto!important;transform:none!important;justify-content:flex-end!important;gap:8px!important}
 html body #discovery#discovery .discovery-banner-controls :is(.discovery-continue,[data-explore-tab]){height:40px!important;min-height:40px!important}
 html body #discovery#discovery .discovery-video-banner>.budget-size-select{top:100%!important;bottom:auto!important;right:4%!important;margin-top:10px!important}
 html body #discovery#discovery .discovery-video-banner:has(>.budget-size-select){margin-bottom:58px!important}
 html body #discovery#discovery .discovery-video-play{position:absolute!important;z-index:5!important;right:16px!important;top:94px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;border:1px solid #ffffff88!important;border-radius:50%!important;background:#101619aa!important;color:white!important}
 html body #discovery#discovery .discovery-video-play[hidden]{display:none!important}
 @media(max-width:800px){
  html body #discovery#discovery .discovery-video-banner{height:218px!important;min-height:218px!important;max-height:218px!important}
  html body #discovery#discovery .discovery-banner-copy{left:12px!important;right:12px!important;bottom:56px!important}
  html body #discovery#discovery .discovery-banner-copy>h1{font-size:23px!important}
  html body #discovery#discovery .discovery-banner-controls{left:12px!important;right:12px!important;gap:4px!important}
  html body #discovery#discovery .discovery-banner-controls :is(.discovery-continue,[data-explore-tab]){height:40px!important;min-height:40px!important;font-size:9px!important;padding:4px 2px!important}
 }
}

@layer pbb-company-controls {
 .price-watch-carousel{position:relative;max-width:1320px;margin:0 auto}
 .price-watch-navigation{display:flex;justify-content:flex-end;align-items:center;gap:12px;margin:10px 0}
 .price-watch-navigation button{width:44px;height:44px;min-width:44px;border:1px solid #ffffff55;border-radius:50%;background:#1c2425;color:#fff;font:32px/1 sans-serif;cursor:pointer}
 .price-watch-navigation button:disabled{opacity:.3;cursor:default}
 .price-watch-navigation button:focus-visible{outline:2px solid #ff812a;outline-offset:3px}
 .price-watch-position{font-size:12px;color:#c6c8c6;min-width:70px;text-align:center;font-variant-numeric:tabular-nums}
 @media(max-width:600px){html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list>.pbb-art-card{flex-basis:100%!important;width:100%!important}}
}

/* Saved editor widths can be narrower than the device viewport. */
html body #finance#finance>.studio-body.paper{container:finance-body / inline-size}
@layer pbb-company-controls {
 @container finance-body (max-width:560px){
  html body #finance#finance .finance-studio{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  html body #finance#finance .monthly-result{grid-column:1!important;grid-row:1!important;min-width:0!important}
  html body #finance#finance #finance-calculator{grid-column:1!important;grid-row:2!important;width:100%!important}
  html body #finance#finance #finance-calculator label{grid-template-columns:112px minmax(0,1fr)!important}
  html body #finance#finance #finance-calculator .range-label{grid-template-columns:112px minmax(0,1fr) 32px!important}
  html body #finance#finance .monthly-result :is(.primary,.preapproval-entry){width:auto!important;max-width:100%!important;white-space:normal!important;height:auto!important}
 }
}

@layer pbb-company-controls {
 @container finance-body (max-width:560px){
  /* Keep controls in view even when a saved canvas is wider than a phone. */
  html body #finance#finance .finance-studio{width:min(100%,calc(100vw - 32px))!important;margin-inline:0!important}
  html body #finance#finance #finance-calculator label .orange-select-trigger{height:auto!important;white-space:normal!important;overflow-wrap:break-word!important}
 }
}

@layer pbb-company-controls {
 @container finance-body (max-width:560px){
  html body #finance#finance #finance-calculator label .orange-select-trigger.orange-select-trigger{height:auto!important;min-height:44px!important;max-height:none!important;white-space:normal!important}
 }
}

/* The die follows the measured photo band, not the total card height. */
@layer pbb-company-controls {
 html body.budget-editorial-active #discovery#discovery #explore-body .budget-editorial-grid .budget-dice{position:absolute!important;top:var(--budget-die-center-y,150px)!important;left:50%!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important;width:100px!important;height:100px!important;margin:0!important}
 html body.budget-editorial-active #discovery#discovery #explore-body .budget-dice>p,html body.budget-editorial-active #discovery#discovery #explore-body .budget-dice>b{display:none!important}
 html body.budget-editorial-active #discovery#discovery #explore-body .budget-dice #duel-next.pbb-real-dice{position:absolute!important;top:50%!important;left:50%!important;margin:0!important;transform:translate(-50%,-50%) scale(var(--budget-die-scale,.52))!important;translate:none!important;transform-origin:center center!important}
}
@media(min-width:701px){
 @layer pbb-company-controls {
  html body.budget-editorial-active #discovery#discovery #explore-body .budget-editorial-grid>.budget-left{grid-column:1!important}
  html body.budget-editorial-active #discovery#discovery #explore-body .budget-editorial-grid>.budget-right{grid-column:3!important}
 }
}

/* Price drops use side controls and a clean scroll rail. */
@layer pbb-company-controls {
 html body #discovery#discovery #explore-body .price-watch-carousel{position:relative;max-width:1440px;padding:0 50px;box-sizing:border-box}
 html body #discovery#discovery #explore-body .price-watch-carousel .price-watch-navigation{position:absolute;inset:0;margin:0;pointer-events:none}
 html body #discovery#discovery #explore-body .price-watch-navigation button{position:absolute;top:50%;transform:translateY(-50%);pointer-events:auto;width:40px;height:44px;min-width:40px}
 html body #discovery#discovery #explore-body .price-watch-prev{left:0}
 html body #discovery#discovery #explore-body .price-watch-next{right:0}
 html body #discovery#discovery #explore-body .price-watch-position{position:absolute;width:1px;height:1px;min-width:0;overflow:hidden;clip-path:inset(50%)}
 html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list{scrollbar-width:none!important;-ms-overflow-style:none;padding-bottom:0!important}
 html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
 @media(min-width:1025px){html body #discovery#discovery #explore-body .pbb-price-watch-page .price-history-list>.pbb-art-card{flex-basis:calc((100% - 60px)/4)!important;width:calc((100% - 60px)/4)!important}}
 @media(max-width:700px){html body #discovery#discovery #explore-body .price-watch-carousel{padding-inline:36px}html body #discovery#discovery #explore-body .price-watch-navigation button{width:30px;min-width:30px;height:38px}}
}

@layer pbb-company-controls {
 @media(min-width:1025px){
 html body #finance#finance .finance-studio{max-width:1400px!important;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr)!important;gap:40px!important}
 html body #finance#finance #finance-calculator{gap:12px!important}
 html body #finance#finance #finance-calculator label{grid-template-columns:110px minmax(0,1fr)!important;gap:16px!important}
 html body #finance#finance #finance-calculator .range-label{grid-template-columns:110px minmax(0,1fr) 36px!important}
 }
}
@layer pbb-company-controls {
 html body.budget-editorial-active #discovery#discovery#discovery #explore-body .budget-editorial-grid .budget-dice{z-index:20!important;pointer-events:none!important;overflow:visible!important}
 html body.budget-editorial-active #discovery#discovery#discovery #explore-body .budget-dice #duel-next{pointer-events:auto!important;cursor:pointer!important;touch-action:manipulation!important}
 html body.budget-editorial-active #discovery#discovery#discovery #explore-body .budget-dice #duel-next canvas{pointer-events:none!important}
}
