/* ---------- 2D editor: tools float over the canvas (no solid strip) ---------- */
body.pro-editor .pro-2d{position:relative}
body.pro-editor .pro-2d>.pro-bottom{position:absolute!important;left:0;right:0;bottom:14px;z-index:30;min-height:0!important;padding:0 12px!important;border:0!important;background:transparent!important;pointer-events:none;flex-wrap:nowrap!important;gap:8px!important}
body.pro-editor .pro-2d>.pro-bottom>*{pointer-events:auto}
body.pro-editor .pro-2d>.pro-bottom>span{display:none!important}
body.pro-editor .pro-2d>.pro-bottom .floating-tools{flex-wrap:nowrap!important;gap:8px!important}
body.pro-editor .pro-2d>.pro-bottom :where(.zoom-controls,.segmented){box-shadow:0 2px 10px #1f1d3514,0 0 0 1px #0000000d;background:#fffffff2!important;backdrop-filter:blur(6px)}
body.pro-editor .pro-2d>div:nth-child(2){flex:1;min-height:0}

/* ---------- Give feedback: icon only ---------- */
a.give-feedback.fb-rail,a.give-feedback.fb-header{display:grid!important;place-items:center;width:40px!important;height:40px!important;padding:0!important;border-radius:12px!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#6b6b78!important;font-size:0!important;text-decoration:none}
a.give-feedback.fb-rail svg,a.give-feedback.fb-header svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
a.give-feedback.fb-rail:hover,a.give-feedback.fb-header:hover{background:#f1f0f6!important;color:#24242c!important}
body.pro-editor a.give-feedback.fb-rail{position:absolute!important;left:50%!important;right:auto!important;bottom:14px!important;transform:translateX(-50%);width:44px!important}
body.pro-editor .pro-rail{position:relative}
a.give-feedback.fb-header{position:static!important;margin-right:4px}

/* ---------- Dialog close buttons: one consistent circle ---------- */
.fb-dialog .fb-close,.modal-head button[aria-label="Close dialog"],.mobile-desktop-sheet .sheet-close{width:36px!important;height:36px!important;min-width:36px;padding:0!important;border:0!important;border-radius:50%!important;background:var(--field,#f4f4f4)!important;color:#3a3a44!important;display:grid!important;place-items:center!important;font:400 22px/1 var(--font-ui,Inter,sans-serif)!important;cursor:pointer}
.fb-dialog .fb-close:hover,.modal-head button[aria-label="Close dialog"]:hover,.mobile-desktop-sheet .sheet-close:hover{background:#e9e8ef!important}
.fb-dialog .fb-close:focus-visible,.modal-head button[aria-label="Close dialog"]:focus-visible,.mobile-desktop-sheet .sheet-close:focus-visible{outline:2px solid var(--accent,#5e67e6);outline-offset:2px}
dialog:focus{outline:none}

/* ---------- Feedback: line-art smiley ratings that look tappable ---------- */
.fb-dialog .fb-seg{gap:8px!important;padding:0!important;background:none!important}
.fb-dialog .fb-seg span{flex-direction:column;gap:6px;min-height:0!important;padding:12px 4px 10px!important;border:1.5px solid #e4e3ea;border-radius:14px!important;background:#fff;color:#6c6b78!important;transition:border-color .15s,background .15s,color .15s}
.fb-dialog .fb-seg span em{font-style:normal;font-size:12px;font-weight:500;line-height:1.2}
.fb-dialog .fb-seg .fb-face{width:30px!important;height:30px!important;fill:none;stroke:currentColor;stroke-width:1.5!important}
.fb-dialog .fb-seg label:hover span{border-color:#c9c4fb;color:var(--ink,#303030)!important}
.fb-dialog .fb-seg input:checked+span{border-color:var(--accent,#5e67e6);background:var(--accent-soft,#f0efff)!important;color:var(--accent,#5e67e6)!important;box-shadow:none!important}

/* ---------- Popups fit the screen: no scrolling ---------- */
@media (max-width:760px){
  dialog.fb-dialog{max-height:none!important;overflow:visible!important}
  .fb-dialog form,.fb-dialog .fb-done{gap:12px!important;padding:20px 18px calc(14px + env(safe-area-inset-bottom))!important}
  .fb-dialog h2{font-size:26px!important;padding-right:44px}
  .fb-dialog .fb-sub{font-size:13px!important;margin-top:4px!important}
  .fb-dialog .fb-close{top:14px!important;right:14px!important}
  .fb-dialog .fb-seg{grid-template-columns:repeat(4,1fr)!important;gap:6px!important}
  .fb-dialog .fb-seg span{padding:9px 2px 8px!important}
  .fb-dialog .fb-seg span em{font-size:11px}
  .fb-dialog .fb-seg .fb-face{width:26px!important;height:26px!important}
  .fb-dialog textarea{min-height:52px!important;height:52px;padding:8px 12px!important}
  .fb-dialog input[type=email]{height:40px!important}
  .fb-dialog legend,.fb-dialog .fb-l{margin-bottom:6px!important}
  .fb-dialog .fb-send{height:44px!important}
}

/* ---------- Mobile preview: header, zoom icons, Studio sheet ---------- */
.mp-home{display:grid;place-items:center;width:40px;height:40px;border-radius:12px}
.mp-home img{width:28px!important;height:28px!important;max-width:none;object-fit:contain;display:block}
main>header button[data-desktop] small{display:inline-flex;align-items:center;gap:3px}
.flat-zoom-controls button svg{width:18px;height:18px;fill:none!important;stroke:currentColor!important;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;display:block}
.flat-zoom-controls button{color:var(--ink,#303030)}
@media (max-width:760px){
  .studio-pop{position:fixed!important;left:0!important;right:0!important;top:auto!important;bottom:0!important;width:auto!important;border-radius:22px 22px 0 0!important;padding:10px 18px calc(16px + env(safe-area-inset-bottom))!important;box-shadow:0 -10px 30px #1d1b301f!important;display:grid;grid-template-columns:1fr;gap:0}
  .studio-pop::before{content:"";justify-self:center;width:36px;height:4px;border-radius:2px;background:#d9d8df;margin-bottom:12px}
  .studio-pop .studio-label{margin-bottom:6px!important}
  .studio-pop .studio-label+*{margin-bottom:12px!important}
  .studio-pop .studio-swatches{grid-template-columns:repeat(6,34px)}
  .studio-pop .studio-swatches button,.studio-pop .studio-custom{width:34px;height:34px}
  .studio-pop .studio-reset{display:none}
}
/* Mobile mockup / unfolded loaders use the folding box too */
.mobile-media-stage.preview-loading{display:grid;place-items:center}

/* Narrow desktops (≈1000–1200px): keep buttons on one line and the header uncrowded */
.flat-zoom-controls button{white-space:nowrap}
@media (max-width:1200px) and (min-width:761px){
  body.workflow-page main>header{gap:10px!important;padding:0 16px!important}
  body.workflow-page main>header nav span,body.workflow-page main>header .workflow-arrow{display:none!important}
  body.workflow-page main>header nav{gap:2px!important}
  body.workflow-page main>header nav :where(a,button){padding-left:10px!important;padding-right:10px!important}
  body.workflow-page main>header :where(button,a):not(.workflow-emblem){font-size:13px!important}
}
@media (max-width:1100px) and (min-width:761px){
  body.workflow-page main>header{grid-template-columns:minmax(0,1fr) auto auto!important}
  body.workflow-page main>header :where(button,a):not(.workflow-emblem){font-size:12.5px!important;padding-left:10px!important;padding-right:10px!important}
  body.workflow-page main>header .workflow-save-status{display:none!important}
}
/* "Make this box yours" fits short laptop screens without scrolling */
@media (max-height:760px) and (min-width:761px){
  #dialog .modal-head{padding-top:14px!important;padding-bottom:12px!important}
  #dialog .modal-body{padding-top:12px!important;padding-bottom:8px!important}
  #dialog .modal-body>p:first-child{margin:0 0 8px!important}
  #dialog .clone-size{margin:6px 0 10px!important;padding:8px 12px!important}
  #dialog .starter-options.starter-tiles{margin:10px 0 6px!important}
  #dialog .starter-options.starter-tiles .starter-thumb{height:78px}
  #dialog .modal-body>.helper{display:none}
  #dialog .modal-foot{padding-top:10px!important;padding-bottom:14px!important}
}

/* Reset view (3D, everywhere): visible only after the view changes */
.flat-zoom-controls>button{transition:opacity .2s}
:not(.view-changed)>.flat-zoom-controls>button:nth-child(4){opacity:0;pointer-events:none}

/* Rotate icon sits inline before "Drag to rotate" (cards keep their corner icon) */
.preview-model-stage .rotation-symbol,.fold-home .viewer-stage .rotation-symbol{display:none!important}
.preview-model-stage .stage-hint,.fold-home .viewer-stage .hint{display:flex!important;align-items:center;justify-content:center;gap:6px}
.preview-model-stage .stage-hint::before,.fold-home .viewer-stage .hint::before{content:"";width:22px;height:18px;flex:none;background:currentColor;-webkit-mask:url(rotation-hint.svg) center/contain no-repeat;mask:url(rotation-hint.svg) center/contain no-repeat}

/* Focus rings only for keyboard users, not after mouse clicks */
:where(button,a,[role=button],[tabindex]):focus:not(:focus-visible){outline:none!important}
.fold-home .viewer-stage .vw-sun:focus:not(:focus-visible){outline:none!important;box-shadow:0 2px 8px #0000001a!important}

/* Desktop dialogs: a calm × (circle only on hover) */
@media (min-width:761px){
  .fb-dialog .fb-close,.modal-head button[aria-label="Close dialog"]{background:transparent!important}
  .fb-dialog .fb-close:hover,.modal-head button[aria-label="Close dialog"]:hover{background:#f1f0f5!important}
}
