/* LYDIAN V21.6.8 CUSTOMER DESIGN STUDIO — responsive pilot styles only.
   Does not affect /studio/mobile/ (employee app), pricing, orders, or the bank. */
@media (max-width: 650px) {
  html { scroll-padding-top: 118px; }
  html, body { max-width: 100%; overflow-x: clip; }
  .site-header { padding-inline: 12px; }
  .brand { min-width: 0; }
  .brand > span { min-width: 0; }
  .brand-main { overflow-wrap: anywhere; white-space: normal; }

  /* Sticky price is readable in a narrow viewport without covering navigation. */
  .live-price-strip { top: 0; z-index: 39; }
  .live-price-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 12px; }
  .live-price-main { min-width: 0; width: 100%; gap: 3px; }
  .price-eyebrow { font-size: 9px; letter-spacing: .07em; }
  #livePriceAmount { font-size: clamp(21px, 5.5vw, 27px); line-height: 1.15; overflow-wrap: anywhere; }
  #livePriceNote { max-width: none; font-size: 10px; line-height: 1.35; }
  #engravingLineMeter { font-size: 10px; line-height: 1.4; }
  .live-price-side { min-width: 0; flex-shrink: 0; }
  .price-details-toggle { min-height: 44px; padding: 10px 8px; font-size: 11px; }
  .price-details-panel { max-height: 48dvh; overflow-y: auto; overscroll-behavior: contain; }
  .live-detail-row { min-width: 0; }
  .live-detail-row > span { min-width: 0; overflow-wrap: anywhere; }
  .live-detail-row > strong { max-width: 48%; overflow-wrap: anywhere; }

  .site-main { padding: 12px 8px 12px; }
  .studio-shell { width: 100%; max-width: 100%; }
  .view-panel { padding: 12px 12px 10px; overflow: hidden; }
  .preview-top { gap: 8px; flex-wrap: wrap; }
  .preview-top > span:first-child { max-width: 55%; line-height: 1.4; }
  #mobilePreviewToggle { min-height: 42px; padding: 8px 11px; }
  .preview-stage { min-height: 178px; }
  .preview-scene { height: 176px; width: 100%; max-width: 100%; }
  .stone3d { width: min(75%, 255px); }
  .stone3d.square { width: min(66%, 200px); }
  .stone-words { padding: 7px 3px; gap: 3px; }
  .stone-words.with-photo { padding-left: 35%; padding-right: 3%; }
  .stone-name { font-size: clamp(15px, 4.6vw, 19px); line-height: 1.1; }
  .stone-words.with-photo .stone-name { font-size: clamp(12px, 3.7vw, 16px); }
  .stone-dates { font-size: 9px; }
  .stone-words.with-photo .stone-dates { font-size: 8px; }
  .stone-dedication { font-size: 10px; line-height: 1.2; max-width: 96%; }
  .stone-words.with-photo .stone-dedication { font-size: 9px; }
  .portrait-frame { max-width: 29%; }
  .preview-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; }
  .view-toggle { gap: 5px; }
  .mini-btn { min-height: 40px; padding: 8px 10px; }
  .zoom-tools { width: min(41%, 155px); min-width: 100px; }
  .zoom-tools input { min-height: 28px; }
  .view-panel.mobile-closed .preview-stage,
  .view-panel.mobile-closed .preview-tools,
  .view-panel.mobile-closed .preview-footer { display: none; }

  .question-panel { min-width: 0; padding: 18px 14px 16px; }
  .question-viewport { min-width: 0; overflow-wrap: anywhere; }
  .question-headline { font-size: clamp(24px, 6.8vw, 30px); }
  .question-sub { line-height: 1.6; margin-bottom: 16px; }
  .question-viewport input:not([type='checkbox']):not([type='radio']),
  .question-viewport textarea,
  .question-viewport select { max-width: 100%; }
  .form-row, .form-row.three { grid-template-columns: minmax(0,1fr); }
  .form-field { min-width: 0; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid > * { min-width: 0; overflow-wrap: anywhere; }
  .price-line { gap: 9px; }
  .price-line > span { min-width: 0; overflow-wrap: anywhere; }
  .price-line > strong { flex-shrink: 0; }
  .checkout-emphasis, .summary-box, .price-box, .plan-payment-breakdown { max-width: 100%; }
  .upload-surface { min-height: 104px; padding: 15px 12px; }
  .upload-surface b { font-size: 21px; line-height: 1.25; }
  .status-good { overflow-wrap: anywhere; line-height: 1.5; }

  /* Step 7 portrait editing: large usable choices and a slider without horizontal overflow. */
  #v2167PortraitBackground { display: block; margin: 15px 0; min-width: 0; }
  #v2167PortraitBackground h3 { margin: 0 0 8px; }
  #v2167PortraitBackground .small-muted { font-size: 12px; line-height: 1.55; }
  #v2167PortraitBackground .choice-grid { display: grid; grid-template-columns: minmax(0,1fr) !important; gap: 9px; width: 100%; }
  #v2167PortraitBackground .select-tile { min-width: 0; width: 100%; min-height: 98px !important; padding: 43px 14px 12px !important; overflow-wrap: anywhere; }
  #v2167PortraitBackground .select-tile strong { font-size: 14px; }
  #v2167PortraitBackground .select-tile small { font-size: 12px; line-height: 1.4; }
  #v2167PortraitBackground .range-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: center; }
  #v2167PortraitBackground .range-row label { width: auto; grid-column: 1 / -1; font-size: 13px; }
  #v2167PortraitBackground .range-row input { width: 100%; min-width: 0; grid-column: 1; min-height: 36px; }
  #v2167PortraitBackground .range-row output { grid-column: 2; min-width: 35px; }

  /* Bottom actions remain above the dedicated 3-tab customer bar. */
  .nav-bottom { display: flex; gap: 8px; justify-content: space-between; position: sticky; bottom: calc(88px + env(safe-area-inset-bottom)) !important; z-index: 9; padding: 10px 0; background: #fffefa; }
  .back-button, .continue-button { min-height: 46px; }
  .continue-button { min-width: 122px; }
  .v205-mobile-tabs { z-index: 70; }
  .v205-mobile-tabs button { min-height: 48px; }
  .v205-chat-panel { max-height: calc(100dvh - 102px); }
}
@media (max-width: 360px) {
  .live-price-inner { padding-inline: 9px; gap: 5px; }
  .price-details-toggle { font-size: 10px; padding-inline: 7px; }
  #livePriceAmount { font-size: 20px; }
  .question-panel { padding-inline: 11px; }
  .studio-shell { border-radius: 10px; }
  .view-panel { padding-inline: 10px; }
  .zoom-tools { width: 100%; }
}
@media (min-width: 651px) and (max-width: 1000px) {
  .question-panel { min-height: 0; }
  #v2167PortraitBackground .choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .studio-shell { max-width: 100%; }
  .preview-stage { min-height: 235px; }
  .preview-scene { max-height: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  #v2167PortraitBackground .select-tile { transition: none; }
}
