/* Shared flow frame: the close button no longer adds an empty row above the title. */
#dialog[open]{display:flex;flex-direction:column;overflow:hidden}
#dialog{max-height:calc(var(--flow-height,100vh) - 16px)}
.dialog-close-bar{position:relative;z-index:6;height:0;flex:0 0 0}
#dialog .close{position:absolute;top:6px;right:6px;float:none;margin:0;width:44px;height:44px;min-height:44px}
#dialog .modal-inner{clear:none;flex:1 1 auto;min-height:0;width:100%;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px 16px 18px;scroll-padding-top:52px}
#dialogTitle{padding-right:42px;margin:6px 0 10px;font-size:20px;line-height:1.4}
#dialog .modal-inner>.tag{display:inline-block;max-width:calc(100% - 48px);font-size:11px;padding:3px 7px;line-height:1.4}
.flow-actions[hidden]{display:none}
.flow-actions{flex:0 0 auto;padding:9px 14px 10px;background:#fffaf6;border-top:1px solid #ecd8cb;box-shadow:0 -4px 12px #39242608;z-index:5}
.flow-actions .primary{width:100%;margin:0;min-height:48px;font-size:16px;padding:12px;line-height:1.5}
#dialog[data-screen="detail"] .detail-image{height:145px;border-radius:12px}
#dialog[data-screen="detail"] .price-strip{padding:8px 11px;margin:9px 0}
#dialog[data-screen="detail"] .price-strip b{font-size:25px}
#dialog[data-screen="detail"] .price-strip p{margin:3px 0 0;line-height:1.45}
#dialog[data-screen="detail"] .variant-label{margin:11px 0 6px}
#dialog[data-screen="detail"] .color-pick{min-height:73px;padding:5px;font-size:12px}
#dialog[data-screen="detail"] .color-pick img{height:45px;margin-bottom:4px}
#dialog[data-screen="detail"] .config-select{min-height:44px;font-size:16px;padding:10px}
#dialog[data-screen="detail"] .muted{font-size:12px;line-height:1.6;margin:10px 0}
#dialog[data-screen="detail"] .selection-card{font-size:12px;padding:10px;margin-top:8px}
#dialog[data-screen="detail"] .welcome-reminder{margin-top:10px;min-height:44px}
#dialog[data-screen="claim"] #dialogTitle{margin-bottom:12px}
.checkout-selection{display:flex;align-items:center;padding:9px;font-size:12px;line-height:1.55}
.checkout-selection img{flex:none;width:54px;height:60px;margin-right:10px}
.checkout-selection>div{min-width:0;overflow-wrap:break-word}
#dialog[data-screen="claim"] .price-strip{padding:8px 11px;margin:10px 0;font-size:12px}
#dialog[data-screen="claim"] .price-strip>div{min-height:23px}
#dialog[data-screen="claim"] .price-strip b{font-size:15px}
#dialog[data-screen="claim"] .price-strip>div:nth-child(3){border-top:1px solid #edcdbc;margin-top:5px;padding-top:6px;font-weight:700}
#dialog[data-screen="claim"] .price-strip>div:nth-child(3) b{font-size:23px}
#dialog[data-screen="claim"] .price-strip p{margin:4px 0 0;font-size:11px;line-height:1.5}
#dialog[data-screen="claim"] .muted{font-size:12px;line-height:1.6;margin:9px 0}
#claimForm .form-field{font-size:13px;margin:11px 0}
#claimForm input:not([type="checkbox"]),#claimForm textarea{font-size:16px;min-height:44px;padding:10px;margin-top:5px;scroll-margin-top:54px;scroll-margin-bottom:16px}
#claimForm .consent{font-size:12px;line-height:1.6;margin:12px 0}
#claimForm .status:empty{min-height:0;margin:0}
#claimForm .status:not(:empty){padding:10px;background:#eaf4e8;border-radius:8px}
/* Compact teaching proportions keep the copy action visible before any scrolling. */
#dialog[data-screen="guide"] .guide-benefit{padding:9px 12px;margin:9px 0;gap:5px;line-height:1.5}
#dialog[data-screen="guide"] .guide-total{padding-top:6px;margin-top:0}
#dialog[data-screen="guide"] .guide-total b{font-size:22px}
.teaching-guide{margin:9px 0}
.tutorial-stage{height:256px;padding:8px 16px 0}
.tutorial-phone{width:228px;max-width:100%;transform:scale(.88);transform-origin:top center}
.tutorial-actions{padding:8px 9px 0}
.tutorial-actions #copy{min-height:46px;font-size:14px;font-weight:800}
.tutorial-control{min-height:46px}
.tutorial-caption{min-height:94px;padding:9px 10px 3px}
.tutorial-caption h3{font-size:14px;margin:1px 0 3px}
.tutorial-caption p{font-size:12px;line-height:1.55}
.tutorial-step-nav{margin-top:1px;margin-bottom:4px}
.tutorial-manual-copy{padding-bottom:4px}
.guide-retained{font-size:12px;line-height:1.6;margin:10px 0}
@media(max-width:700px){
  #dialog,#dialog.polyfilled-dialog{top:4px;top:calc(var(--flow-offset,0px) + 4px + env(safe-area-inset-top,0px));bottom:auto;transform:none;width:calc(100% - 8px);max-width:560px;max-height:calc(var(--flow-height,100vh) - 8px);max-height:calc(var(--flow-height,100vh) - 8px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));border-radius:17px}
  #dialog[data-screen="detail"],#dialog[data-screen="claim"],#dialog[data-screen="guide"]{height:calc(var(--flow-height,100vh) - 8px);height:calc(var(--flow-height,100vh) - 8px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
  #dialog .modal-inner{padding:12px 12px 16px}
  #dialogTitle{font-size:19px;margin-top:5px;margin-bottom:9px}
  .flow-actions{padding:8px 12px 9px}
  #rewardDialog{max-height:calc(var(--flow-height,100vh) - 12px)}
  .tutorial-stage{height:238px}
  .tutorial-phone{transform:scale(.81)}
  header{margin-bottom:9px}
  .searchrow{margin-bottom:4px}
  .tabs{padding-top:6px;padding-bottom:6px}
  .pic{height:134px}
  .card:hover{transform:none}
  .flow-short .pic{height:118px}
  .flow-short .body{padding:10px}
  .flow-short .body h3{min-height:39px}
  .flow-short .card-meta{margin-bottom:6px}
  .flow-short #dialog[data-screen="detail"] .detail-image{height:108px}
  .flow-short #dialog[data-screen="detail"] .color-pick img{height:38px}
  .flow-short .tutorial-stage{height:204px}
  .flow-short .tutorial-phone{transform:scale(.69)}
  .flow-short .tutorial-caption{min-height:88px}
  .flow-short .tutorial-caption p{line-height:1.5}
  .flow-short #rewardContent{padding:12px 18px}
  .flow-short .coupon-success-mark{height:32px;width:40px;margin:12px auto 2px}
  .flow-short .coupon-success-mark svg{width:32px;height:32px}
  .flow-short .reward-eyebrow{margin:2px 0 5px}
  .flow-short #rewardTitle{font-size:23px}
  .flow-short .reward-sub{font-size:13px;margin:5px 0 8px}
  .flow-short .reward-ticket{padding:8px 10px 0}
  .flow-short .reward-ticket>strong{font-size:44px;margin:2px 0 6px}
  .flow-short .reward-ticket small{font-size:22px;vertical-align:12px}
  .flow-short .reward-product{margin:8px 0;padding:6px}
  .flow-short .reward-product>img{height:36px;width:36px}
  .flow-short .coupon-next-step{font-size:12px;margin:6px 0 8px}
  .flow-short .reward-back{margin-top:2px;padding:6px;min-height:44px}
  .flow-short .reward-preview{font-size:10px;line-height:1.5;padding:3px 6px}
  .flow-tiny .tutorial-stage{height:174px}
  .flow-tiny .tutorial-phone{transform:scale(.59)}
}
@media(max-width:359px){
  .pic,.flow-short .pic{height:100%;min-height:184px}
  #dialog .modal-inner{padding-left:10px;padding-right:10px}
  .tutorial-actions #copy{font-size:13px}
}
/* Submission states share the same bounded mobile frame as the checkout form. */
.order-state{padding:18px 4px 14px;text-align:center;outline:none}
.order-mode{display:inline-block;padding:5px 10px;background:#f8e8dd;color:#a5534e;border-radius:30px;font-size:12px;line-height:1.4}
.order-state h2{font-size:25px;line-height:1.4;margin:18px 0 7px;color:#392426}
.order-state-help{font-size:14px;line-height:1.7;color:#806b67;margin:0 auto 16px;max-width:310px}
.order-countdown{position:relative;width:148px;height:148px;margin:22px auto 24px}
.order-countdown svg{width:100%;height:100%;transform:rotate(-90deg)}
.order-countdown circle{fill:none;stroke-width:7}
.order-ring-track{stroke:#f1e2d8}
.order-ring-fill{stroke:#e74142;stroke-dasharray:390;stroke-dashoffset:390;stroke-linecap:round;transition:stroke-dashoffset .1s linear}
.order-countdown>div{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;flex-direction:column}
.order-countdown strong{font:bold 52px/1.1 Arial;color:#d5353e;font-variant-numeric:tabular-nums}
.order-countdown span{font-size:13px;color:#8c7067;margin-top:5px}
.order-stages{display:flex;list-style:none;padding:0;margin:0 0 18px;counter-reset:order-step}
.order-stages li{flex:1;min-width:0;font-size:12px;line-height:1.5;color:#917e74;counter-increment:order-step}
.order-stages li:before{content:counter(order-step);display:block;width:28px;height:28px;line-height:28px;background:#f1e6de;color:#927469;border-radius:50%;margin:0 auto 7px;font-weight:700}
.order-stages .is-current{color:#b63c43;font-weight:700}
.order-stages .is-current:before{background:#e74142;color:#fff;box-shadow:0 0 0 5px #e7414212;animation:order-pulse 1.2s ease-in-out infinite}
.order-stages .is-done:before{content:'✓';background:#e5efe3;color:#47724d}
.order-state-note{font-size:12px;line-height:1.6;color:#8b756b;min-height:38px;margin:0}
.order-success-symbol{width:94px;height:94px;margin:25px auto 10px;animation:order-appear .35s ease-out both}
.order-success-symbol svg{width:100%;height:100%}.order-success-symbol circle{fill:#e7f0e4;stroke:#ccdfc7;stroke-width:1}
.order-success-symbol path{fill:none;stroke:#4d7b51;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:52;stroke-dashoffset:52;animation:order-check .45s .1s ease-out forwards}
.order-state-success .checkout-selection{text-align:left;margin:20px 0 0}
.order-reference{font-size:12px;line-height:1.8;color:#806b67;overflow-wrap:anywhere}
@keyframes order-pulse{50%{box-shadow:0 0 0 8px #e7414209}}
@keyframes order-appear{from{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}
@keyframes order-check{to{stroke-dashoffset:0}}
@media(max-width:700px){#dialog[data-screen="creating"],#dialog[data-screen="order-success"]{height:calc(var(--flow-height,100vh) - 8px);height:calc(var(--flow-height,100vh) - 8px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}}
@media(max-height:620px){.order-state{padding-top:10px}.order-countdown{width:134px;height:134px;margin:18px auto}.order-state h2{font-size:24px;margin-top:14px}.order-state-help{font-size:13px}.order-success-symbol{width:80px;height:80px;margin-top:18px}}
@media(prefers-reduced-motion:reduce){.order-stages .is-current:before,.order-success-symbol,.order-success-symbol path{animation:none}.order-success-symbol path{stroke-dashoffset:0}.order-ring-fill{transition:none}}
