/* Business RDS animation test controls */
.bmw-radio-preview .animation-field textarea{width:100%;min-height:150px;padding:10px 12px;border-radius:8px;border:1px solid #bdb4a5;background:#fff;color:#171717;outline:none;resize:none;font:18px monospace;white-space:pre;overflow:auto;}
.bmw-radio-preview .animation-delay-row{display:grid;grid-template-columns:auto 90px auto;align-items:center;gap:8px;margin-top:8px;font-weight:700;}
.bmw-radio-preview .animation-delay-row input{width:90px;padding:7px 8px;font:16px monospace;}
@media(max-width:850px){.bmw-radio-preview .animation-field{height:auto!important;min-height:0!important;margin:4px 0 6px!important}.bmw-radio-preview .animation-field label{display:block!important;position:static!important;transform:none!important;margin:0 0 4px!important}.bmw-radio-preview .animation-field textarea{height:auto;min-height:58px!important;max-height:none!important;font-size:15px!important;line-height:1.2!important;overflow-y:hidden!important;resize:none!important}.bmw-radio-preview .animation-delay-row input{height:34px!important;min-height:34px!important;padding:3px 7px!important}.bmw-radio-preview .animation-delay-row{grid-template-columns:auto 78px auto;font-size:14px}}

.bmw-radio-preview{
  font-family:Inter, Arial, Helvetica, sans-serif;
  --panel:#f6f1e5;
  --panel2:#fffdf8;
  --line:#d5cbb8;
  --text:#171717;
  --muted:#6d665b;
  width:100%;
  box-sizing:border-box;
  color:var(--text);
  font-family:Inter,Arial,Helvetica,sans-serif;
  margin:28px 0;
}
.bmw-radio-preview *{box-sizing:border-box}
.bmw-radio-preview .wrap{
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
}
.bmw-radio-preview h1{
  font-size:28px;
  line-height:1.2;
  margin:0 0 18px;
  color:var(--text);
}
.bmw-radio-preview .layout{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  gap:20px;
  align-items:start;
  width:100%;
}
.bmw-radio-preview .panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:16px;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}
.bmw-radio-preview .field{margin-bottom:15px}
.bmw-radio-preview .model-field{display:block}
.bmw-radio-preview label{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-weight:700;
  margin-bottom:7px;
  color:var(--text);
}
.bmw-radio-preview small,
.bmw-radio-preview .hint{color:var(--muted)}
.bmw-radio-preview input,
.bmw-radio-preview select{
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #bdb4a5;
  background:#fff;
  color:#171717;
  outline:none;
}
.bmw-radio-preview input{font:18px monospace}
.bmw-radio-preview .scroll-field textarea{
  width:100%;
  min-height:88px;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #bdb4a5;
  background:#fff;
  color:#171717;
  outline:none;
  resize:vertical;
  font:18px monospace;
}
.bmw-radio-preview .scroll-field textarea:focus{
  border-color:#756b5d;
  box-shadow:0 0 0 2px rgba(117,107,93,.12);
}
.bmw-radio-preview .scroll-play{
  margin-top:8px;
  background:#ece6da;
  color:#171717;
}
.bmw-radio-preview select{
  font-family:Inter,Arial,Helvetica,sans-serif;
  font-size:16px;
}
.bmw-radio-preview input:focus,
.bmw-radio-preview select:focus{
  border-color:#756b5d;
  box-shadow:0 0 0 2px rgba(117,107,93,.12);
}
.bmw-radio-preview .buttons{
  display:flex;
  gap:10px;
  margin-top:18px;
  flex-wrap:wrap;
}
.bmw-radio-preview button{
  border:1px solid #aaa194;
  border-radius:8px;
  padding:10px 15px;
  font-weight:700;
  cursor:pointer;
}
.bmw-radio-preview #save{
  background:#1d1d1d;
  color:#fff;
  border-color:#1d1d1d;
}
.bmw-radio-preview #clear{
  background:#ece6da;
  color:#171717;
}
.bmw-radio-preview .preview{
  min-width:0;
  width:100%;
  overflow:hidden;
  background:transparent;
  border:0;
  border-radius:0;
  padding:0;
}
.bmw-radio-preview canvas{
  display:block;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  width:100%;
  height:auto;
  max-width:100%;
}

.bmw-radio-preview .model-info{
  margin-top:14px;
  padding:0;
  background:transparent;
  border:0;
  border-radius:0;
  color:var(--text);
  line-height:1.55;
}
.bmw-radio-preview .model-info h3{
  margin:18px 0 6px;
  font-size:17px;
}
.bmw-radio-preview .model-info p{margin:7px 0}
.bmw-radio-preview .model-info ul{
  margin:7px 0 7px 22px;
  padding:0;
}
.bmw-radio-preview .model-info .muted{
  color:var(--muted);
  font-style:italic;
}

/* Two-image models: always exactly equal columns and equal visible boxes. */
.bmw-radio-preview .model-info-images{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  width:100%;
  margin:0 0 18px;
  align-items:stretch;
}
.bmw-radio-preview .model-info-images img{
  display:block;
  width:100%;
  height:720px;
  object-fit:contain;
  object-position:center top;
  border-radius:0;
}

/* Reverse RDS: diagram left, explanation text right. */
.bmw-radio-preview .reverse-info-layout{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:28px;
  width:100%;
  align-items:start;
}
.bmw-radio-preview .reverse-info-layout .model-info-images{
  display:block;
  width:100%;
  margin:0;
}
.bmw-radio-preview .reverse-info-layout .model-info-images img{
  width:100%;
  height:auto;
  max-height:none;
  object-fit:contain;
  object-position:center top;
}
.bmw-radio-preview .reverse-info-text{
  padding-top:0;
}

@media(max-width:700px){
  .bmw-radio-preview .model-info-images,
  .bmw-radio-preview .reverse-info-layout{
    grid-template-columns:1fr;
  }
  .bmw-radio-preview .model-info-images img{
    height:auto;
    max-height:none;
  }
  .bmw-radio-preview .reverse-info-layout{
    gap:14px;
  }
}

@media(max-width:850px){
  .bmw-radio-preview{
  font-family:Inter, Arial, Helvetica, sans-serif;margin:20px 0}
  .bmw-radio-preview .layout{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  .bmw-radio-preview .preview{
    order:1;
    width:100%;
    overflow:hidden;
    position:relative;
  }

  /* Mobile-only crop: the full canvas remains intact for Save PNG. */
  .bmw-radio-preview .preview canvas{
    width:100%;
    max-width:none;
    height:auto;
  }

  /* Crop each radio to the useful central band on phones. */
  .bmw-radio-preview.model-business_rds .preview,
  .bmw-radio-preview.model-reverse .preview,
  .bmw-radio-preview.model-business_cd .preview,
  .bmw-radio-preview.model-e46 .preview{
    aspect-ratio:2.75/1;
  }
  .bmw-radio-preview.model-business_rds .preview canvas,
  .bmw-radio-preview.model-reverse .preview canvas,
  .bmw-radio-preview.model-business_cd .preview canvas,
  .bmw-radio-preview.model-e46 .preview canvas{
    transform:translateY(-30%);
  }
  .bmw-radio-preview .panel{
    order:2;
    width:100%;
    padding:12px;
  }
  .bmw-radio-preview .field{
    position:relative;
    margin-bottom:8px;
  }
  .bmw-radio-preview .field label{
    position:absolute;
    z-index:2;
    left:12px;
    top:50%;
    transform:translateY(-50%);
    margin:0;
    width:auto;
    display:block;
    pointer-events:none;
    line-height:1;
  }
  .bmw-radio-preview .field label > span{
    font-size:16px;
    font-weight:700;
  }
  .bmw-radio-preview .field label small{
    position:absolute;
    left:auto;
    right:auto;
    top:50%;
    transform:translateY(-50%);
  }
  .bmw-radio-preview .field input{
    height:48px;
    padding:8px 58px 8px 42px;
    font-size:18px;
  }
  .bmw-radio-preview .field label small{
    position:fixed;
    visibility:hidden;
  }
  .bmw-radio-preview .field{
    --count-right:12px;
  }
  .bmw-radio-preview .field::after{
    content:attr(data-count);
    position:absolute;
    right:12px;
    top:50%;
    transform:translateY(-50%);
    color:var(--muted);
    font-size:14px;
    font-weight:700;
    pointer-events:none;
  }
  .bmw-radio-preview .buttons{
    margin-top:6px;
  }

  /* MOBILE COMPACT OVERRIDES */
  .bmw-radio-preview .panel{
    padding:10px;
  }

  /* model selector: label must not overlap the select */
  .bmw-radio-preview .model-field{
    height:40px;
    margin-bottom:6px;
  }
  .bmw-radio-preview .model-field label{
    display:none;
  }
  .bmw-radio-preview .model-field select{
    height:40px;
    min-height:40px;
    padding:4px 10px;
    font-size:15px;
  }

  /* normal radio text rows */
  .bmw-radio-preview .field:not(.model-field):not(.scroll-field){
    height:40px;
    min-height:40px;
    margin-bottom:6px;
  }
  .bmw-radio-preview .field:not(.model-field):not(.scroll-field) input{
    height:40px;
    min-height:40px;
    padding:4px 50px 4px 42px;
    font-size:16px;
  }

  /* scrolling field needs normal document flow, not absolute mobile label */
  .bmw-radio-preview .scroll-field{
    height:auto;
    min-height:0;
    margin:4px 0 6px;
  }
  .bmw-radio-preview .scroll-field::after{
    display:none;
    content:none;
  }
  .bmw-radio-preview .scroll-field label{
    position:static;
    display:block;
    transform:none;
    left:auto;
    top:auto;
    width:auto;
    margin:0 0 4px;
    line-height:1.2;
  }
  .bmw-radio-preview .scroll-field label > span{
    font-size:14px;
  }
  .bmw-radio-preview .scroll-field textarea{
    display:block;
    box-sizing:border-box;
    width:100%;
    height:58px;
    min-height:58px;
    max-height:58px;
    padding:6px 9px;
    font-size:15px;
    line-height:1.2;
    resize:none;
  }
  .bmw-radio-preview .scroll-play{
    margin-top:5px;
    padding:6px 12px;
  }

  .bmw-radio-preview .buttons{
    gap:6px;
  }
  .bmw-radio-preview .buttons button{
    padding:6px 11px;
  }

  /* MOBILE FINAL COMPACT LAYOUT */
  .bmw-radio-preview .model-field{
    height:34px;
    min-height:34px;
    margin-bottom:5px;
  }
  .bmw-radio-preview .model-field select{
    height:34px;
    min-height:34px;
    padding:2px 9px;
    font-size:14px;
  }

  .bmw-radio-preview .field:not(.model-field):not(.scroll-field){
    height:34px;
    min-height:34px;
    margin-bottom:5px;
  }
  .bmw-radio-preview .field:not(.model-field):not(.scroll-field) input{
    height:34px;
    min-height:34px;
    padding:2px 46px 2px 38px;
    font-size:15px;
  }
  .bmw-radio-preview .field:not(.model-field):not(.scroll-field) label{
    left:10px;
  }
  .bmw-radio-preview .field:not(.model-field):not(.scroll-field) label > span{
    font-size:14px;
  }
  .bmw-radio-preview .field:not(.model-field):not(.scroll-field)::after{
    right:10px;
    font-size:12px;
  }

  /* Reverse has only one text row: don't waste space on the word Text */
  .bmw-radio-preview.model-reverse .field:not(.model-field):not(.scroll-field) label > span{
    display:none;
  }
  .bmw-radio-preview.model-reverse .field:not(.model-field):not(.scroll-field) input{
    padding-left:10px;
  }

  /* Placeholder only on phones */
  .bmw-radio-preview .scroll-field label{
    display:none;
  }
  .bmw-radio-preview .scroll-field{
    margin-top:0;
    margin-bottom:5px;
  }
  .bmw-radio-preview .scroll-field textarea{
    height:58px;
    min-height:58px;
    max-height:58px;
    margin:0;
  }

  /* One compact action row. Play remains the ONE original button. */
  .bmw-radio-preview .scroll-play{
    margin:0;
    padding:6px 10px;
    min-height:34px;
    white-space:nowrap;
  }
  .bmw-radio-preview .buttons{
    display:flex;
    flex-wrap:nowrap;
    gap:5px;
    margin-top:5px;
  }
  .bmw-radio-preview .buttons button{
    padding:6px 10px;
    min-height:34px;
    white-space:nowrap;
    font-size:14px;
  }

  /* FINAL MOBILE ACTION ROW:
     Play is moved into .buttons only on mobile.
     buildFields() removes the previous Play before rebuilding, so duplicates cannot accumulate. */
  .bmw-radio-preview .panel{
    display:block;
  }
  .bmw-radio-preview #fields{
    display:block;
  }
  .bmw-radio-preview .buttons{
    display:flex;
    flex-wrap:nowrap;
    align-items:stretch;
    justify-content:flex-start;
    gap:5px;
    width:100%;
    margin-top:5px;
  }
  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons button{
    width:auto;
    min-width:0;
    min-height:34px;
    margin:0;
    padding:6px 8px;
    white-space:nowrap;
    font-size:14px;
    text-align:center;
  }

  /* Mobile: narrower outer buttons, wider Save JPEG button */
  .bmw-radio-preview .buttons #scroll_play{
    flex:0.8 1 0;
  }
  .bmw-radio-preview .buttons #save_jpeg{
    flex:1.35 1 0;
  }
  .bmw-radio-preview .buttons #clear{
    flex:0.8 1 0;
  }


}

/* Desktop action buttons only — mobile rules remain unchanged */
@media (min-width:851px){
  #bmw-radio-preview .buttons{
    grid-template-columns:64px minmax(112px,1fr) 64px !important;
    gap:8px !important;
    align-items:stretch !important;
  }
  #bmw-radio-preview .buttons button,
  #bmw-radio-preview .buttons .btn{
    height:40px !important;
    min-height:40px !important;
    padding:0 7px !important;
    margin:0 !important;
    line-height:1 !important;
    white-space:nowrap !important;
    font-size:14px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    box-sizing:border-box !important;
  }
  #bmw-radio-preview .buttons .save,
  #bmw-radio-preview .buttons [id*="save" i],
  #bmw-radio-preview .buttons [class*="save" i]{
    font-size:13px !important;
  }
}

/* Final textarea behavior overrides */
.bmw-radio-preview .animation-field textarea{resize:none!important;overflow-y:hidden!important;max-height:none!important;}
.bmw-radio-preview .scroll-field:not(.animation-field) textarea{resize:none!important;}

/* FINAL BUTTON BORDER OVERRIDE — keep Play/Clear consistent in local file and WordPress */
.bmw-radio-preview #scroll_play,
.bmw-radio-preview #clear{
  border:1px solid #aaa194 !important;
  box-shadow:none !important;
  outline:none !important;
}

/* Business RDS special glyph picker — first version, static C line only */
.bmw-radio-preview .symbol-tools{margin-top:6px;position:relative;z-index:5}
.bmw-radio-preview .symbol-toggle{padding:6px 10px;background:#ece6da;color:#171717;border:1px solid #aaa194;border-radius:8px;font-size:13px;font-weight:400}
.bmw-radio-preview .symbol-picker{display:none;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;margin-top:6px;padding:7px;border:1px solid #d5cbb8;border-radius:8px;background:#fffdf8;max-height:245px;overflow:auto}
.bmw-radio-preview .symbol-picker.open{display:grid}
.bmw-radio-preview .symbol-choice{padding:3px!important;min-height:30px!important;background:#1f292a!important;border:1px solid #59605d!important;border-radius:5px!important;display:flex;align-items:center;justify-content:center}
.bmw-radio-preview .symbol-choice canvas{width:15px!important;height:24px!important;display:block}
.bmw-radio-preview .symbol-choice small{display:none!important}
@media(max-width:850px){.bmw-radio-preview .symbol-picker{grid-template-columns:repeat(8,minmax(0,1fr));max-height:220px}.bmw-radio-preview .symbol-toggle{padding:5px 8px;font-size:13px}.bmw-radio-preview .symbol-choice{min-height:30px!important}}

/* Business RDS: show the complete Special Symbols table without internal scrolling. */
.bmw-radio-preview.business-rds-active .symbol-picker{max-height:none!important;overflow:visible!important}

.bmw-radio-preview,
.bmw-radio-preview *{
  font-family:Inter, Arial, Helvetica, sans-serif !important;
}

/* Landscape phone: all three action buttons equal width */
@media (max-width: 950px) and (orientation: landscape){
  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #save_jpeg,
  .bmw-radio-preview .buttons #clear{
    flex:1 1 0 !important;
    width:0 !important;
    min-width:0 !important;
  }
}


/* Phone landscape override: equal-width Play / Save JPEG / Clear.
   Height condition catches Messenger/in-app landscape viewports that report a wide CSS width. */
@media (orientation: landscape) and (max-height: 650px){
  .bmw-radio-preview .buttons{
    display:flex !important;
    flex-wrap:nowrap !important;
    width:100% !important;
  }
  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #save_jpeg,
  .bmw-radio-preview .buttons #clear{
    flex:1 1 33.333% !important;
    flex-basis:33.333% !important;
    width:33.333% !important;
    max-width:none !important;
    min-width:0 !important;
  }
}


/* FINAL responsive action buttons
   Portrait/narrow component: Play + Clear narrower, Save JPEG wider.
   Wide component (phone landscape): all three equal.
   Uses container width, so opening the keyboard does not change proportions. */
.bmw-radio-preview{
  container-type:inline-size;
}

@media (max-width: 950px){
  .bmw-radio-preview .buttons{
    display:grid !important;
    grid-template-columns:0.8fr 1.35fr 0.8fr !important;
    gap:6px !important;
    width:100% !important;
  }

  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #save_jpeg,
  .bmw-radio-preview .buttons #clear{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    flex:none !important;
  }
}

/* Messenger / browser landscape can report desktop-like viewport widths.
   The component width itself is the reliable trigger. */
@container (min-width: 700px){
  .bmw-radio-preview .buttons{
    display:grid !important;
    grid-template-columns:repeat(3, minmax(0,1fr)) !important;
    gap:6px !important;
    width:100% !important;
  }

  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #save_jpeg,
  .bmw-radio-preview .buttons #clear{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    flex:none !important;
  }
}


/* Desktop: compact action buttons on one row */
@media (min-width: 951px){
  .bmw-radio-preview .buttons{
    display:grid !important;
    grid-template-columns:64px minmax(104px,1fr) 64px !important;
    gap:8px !important;
    width:100% !important;
    align-items:center !important;
  }

  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #save_jpeg,
  .bmw-radio-preview .buttons #clear{
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    min-height:38px !important;
    margin:0 !important;
    padding:6px 8px !important;
    font-size:15px !important;
    line-height:1.1 !important;
    white-space:nowrap !important;
    flex:none !important;
  }
}

/* FINAL DESKTOP BUTTON FIX — actual HTML selectors */
@media (min-width:951px){
  .bmw-radio-preview .buttons{
    display:grid !important;
    grid-template-columns:64px minmax(112px,1fr) 64px !important;
    gap:8px !important;
    width:100% !important;
    margin-top:18px !important;
    align-items:stretch !important;
  }

  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #save,
  .bmw-radio-preview .buttons #clear{
    width:100% !important;
    height:40px !important;
    min-height:40px !important;
    max-height:40px !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 6px !important;
    box-sizing:border-box !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    white-space:nowrap !important;
    line-height:1 !important;
    flex:none !important;
  }

  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #clear{
    font-size:13px !important;
  }

  .bmw-radio-preview .buttons #save{
    font-size:12px !important;
  }
}

/* Desktop only: larger action-button text */
@media (min-width:951px){
  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #clear{
    font-size:16px !important;
    font-weight:700 !important;
  }

  .bmw-radio-preview .buttons #save{
    font-size:15px !important;
    font-weight:700 !important;
  }
}

/* Desktop only: compact left control panel so it stays within image height */
@media (min-width:951px){
  .bmw-radio-preview .panel{
    padding:14px 16px !important;
  }

  .bmw-radio-preview .field{
    margin-bottom:9px !important;
  }

  .bmw-radio-preview label{
    margin-bottom:4px !important;
    line-height:1.15 !important;
  }

  .bmw-radio-preview input,
  .bmw-radio-preview select{
    padding:7px 10px !important;
  }

  .bmw-radio-preview .scroll-field textarea{
    min-height:68px !important;
    height:68px !important;
    padding:7px 10px !important;
  }

  .bmw-radio-preview .buttons{
    margin-top:8px !important;
  }
}

@media (min-width:951px){
  .bmw-radio-preview .field{
    margin-bottom:12px !important;
  }

  .bmw-radio-preview label{
    margin-bottom:5px !important;
  }

  .bmw-radio-preview .buttons{
    margin-top:10px !important;
  }
}

@media (min-width:951px){
  .bmw-radio-preview .line-field{
    position:relative !important;
  }

  .bmw-radio-preview .line-field > label{
    position:absolute !important;
    left:12px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    z-index:2 !important;
    margin:0 !important;
    font-size:16px !important;
    font-weight:700 !important;
    line-height:1 !important;
    pointer-events:none !important;
  }

  .bmw-radio-preview .line-field > input{
    padding-left:48px !important;
    padding-right:42px !important;
  }

  .bmw-radio-preview .line-field .count{
    position:absolute !important;
    right:10px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    z-index:2 !important;
    margin:0 !important;
    pointer-events:none !important;
  }
}

/* DESKTOP ONLY: A/B/C/D inside their input boxes.
   Uses the actual generated markup: .field, excluding model + scrolling fields. */
@media (min-width:951px){
  .bmw-radio-preview #fields > .field:not(.scroll-field){
    position:relative !important;
  }

  .bmw-radio-preview #fields > .field:not(.scroll-field) > label{
    position:absolute !important;
    left:12px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    z-index:3 !important;
    margin:0 !important;
    width:auto !important;
    display:block !important;
    line-height:1 !important;
    pointer-events:none !important;
  }

  .bmw-radio-preview #fields > .field:not(.scroll-field) > label > span{
    font-size:16px !important;
    font-weight:700 !important;
  }

  .bmw-radio-preview #fields > .field:not(.scroll-field) > label small{
    display:none !important;
  }

  .bmw-radio-preview #fields > .field:not(.scroll-field) > input{
    padding-left:48px !important;
    padding-right:48px !important;
  }

  .bmw-radio-preview #fields > .field:not(.scroll-field)::after{
    content:attr(data-count) !important;
    position:absolute !important;
    right:10px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    z-index:3 !important;
    color:var(--muted) !important;
    font-size:14px !important;
    font-weight:700 !important;
    pointer-events:none !important;
  }
}

/* Desktop only: Reverse RDS – keep "Text" inside the field and center the 8-char value */
@media (min-width:951px){
  .bmw-radio-preview.model-reverse .field:not(.model-field):not(.scroll-field) label > span{
    display:inline !important;
  }
  .bmw-radio-preview.model-reverse .field:not(.model-field):not(.scroll-field) input{
    text-align:center !important;
    padding-left:52px !important;
    padding-right:52px !important;
  }
}

/* Phone: Reverse RDS – same field layout as desktop */
@media (max-width:950px){
  .bmw-radio-preview.model-reverse .field:not(.model-field):not(.scroll-field) label > span{
    display:inline !important;
  }
  .bmw-radio-preview.model-reverse .field:not(.model-field):not(.scroll-field) input{
    text-align:left !important;
    /* "Text" is wider than A/B/C, so reserve its width + the same visual gap */
    padding-left:62px !important;
    padding-right:52px !important;
  }
}

/* Compact Delay input: keep numeric keyboard, hide browser spinner arrows. */
.bmw-radio-preview .animation-delay-row{grid-template-columns:max-content 68px max-content!important;}
.bmw-radio-preview .animation-delay-row input{width:68px!important;-moz-appearance:textfield;}
.bmw-radio-preview .animation-delay-row input::-webkit-outer-spin-button,
.bmw-radio-preview .animation-delay-row input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
@media(max-width:850px){
  .bmw-radio-preview .animation-delay-row{grid-template-columns:max-content 68px max-content!important;justify-content:start!important;column-gap:6px!important;}
  .bmw-radio-preview .animation-delay-row input{width:68px!important;}
}

@media (min-width:951px){
  .bmw-radio-preview .symbol-toggle{
    font-size:16px !important;
    font-weight:700 !important;
    line-height:1.1 !important;
  }
}


.bmw-radio-preview .customer-copy-row{display:flex;margin-top:8px}
.bmw-radio-preview .customer-copy-all{background:#ece6da;color:#171717;border:1px solid #aaa194;padding:7px 10px;font-size:13px}
@media(max-width:850px){.bmw-radio-preview .customer-copy-row{margin-top:6px}.bmw-radio-preview .customer-copy-all{min-height:34px;padding:6px 9px}}
/* v1.0.2 — unified 2 x 2 action buttons */
.bmw-radio-preview .buttons{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:7px !important;
  width:100% !important;
}
.bmw-radio-preview .buttons #scroll_play,
.bmw-radio-preview .buttons #save,
.bmw-radio-preview .buttons .customer-copy-all,
.bmw-radio-preview .buttons #clear{
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  height:40px !important;
  min-height:40px !important;
  margin:0 !important;
  padding:0 8px !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:16px !important;
  font-weight:700 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  border-width:1px !important;
  border-style:solid !important;
  border-radius:8px !important;
}
.bmw-radio-preview .buttons .customer-copy-all{
  background:#ece6da !important;
  color:#171717 !important;
  border-color:#aaa194 !important;
}
@media(max-width:850px){
  .bmw-radio-preview .buttons #scroll_play,
  .bmw-radio-preview .buttons #save,
  .bmw-radio-preview .buttons .customer-copy-all,
  .bmw-radio-preview .buttons #clear{
    height:36px !important;
    min-height:36px !important;
    font-size:14px !important;
    padding:0 6px !important;
  }
}
/* v1.0.3 — fixed action order and mobile symbol-picker focus */
.bmw-radio-preview .buttons{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  grid-auto-flow:row !important;
  gap:7px !important;
  width:100% !important;
}
.bmw-radio-preview .buttons > #scroll_play,
.bmw-radio-preview .buttons > #save,
.bmw-radio-preview .buttons > .customer-copy-all,
.bmw-radio-preview .buttons > #clear{
  position:static !important;
  float:none !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  height:40px !important;
  min-height:40px !important;
  margin:0 !important;
  padding:0 8px !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:16px !important;
  font-weight:700 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  border-width:1px !important;
  border-style:solid !important;
  border-radius:8px !important;
}
.bmw-radio-preview .buttons > #scroll_play{grid-column:1;grid-row:1}
.bmw-radio-preview .buttons > .customer-copy-all{grid-column:2;grid-row:1;background:#ece6da !important;color:#171717 !important;border-color:#aaa194 !important}
.bmw-radio-preview .buttons > #save{grid-column:1;grid-row:2}
.bmw-radio-preview .buttons > #clear{grid-column:2;grid-row:2}
@media(max-width:850px){
  .bmw-radio-preview .buttons > #scroll_play,
  .bmw-radio-preview .buttons > #save,
  .bmw-radio-preview .buttons > .customer-copy-all,
  .bmw-radio-preview .buttons > #clear{
    height:36px !important;min-height:36px !important;font-size:14px !important;padding:0 6px !important;
  }
}

/* v1.0.4 — final 2x2 action grid. Keep Copy all directly above Save JPEG. */
.bmw-radio-preview .buttons{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  grid-template-rows:repeat(2,40px) !important;
  gap:7px !important;
  width:100% !important;
}
.bmw-radio-preview .buttons > #scroll_play,
.bmw-radio-preview .buttons > #save,
.bmw-radio-preview .buttons > .customer-copy-all,
.bmw-radio-preview .buttons > #clear{
  position:static !important;
  float:none !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  height:40px !important;
  min-height:40px !important;
  max-height:40px !important;
  margin:0 !important;
  padding:0 6px !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:15px !important;
  font-weight:700 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  border-width:1px !important;
  border-style:solid !important;
  border-radius:8px !important;
  flex:none !important;
}
.bmw-radio-preview .buttons > #scroll_play{grid-column:1 !important;grid-row:1 !important}
.bmw-radio-preview .buttons > .customer-copy-all{grid-column:2 !important;grid-row:1 !important;background:#ece6da !important;color:#171717 !important;border-color:#aaa194 !important}
.bmw-radio-preview .buttons > #clear{grid-column:1 !important;grid-row:2 !important}
.bmw-radio-preview .buttons > #save{grid-column:2 !important;grid-row:2 !important}
@media(max-width:850px){
  .bmw-radio-preview .buttons{grid-template-rows:repeat(2,36px) !important}
  .bmw-radio-preview .buttons > #scroll_play,
  .bmw-radio-preview .buttons > #save,
  .bmw-radio-preview .buttons > .customer-copy-all,
  .bmw-radio-preview .buttons > #clear{
    height:36px !important;min-height:36px !important;max-height:36px !important;font-size:14px !important;padding:0 5px !important;
  }
}

/* v1.0.6 — consistent button typography; slightly larger mobile action buttons */
.bmw-radio-preview .symbol-toggle{
  font-family:Inter, Arial, Helvetica, sans-serif !important;
  font-size:15px !important;
  font-weight:700 !important;
  line-height:1 !important;
  padding:6px 10px !important;
  border-width:1px !important;
  border-style:solid !important;
  border-radius:8px !important;
}
.bmw-radio-preview .buttons > #scroll_play,
.bmw-radio-preview .buttons > #save,
.bmw-radio-preview .buttons > .customer-copy-all,
.bmw-radio-preview .buttons > #clear{
  font-family:Inter, Arial, Helvetica, sans-serif !important;
  font-size:15px !important;
  font-weight:700 !important;
}
@media(max-width:850px){
  .bmw-radio-preview .symbol-toggle{
    font-size:15px !important;
    padding:6px 9px !important;
  }
  .bmw-radio-preview .buttons{
    grid-template-rows:repeat(2,40px) !important;
  }
  .bmw-radio-preview .buttons > #scroll_play,
  .bmw-radio-preview .buttons > #save,
  .bmw-radio-preview .buttons > .customer-copy-all,
  .bmw-radio-preview .buttons > #clear{
    height:40px !important;
    min-height:40px !important;
    max-height:40px !important;
    font-size:16px !important;
    padding:0 7px !important;
  }
}

/* v1.0.6 — compact action buttons and matching mobile delay text */
.bmw-radio-preview .buttons{
  grid-template-rows:repeat(2,32px) !important;
}
.bmw-radio-preview .buttons > #scroll_play,
.bmw-radio-preview .buttons > #save,
.bmw-radio-preview .buttons > .customer-copy-all,
.bmw-radio-preview .buttons > #clear{
  height:32px !important;
  min-height:32px !important;
  max-height:32px !important;
  padding:0 7px !important;
  font-size:15px !important;
}
@media(max-width:850px){
  .bmw-radio-preview .buttons{
    grid-template-rows:repeat(2,34px) !important;
  }
  .bmw-radio-preview .buttons > #scroll_play,
  .bmw-radio-preview .buttons > #save,
  .bmw-radio-preview .buttons > .customer-copy-all,
  .bmw-radio-preview .buttons > #clear{
    height:34px !important;
    min-height:34px !important;
    max-height:34px !important;
    font-size:15px !important;
    padding:0 6px !important;
  }
  .bmw-radio-preview .animation-delay-row input{
    font-size:15px !important;
  }
}

/* v1.0.16: subtle numbered animation character grid */
.bmw-radio-preview .bmw-animation-grid-caption{font-size:11px;color:#777;margin:8px 0 3px}
.bmw-radio-preview .bmw-animation-grid{width:max-content;max-width:100%;overflow-x:auto;margin:0 0 8px;font-family:monospace}
.bmw-radio-preview .bmw-animation-grid-row{display:grid;grid-template-columns:30px repeat(var(--columns,8),minmax(21px,25px));gap:1px;margin-bottom:1px}
.bmw-radio-preview .bmw-animation-grid-index,.bmw-radio-preview .bmw-animation-grid-heading{font:11px monospace;color:#999;text-align:center;align-content:center}
.bmw-radio-preview .bmw-animation-grid-cell{width:100%;height:25px;min-height:0;padding:0;border:1px solid #e1e1e1;border-radius:2px;background:#fafafa;color:#333;font:15px monospace;cursor:text}
.bmw-radio-preview .bmw-animation-grid-cell:hover{background:#e9eff5;border-color:#aab8c7}

/* v1.0.17: single editable matrix, all columns fit the sidebar */
.bmw-radio-preview .bmw-animation-source-hidden{display:none !important}
.bmw-radio-preview .bmw-animation-grid{width:100% !important;max-width:100% !important;overflow-x:hidden !important;box-sizing:border-box}
.bmw-radio-preview .bmw-animation-grid-row{display:grid !important;grid-template-columns:20px repeat(var(--columns,8),minmax(0,1fr)) !important;gap:1px !important;width:100%;box-sizing:border-box}
.bmw-radio-preview .bmw-animation-grid-index,.bmw-radio-preview .bmw-animation-grid-heading{font-size:10px !important;min-width:0}
.bmw-radio-preview input.bmw-animation-grid-cell{display:block !important;box-sizing:border-box !important;min-width:0 !important;width:100% !important;height:25px !important;min-height:25px !important;padding:0 !important;margin:0 !important;border:1px solid #e0dfdb !important;border-radius:2px !important;background:#faf9f7 !important;color:#252525 !important;text-align:center !important;font:13px/23px monospace !important;box-shadow:none !important;outline-offset:-1px}
.bmw-radio-preview input.bmw-animation-grid-cell:focus{border-color:#8799a8 !important;background:#eef3f7 !important;outline:1px solid #8799a8 !important}

/* v1.0.18: continuous pixel-style grid */
.bmw-radio-preview .bmw-animation-grid-caption{display:none !important}
.bmw-radio-preview .bmw-animation-grid-row{grid-template-columns:repeat(var(--columns,8),minmax(0,1fr)) !important;gap:0 !important;margin:0 !important}
.bmw-radio-preview .bmw-animation-grid-heading{height:18px;line-height:18px}
.bmw-radio-preview input.bmw-animation-grid-cell{border-radius:0 !important;border-right:0 !important;border-bottom:0 !important;height:24px !important;min-height:24px !important}
.bmw-radio-preview .bmw-animation-grid-row input.bmw-animation-grid-cell:last-child{border-right:1px solid #e0dfdb !important}
.bmw-radio-preview .bmw-animation-grid-row:last-child input.bmw-animation-grid-cell{border-bottom:1px solid #e0dfdb !important}

/* v1.0.21 multi-cell selection */
.bmw-radio-preview input.bmw-animation-grid-cell.bmw-grid-selected,
.bmw-radio-preview input.bmw-animation-grid-cell.bmw-grid-selected:focus{
 background:#c9dff5 !important;border-color:#82a8cd !important;outline:none !important;
}

/* v1.0.25: frame editing context menu */
.bmw-grid-context-menu{position:fixed;z-index:2147483000;background:#fffdf8;border:1px solid #aaa194;border-radius:8px;box-shadow:0 5px 24px #0003;padding:5px;min-width:180px;display:flex;flex-direction:column;gap:2px}
.bmw-grid-context-menu[hidden]{display:none!important}
.bmw-grid-context-menu button{display:block;width:100%;padding:10px 12px;border:0;background:transparent;color:#171717;text-align:left;font:14px Arial,sans-serif;cursor:pointer;border-radius:4px}
.bmw-grid-context-menu button:hover,.bmw-grid-context-menu button:focus{background:#ece6da}
.bmw-animation-grid-caption{font-size:12px;color:#6d665b;margin:4px 0}

/* v1.0.26: touch-specific frame editing and selection handles */
.bmw-grid-mobile-tools{display:none;gap:4px;flex-wrap:wrap;margin:5px 0 9px}
.bmw-grid-mobile-tools button{font:12px Arial,sans-serif;padding:7px 8px;border:1px solid #aaa194;border-radius:5px;background:#ece6da;color:#171717}
.bmw-grid-mobile-tools button.active{background:#c5d9ed;border-color:#5b84a4}
.bmw-grid-handle{position:fixed;z-index:2147482000;width:19px;height:19px;border-radius:50%;background:#327bb0;border:2px solid white;box-shadow:0 1px 4px #0007;touch-action:none}
.bmw-grid-handle[hidden]{display:none!important}
@media(pointer:coarse){.bmw-grid-mobile-tools{display:flex}.bmw-radio-preview .bmw-animation-grid-cell{touch-action:manipulation}}

/* v1.0.27: actual black 5x7 symbols inside editable text and animation cells. */
.bmw-radio-preview .bmw-inline-glyph-wrap{position:relative;width:100%;min-width:0}
.bmw-radio-preview .bmw-inline-glyph-wrap>input,
.bmw-radio-preview .bmw-inline-glyph-wrap>textarea{position:relative;z-index:1;width:100%}
.bmw-radio-preview .bmw-inline-glyph-input{color:transparent!important;caret-color:#171717!important}
.bmw-radio-preview .bmw-inline-glyph-overlay{position:absolute;inset:0;z-index:2;pointer-events:none;box-sizing:border-box;overflow:hidden;color:#171717;white-space:pre;font-family:monospace;}
.bmw-radio-preview .bmw-inline-glyph-overlay[hidden]{display:none!important}
.bmw-radio-preview .bmw-inline-glyph{display:inline-block;vertical-align:-0.08em;width:1ch;height:0.9em;background-repeat:no-repeat;background-position:center;background-size:contain}
.bmw-radio-preview input.bmw-animation-grid-cell.bmw-grid-glyph{color:transparent!important;caret-color:#171717!important;background-image:var(--bmw-grid-glyph)!important;background-repeat:no-repeat!important;background-position:center!important;background-size:15px 19px!important}

/* v1.0.28: restore input padding that was lost when the glyph wrapper was added. */
.bmw-radio-preview #fields > .field:not(.scroll-field) > .bmw-inline-glyph-wrap > input{box-sizing:border-box!important;font-family:monospace!important}
@media(min-width:851px){.bmw-radio-preview #fields > .field:not(.scroll-field) > .bmw-inline-glyph-wrap > input{padding-left:48px!important;padding-right:48px!important}}
@media(max-width:850px){.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) > .bmw-inline-glyph-wrap > input{height:34px!important;min-height:34px!important;padding:2px 46px 2px 38px!important;font-size:15px!important}.bmw-radio-preview.model-reverse #fields > .field:not(.model-field):not(.scroll-field) > .bmw-inline-glyph-wrap > input{padding-left:10px!important}}
.bmw-radio-preview .bmw-inline-glyph-overlay{font-variant-ligatures:none;font-feature-settings:"liga" 0}
.bmw-radio-preview .bmw-inline-glyph{width:1ch;box-sizing:border-box}

/* v1.0.29: glyphs advance exactly like a single normal monospace character. */
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-inline-glyph{
  display:inline;
  width:auto;
  height:auto;
  vertical-align:baseline;
  color:transparent;
  background-size:calc(1ch - 2px) 0.82em;
  background-position:center center;
  background-repeat:no-repeat;
  letter-spacing:inherit;
}
/* Restore the label's position above the visual glyph overlay. */
.bmw-radio-preview #fields > .field:not(.scroll-field) > label{z-index:4!important;pointer-events:none;}
.bmw-radio-preview .bmw-inline-glyph-overlay{letter-spacing:inherit;line-height:inherit;}
/* Remove six legacy mobile controls entirely. */
.bmw-grid-mobile-tools{display:none!important;}
/* Allow touch selection handles to be grabbed without page panning. */
.bmw-grid-handle{width:24px;height:24px;touch-action:none;}
@media(pointer:coarse){.bmw-radio-preview .bmw-animation-grid-cell{touch-action:pan-y;}}

/* v1.0.30: exact single-character advance, matching the native monospace input. */
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-inline-glyph{
 display:inline!important;
 width:auto!important;
 height:auto!important;
 font:inherit!important;
 letter-spacing:inherit!important;
 color:transparent!important;
 vertical-align:baseline!important;
 background-size:calc(1ch - 3px) 0.78em!important;
 background-position:center center!important;
 background-repeat:no-repeat!important;
}
.bmw-radio-preview .bmw-inline-glyph-overlay{font-kerning:none!important; font-variant-ligatures:none!important;}
.bmw-radio-preview .bmw-inline-glyph-input{font-kerning:none!important; font-variant-ligatures:none!important;}

/* v1.0.31: keep the symbol overlay's character metrics aligned with the input. */
.bmw-radio-preview .bmw-inline-glyph-overlay,
.bmw-radio-preview .bmw-inline-glyph-input{font-kerning:none!important;font-feature-settings:"liga" 0,"kern" 0!important;font-variant-ligatures:none!important;}
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-inline-glyph{font-family:inherit!important;font-size:inherit!important;font-weight:inherit!important;font-style:inherit!important;letter-spacing:inherit!important;}
@media(pointer:coarse){.bmw-radio-preview .bmw-animation-grid-cell{touch-action:none!important;-webkit-touch-callout:none!important;user-select:none!important;-webkit-user-select:none!important;}}

/* v1.0.32: position the visible caret using actual glyph overlay coordinates. */
.bmw-radio-preview .bmw-inline-glyph-input{caret-color:transparent!important;}
.bmw-radio-preview .bmw-visual-glyph-caret{position:absolute;z-index:4;width:1.5px;background:#171717;pointer-events:none;animation:bmw-caret-blink 1.05s step-end infinite;}
.bmw-radio-preview .bmw-visual-glyph-caret[hidden]{display:none!important;}
@keyframes bmw-caret-blink{50%{opacity:0}}

/* v1.0.33: one fixed-width visual cell per character; caret at cell boundary. */
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-glyph-cell{
 display:inline-block!important;position:relative!important;box-sizing:border-box!important;
 width:1ch!important;min-width:1ch!important;max-width:1ch!important;
 height:1.15em!important;line-height:1.15em!important;
 margin:0!important;padding:0!important;border:0!important;
 letter-spacing:0!important;vertical-align:baseline!important;
 overflow:visible!important;white-space:pre!important;
}
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-glyph-cell.bmw-inline-glyph{
 background-size:calc(1ch - 3px) 0.78em!important;
 background-position:center center!important;
}

/* v1.0.34: restore A/B/C/D labels and live 4/4, 7/8 etc counters on phones.
   Glyph overlay is above the input, so both annotations must sit above it. */
@media (max-width:950px){
  .bmw-radio-preview #fields > .field:not(.scroll-field){position:relative!important;}
  .bmw-radio-preview #fields > .field:not(.scroll-field) > label{
    display:block!important;visibility:visible!important;position:absolute!important;
    left:12px!important;top:50%!important;transform:translateY(-50%)!important;
    z-index:6!important;pointer-events:none!important;margin:0!important;
  }
  .bmw-radio-preview #fields > .field:not(.scroll-field) > label > span{
    display:inline!important;visibility:visible!important;opacity:1!important;
  }
  .bmw-radio-preview #fields > .field:not(.scroll-field)::after{
    content:attr(data-count)!important;display:block!important;visibility:visible!important;
    position:absolute!important;right:10px!important;left:auto!important;
    top:50%!important;transform:translateY(-50%)!important;z-index:6!important;
    font-size:14px!important;font-weight:700!important;pointer-events:none!important;
    color:var(--muted,#665d53)!important;
  }
}

/* v1.0.35 — phone-only layout corrections. */
@media (max-width:850px){
  /* Every model's complete symbol palette is visible when expanded. */
  .bmw-radio-preview .symbol-picker.open{max-height:none!important;height:auto!important;overflow:visible!important;overflow-y:visible!important;}
  /* Reverse has no A/B/C identifier: keep the text at the left without an overlapping Text label. */
  .bmw-radio-preview.model-reverse #fields > .field:not(.scroll-field) > label,
  .bmw-radio-preview.model-reverse #fields > .field:not(.scroll-field) > label > span{display:none!important;}
  .bmw-radio-preview.model-reverse #fields > .field:not(.scroll-field) > .bmw-inline-glyph-wrap > input{padding-left:12px!important;padding-right:48px!important;text-align:left!important;}
  /* Keep the native select arrow slightly further from the right edge. */
  .bmw-radio-preview .model-field select{padding-right:26px!important;background-position:right 12px center!important;}
}

/* v1.0.36 — keep the Reverse RDS "Text" identifier visible on phones.
   Reserve a separate label column so text and glyphs never overlap it. */
@media (max-width:850px){
  .bmw-radio-preview.model-reverse #fields > .field:not(.model-field):not(.scroll-field) > label,
  .bmw-radio-preview.model-reverse #fields > .field:not(.model-field):not(.scroll-field) > label > span{
    display:block!important;visibility:visible!important;opacity:1!important;
  }
  .bmw-radio-preview.model-reverse #fields > .field:not(.model-field):not(.scroll-field) > .bmw-inline-glyph-wrap > input{
    padding-left:62px!important;padding-right:48px!important;text-align:left!important;
  }
}

/* v1.0.37 — mobile-only: move model dropdown chevron in from the edge.
   Native arrows ignore background-position, so draw a controlled chevron. */
@media (max-width:850px){
 .bmw-radio-preview .model-field select{
  -webkit-appearance:none!important;appearance:none!important;
  padding-right:42px!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;background-position:right 11px center!important;
  background-size:16px 16px!important;
 }
}

/* v1.0.42: input-only corrections. Keep a stable font size whether a
   special glyph is present or not, and start Reverse RDS text at the left. */
@media (min-width:851px){
  .bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) > .bmw-inline-glyph-wrap > input{
    font-size:18px!important;
  }
  .bmw-radio-preview.model-reverse #fields > .field:not(.model-field):not(.scroll-field) > .bmw-inline-glyph-wrap > input{
    text-align:left!important;
    padding-left:62px!important;
    padding-right:48px!important;
  }
}
@media (max-width:850px){
  .bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) > .bmw-inline-glyph-wrap > input{
    font-size:15px!important;
  }
}
/* The hidden input's native selection must never reveal placeholder glyphs.
   The visible overlay remains responsible for drawing actual characters. */
.bmw-radio-preview .bmw-inline-glyph-input::selection{
  color:transparent!important;
  -webkit-text-fill-color:transparent!important;
}

/* v1.0.43: one consistent visual renderer for plain text and special symbols.
   Input remains the actual editable/selectable control. The overlay never
   intercepts mouse or touch events. */
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-wrap > input{
  font-family:monospace!important;
  font-kerning:none!important;
  font-variant-ligatures:none!important;
  letter-spacing:0!important;
  line-height:normal!important;
  text-align:left!important;
  color:transparent!important;
  -webkit-text-fill-color:transparent!important;
  caret-color:transparent!important;
}
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay{
  font-family:monospace!important;
  font-kerning:none!important;
  font-variant-ligatures:none!important;
  letter-spacing:0!important;
  line-height:normal!important;
  text-align:left!important;
  pointer-events:none!important;
}
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-glyph-cell{
  line-height:normal!important;
  height:auto!important;
  vertical-align:baseline!important;
}
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-glyph-cell.bmw-glyph-selected{
  background-color:#2878ce!important;
  color:white!important;
}
.bmw-radio-preview .bmw-inline-glyph-overlay .bmw-glyph-cell.bmw-glyph-selected.bmw-inline-glyph{
  background-color:#2878ce!important;
}

/* v1.0.44: glyph cell and ordinary letters must use the exact same
   monospace font metrics. The previous 1ch cells inherited theme font
   rules on spans, making normal characters overlap. */
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-wrap > input,
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay,
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay .bmw-glyph-cell{
  font-family:"Courier New",Courier,monospace!important;
  font-weight:400!important;
  font-style:normal!important;
  font-stretch:normal!important;
  font-kerning:none!important;
  font-variant-ligatures:none!important;
  letter-spacing:0!important;
  text-transform:none!important;
}
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay .bmw-glyph-cell{
  font-size:inherit!important;
  line-height:inherit!important;
  width:1ch!important;min-width:1ch!important;max-width:1ch!important;
  white-space:pre!important;
  overflow:visible!important;
}
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay .bmw-glyph-cell.bmw-inline-glyph{
  background-size:calc(1ch - 1px) 0.98em!important;
  background-position:center center!important;
}

/* v1.0.45: restore the site's regular field typography. Text cells take
   their natural width; only bitmap symbols reserve one glyph advance.
   Both are vertically centered in the existing input rectangle. */
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-wrap > input,
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay,
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay .bmw-glyph-cell{
  font-family:Inter,Arial,Helvetica,sans-serif!important;
  font-weight:400!important;
  font-style:normal!important;
  letter-spacing:0!important;
}
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay{
  display:flex!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  line-height:normal!important;
}
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay .bmw-glyph-cell{
  display:inline-block!important;
  flex:0 0 auto!important;
  width:auto!important;min-width:0!important;max-width:none!important;
  height:auto!important;
  line-height:normal!important;
  vertical-align:baseline!important;
}
.bmw-radio-preview #fields > .field:not(.model-field):not(.scroll-field) .bmw-inline-glyph-overlay .bmw-glyph-cell.bmw-inline-glyph{
  width:1ch!important;min-width:1ch!important;max-width:1ch!important;
  background-size:calc(1ch - 1px) 0.9em!important;
  background-position:center center!important;
}

/* v1.0.47: allow normal vertical page scrolling over animation character cells on touch devices. */
@media (pointer: coarse) {
  .bmw-radio-preview input.bmw-animation-grid-cell {
    touch-action: pan-y !important;
  }
}

/* Grid cells represent atomic characters: never show a text caret. */
.bmw-radio-preview input.bmw-animation-grid-cell,
.bmw-radio-preview input.bmw-animation-grid-cell.bmw-grid-glyph{caret-color:transparent!important;}

/* Keep mobile range selection on the grid, not native input text selection. */
.bmw-animation-grid-cell::selection{background:transparent!important;}

/* Suppress native page text selection during long press on animation cells. */
.bmw-animation-grid-cell{-webkit-touch-callout:none;}

/* v1.0.59: re-enable the actual mobile selection toolbar.
   A legacy !important rule hid it even though its JS handlers existed. */
@media (pointer:coarse){
 .bmw-radio-preview .bmw-grid-mobile-tools{display:flex!important;flex-wrap:wrap;gap:5px;}
 .bmw-radio-preview .bmw-grid-mobile-tools button{touch-action:manipulation;}
}

.bmw-grid-selection-actions{position:fixed;z-index:2147483000;display:flex;gap:6px;padding:6px;background:#f7f5ef;border:1px solid #a8a49b;border-radius:9px;box-shadow:0 3px 14px #0003;max-width:calc(100vw - 16px)}
.bmw-grid-selection-actions[hidden]{display:none!important}
.bmw-grid-selection-actions button{font:14px Arial,sans-serif;color:#111;background:#fff;border:1px solid #aaa;border-radius:6px;padding:9px 12px;touch-action:manipulation}
@media(pointer:fine){.bmw-grid-selection-actions{display:none!important}}

/* Keep toolbar taps from triggering viewport changes while selecting. */
@media(pointer:coarse){.bmw-radio-preview .bmw-grid-mobile-tools button{touch-action:manipulation!important}}

@media(pointer:coarse){
 .bmw-radio-preview input.bmw-animation-grid-cell{
  touch-action:pan-y !important;
  -webkit-touch-callout:none !important;
 }
}

/* Keep normal scrolling; only explicit range selection disables pan. */
@media(pointer:coarse){.bmw-grid-selecting .bmw-animation-grid-cell{touch-action:none!important;user-select:none!important;-webkit-user-select:none!important}}

/* v1.0.69: one definitive touch policy. Scroll in edit mode,
   capture movement only after Select is explicitly armed. */
@media (pointer:coarse){
 .bmw-radio-preview .bmw-animation-grid input.bmw-animation-grid-cell{
   touch-action:pan-y!important;
   -webkit-touch-callout:none!important;
 }
 .bmw-radio-preview .bmw-animation-grid.bmw-grid-selecting input.bmw-animation-grid-cell{
   touch-action:none!important;
   -webkit-user-select:none!important;
   user-select:none!important;
 }
}

/* v1.0.70: grid is an atomic-character editor; native Android selection handles
   must not compete with the application's range selection. */
@media (pointer:coarse){
 .bmw-radio-preview .bmw-animation-grid,
 .bmw-radio-preview .bmw-animation-grid .bmw-animation-grid-cell{
   -webkit-user-select:none!important;
   user-select:none!important;
   -webkit-touch-callout:none!important;
 }
}

/* v1.0.74: Never let long-press select headings/text outside the animation grid.
   Pan-y remains enabled for normal one-finger page scrolling. */
@media(pointer:coarse){
 .bmw-animation-grid, .bmw-animation-grid *{
  -webkit-user-select:none!important;user-select:none!important;
  -webkit-touch-callout:none!important;
 }
}

/* While grid selection is active, Android must not select headings or textareas.
   The rule is temporary and removed on Cancel/Copy/outside tap. */
@media(pointer:coarse){
 html.bmw-mobile-grid-selection,
 html.bmw-mobile-grid-selection body,
 html.bmw-mobile-grid-selection body *{
  -webkit-user-select:none!important;
  user-select:none!important;
  -webkit-touch-callout:none!important;
 }
 html.bmw-mobile-grid-selection .bmw-animation-grid .bmw-animation-grid-cell{
  caret-color:transparent!important;
 }
}

/* v1.0.76: non-input mobile selection surface, isolated from keyboard focus. */
.bmw-animation-grid{position:relative}
.bmw-mobile-selection-overlay{position:absolute;inset:0;z-index:15;pointer-events:none}
.bmw-mobile-select-target{position:absolute;pointer-events:auto;touch-action:none!important;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important;background:transparent}
@media(pointer:fine){.bmw-mobile-selection-overlay{display:none!important}}

/* CD43: size the two columns from each image's natural aspect ratio.
   This makes both images equally tall without cropping or stretching either. */
.bmw-radio-preview.model-business_cd .model-info h3{font-weight:700;}
.bmw-radio-preview.model-business_cd .model-info-images.cd43-info-images{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:12px;
  width:100%!important;
  max-width:none!important;
  margin:0 0 30px!important;
  align-items:start;
}
.bmw-radio-preview.model-business_cd .cd43-info-images > a{
  display:block!important;
  width:100%!important;
  min-width:0;
  max-width:none!important;
  cursor:pointer!important;
}
.bmw-radio-preview.model-business_cd .cd43-info-images > a > img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-width:100%!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  cursor:pointer!important;
}
.cd43-image-lightbox{
  position:fixed;inset:0;z-index:2147483647;background:rgba(0,0,0,.88);
  display:flex;align-items:center;justify-content:center;padding:40px 22px;
  box-sizing:border-box;cursor:zoom-out;
}
.cd43-image-lightbox img{
  display:block;max-width:100%;max-height:calc(100vh - 80px);width:auto;height:auto;
  object-fit:contain;cursor:default;
}
.cd43-image-lightbox .cd43-lightbox-close{
  position:absolute;right:14px;top:10px;border:0;background:transparent;color:white;
  font:normal 38px/1 Arial,sans-serif;cursor:pointer;padding:8px 14px;
}
@media(max-width:700px){
  .bmw-radio-preview.model-business_cd .model-info-images.cd43-info-images{grid-template-columns:1fr!important;}
}

/* v1.0.87: Scrolling text only. The special-symbol overlay previously gave
   every ordinary character a fixed 1ch cell even with a proportional font,
   making typed text look as though spaces were being inserted. Match the
   existing natural-width behavior of A/B/C/D without changing the token model. */
.bmw-radio-preview #scroll_text + .bmw-inline-glyph-overlay .bmw-glyph-cell{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
}
.bmw-radio-preview #scroll_text + .bmw-inline-glyph-overlay .bmw-glyph-cell.bmw-inline-glyph{
  width:1ch!important;
  min-width:1ch!important;
  max-width:1ch!important;
}
