/* Shared customer pages on narrow screens. */
@media (max-width: 809px) {
  footer.framer-site-footer {
    height: auto;
    min-height: 0;
    padding: 36px clamp(16px, 5vw, 32px) max(16px, env(safe-area-inset-bottom));
  }

  footer.framer-site-footer [data-bottom-reveal] {
    opacity: 1;
    transform: none;
  }

  footer.framer-site-footer .framer-footer-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    height: auto;
    min-width: 0;
    padding: 0;
  }

  footer.framer-site-footer .framer-footer-image {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-height: 240px;
    aspect-ratio: 16 / 9;
  }

  footer.framer-site-footer .framer-footer-links {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-width: 0;
    gap: 22px;
  }

  footer.framer-site-footer .framer-footer-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
    align-items: start;
  }

  footer.framer-site-footer .framer-footer-column,
  footer.framer-site-footer .framer-footer-contact {
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  footer.framer-site-footer .framer-footer-contact {
    grid-column: 1 / -1;
  }

  footer.framer-site-footer .framer-footer-column ul,
  footer.framer-site-footer .framer-footer-contact > div {
    gap: 0;
  }

  footer.framer-site-footer :is(.framer-footer-link, .framer-footer-contact-link) {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 44px;
    height: auto;
    max-width: 100%;
    padding-block: 5px;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #c1c5c9;
  }

  footer.framer-site-footer .framer-footer-bottom {
    gap: 8px;
  }

  footer.framer-site-footer .framer-footer-socials {
    gap: 0;
  }

  footer.framer-site-footer .framer-footer-socials > :is(a, button) {
    width: 44px;
    height: 44px;
  }

  footer.framer-site-footer .framer-footer-wordmark {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(38px, 12vw, 82px);
    overflow: clip;
    transform: none;
  }

  footer.framer-site-footer .framer-footer-wordmark > span {
    top: 0;
    left: 0;
    font-size: clamp(38px, 12vw, 82px);
    line-height: 1;
    letter-spacing: -.06em;
  }

  footer.framer-site-footer .framer-copy-status {
    position: static;
    min-height: 1em;
  }

  body header.site-header nav.mobile-visible {
    max-height: var(--mgm-mobile-nav-room, calc(100dvh - 140px)) !important;
    overscroll-behavior-y: contain;
    scroll-padding-block: 8px;
  }

  main .mc-hero .mc-nav {
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 0;
  }

  main .mc-hero .mc-nav > a,
  main .mcp-gallery-heading > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  main .mcp-gallery-arrow {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  /* Keep the quote entry alongside the pricing tool, out of the form's touch area. */
  html body:has(#production-estimator, .coin-faq, #resource-content [data-resource-search]) main > button.pqc-launch[data-product-quote] {
    position: static !important;
    inset: auto !important;
    display: inline-flex;
    width: auto !important;
    max-width: calc(100% - 32px);
    min-height: 44px;
    margin: 12px 16px 24px;
    padding-inline: 16px !important;
  }

  html body:has(#production-estimator, .coin-faq, #resource-content [data-resource-search]) main > button.pqc-launch[data-product-quote] .mgm-cta-label {
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    overflow: visible !important;
    white-space: normal;
  }
}

/* The product quote's form is the only scrolling region on a phone. */
@media (max-width: 700px), (max-width: 1024px) and (max-height: 580px) {
  dialog#pqc-dialog[open]:not(.ml-native) {
    --pqc-gutter: clamp(12px, 4vw, 22px);
    --pqc-left: max(var(--pqc-gutter), env(safe-area-inset-left));
    --pqc-right: max(var(--pqc-gutter), env(safe-area-inset-right));
    box-sizing: border-box;
    position: fixed;
    inset: var(--pqc-visible-top, 0px) 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: var(--pqc-visible-height, 100dvh);
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 !important;
    overflow: hidden;
    color: #171817;
    background: #fff;
  }

  #pqc-dialog:not(.ml-native) .pqc-header {
    position: static;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: max(7px, env(safe-area-inset-top)) var(--pqc-right) 7px var(--pqc-left);
    border-color: #e2e8eb;
  }

  #pqc-dialog:not(.ml-native) .pqc-header p {
    margin: 0 0 2px;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: .055em;
    color: #495c66;
  }

  #pqc-dialog:not(.ml-native) .pqc-header h2 {
    margin: 0;
    font-size: clamp(18px, 4.9vw, 24px);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  #pqc-dialog:not(.ml-native) #pqc-close {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 25px;
    line-height: 1;
    background: #f0f4f6;
  }

  #pqc-dialog:not(.ml-native) .pqc-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  #pqc-dialog:not(.ml-native) .pqc-layout > aside:first-child {
    position: relative;
    min-width: 0;
    max-height: none;
    padding: 9px var(--pqc-right) 8px var(--pqc-left);
    overflow: visible;
    background: #f3f6f7;
    border-bottom: 1px solid #e2e8eb;
  }

  #pqc-dialog:not(.ml-native) .pqc-layout > aside:first-child > label {
    display: grid;
    min-width: 0;
    gap: 5px;
    margin: 0;
    font-size: 12px;
    line-height: 17px;
  }

  #pqc-dialog:not(.ml-native) #pqc-product {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    font-size: 16px;
    background-color: #fff;
  }

  #pqc-dialog:not(.ml-native) .pqc-patches-link {
    position: absolute;
    top: 0;
    right: var(--pqc-right);
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0;
    padding-inline: 4px;
    font-size: 12px;
    line-height: 1;
    color: #22465e;
  }

  #pqc-dialog:not(.ml-native) #pqc-steps {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    margin-top: 8px;
    overflow: visible;
    counter-reset: pqc-step;
  }

  #pqc-dialog:not(.ml-native) #pqc-steps button {
    box-sizing: border-box;
    min-width: 0;
    min-height: 32px;
    padding: 0;
    border: 1px solid #b9cbd6;
    border-radius: 6px;
    text-align: center;
    white-space: nowrap;
    font-size: 0;
    line-height: 1;
    color: #23465d;
    background: #fff;
    counter-increment: pqc-step;
  }

  #pqc-dialog:not(.ml-native) #pqc-steps button::before {
    content: counter(pqc-step);
    content: counter(pqc-step) / "";
    font-size: 12px;
    font-weight: 650;
  }

  #pqc-dialog:not(.ml-native) #pqc-steps button[aria-current="step"] {
    border-color: #1e4056;
    color: #fff;
    background: #1e4056;
  }

  #pqc-dialog:not(.ml-native) #pqc-steps button:disabled {
    border-color: #d6e0e5;
    color: #586c77;
    background: #e9eff2;
    opacity: 1;
  }

  #pqc-dialog:not(.ml-native) .pqc-summary {
    display: none;
  }

  #pqc-dialog:not(.ml-native) #pqc-form {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  #pqc-dialog:not(.ml-native) #pqc-panel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 13px var(--pqc-right) 12px var(--pqc-left);
    overflow: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 12px;
  }

  #pqc-dialog:not(.ml-native) #pqc-panel h3 {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  #pqc-dialog:not(.ml-native) #pqc-panel > p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #4d585e;
    overflow-wrap: anywhere;
  }

  #pqc-dialog:not(.ml-native) #pqc-panel > label {
    margin: 0 0 13px;
    font-size: 14px;
  }

  #pqc-dialog:not(.ml-native) #pqc-panel > label :is(input, select, textarea) {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin-top: 5px;
    font-size: 16px;
  }

  #pqc-dialog:not(.ml-native) #pqc-panel > button {
    min-height: 44px;
    max-width: 100%;
    margin: 0 7px 9px 0;
    white-space: normal;
  }

  #pqc-dialog:not(.ml-native) .pqc-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  #pqc-dialog:not(.ml-native) .pqc-options > label {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 8px 9px;
    text-align: left;
  }

  #pqc-dialog:not(.ml-native) .pqc-options input {
    position: static;
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #1e4056;
  }

  #pqc-dialog:not(.ml-native) .pqc-options span {
    min-width: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  #pqc-dialog:not(.ml-native) #pqc-error {
    max-height: 58px;
    margin: 0;
    padding: 5px var(--pqc-right) 8px var(--pqc-left);
    overflow: auto;
    font-size: 13px;
    line-height: 1.4;
  }

  #pqc-dialog:not(.ml-native) #pqc-error:empty {
    padding: 0;
  }

  #pqc-dialog:not(.ml-native) .pqc-actions {
    box-sizing: border-box;
    position: static;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(84px, .68fr) minmax(0, 1.32fr);
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: 8px var(--pqc-right) max(9px, env(safe-area-inset-bottom)) var(--pqc-left);
    border-top: 1px solid #e2e8eb;
    background: #fff;
  }

  #pqc-dialog:not(.ml-native) .pqc-actions > button {
    box-sizing: border-box;
    align-self: stretch !important;
    width: 100%;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 5px 8px 5px 12px !important;
    gap: 5px !important;
    border-radius: 24px;
    font-size: 14px !important;
    line-height: 1.15 !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #pqc-dialog:not(.ml-native) .pqc-actions .mgm-cta-label {
    line-height: inherit !important;
  }

  #pqc-dialog:not(.ml-native) .pqc-actions .mgm-cta-icon {
    flex: 0 0 26px;
    width: 26px !important;
    height: 26px !important;
  }

  #pqc-dialog:not(.ml-native) .pqc-actions .mgm-cta-icon svg {
    width: 26px !important;
    height: 26px !important;
  }

  #pqc-dialog:not(.ml-native) #pqc-back {
    --cta-bg: #e9eff2;
    --cta-fg: #213f53;
    --cta-arrow: #213f53;
    color: #213f53;
    background: #e9eff2;
  }

  #pqc-dialog:not(.ml-native) #pqc-back:disabled {
    opacity: .65;
  }

  #pqc-dialog:not(.ml-native)[data-pqc-keyboard] .pqc-layout {
    grid-template-rows: minmax(0, 1fr);
  }

  #pqc-dialog:not(.ml-native)[data-pqc-keyboard] .pqc-layout > aside:first-child {
    display: none;
  }
}

@media (min-width: 560px) and (max-width: 1024px) and (max-height: 490px) {
  #pqc-dialog:not(.ml-native) .pqc-layout {
    grid-template-columns: minmax(145px, 25%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  #pqc-dialog:not(.ml-native) .pqc-layout > aside:first-child {
    padding-right: 9px;
    overflow: auto;
  }

  #pqc-dialog:not(.ml-native) #pqc-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #pqc-dialog:not(.ml-native) .pqc-patches-link {
    position: static;
    min-height: 32px;
    padding: 0;
  }

  #pqc-dialog:not(.ml-native)[data-pqc-keyboard] .pqc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Keep the same compact step controls on dedicated product and patch quotes. */
@media (max-width: 700px), (max-width: 1024px) and (max-height: 580px) {
  dialog:is(#product-quote, #patch-quote-dialog)[open]:not(.ml-native) {
    --quote-gutter: clamp(12px, 4vw, 22px);
    --quote-left: max(var(--quote-gutter), env(safe-area-inset-left));
    --quote-right: max(var(--quote-gutter), env(safe-area-inset-right));
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0 !important;
    overflow: hidden;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(.mq-head, .pq-dialog-head) {
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: max(7px, env(safe-area-inset-top)) var(--quote-right) 7px var(--quote-left);
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(.mq-head, .pq-dialog-head) h2 {
    margin: 2px 0 0;
    font-size: clamp(19px, 5vw, 25px);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(.mq-head, .pq-dialog-head) .eyebrow {
    display: block;
    font-size: 10px;
    line-height: 1.2;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is([data-mq-close], .pq-close) {
    flex: 0 0 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  #product-quote:not(.ml-native) .mq-layout {
    display: flex;
    flex-direction: column;
  }

  #product-quote:not(.ml-native) .mq-stage {
    flex: 1 1 auto;
  }

  #patch-quote-dialog:not(.ml-native) #patch-inquiry-form {
    flex: 1 1 auto;
  }

  #patch-quote-dialog:not(.ml-native) .pq-layout {
    display: block;
    min-height: 0;
    overflow: auto;
  }

  #patch-quote-dialog:not(.ml-native) .pq-progress {
    gap: 10px;
    padding: 6px var(--quote-right) 0 var(--quote-left);
    font-size: 12px;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(.mq-layout nav, .pq-step-nav) {
    position: static;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 4px;
    padding: 8px var(--quote-right) 8px var(--quote-left);
    border: 0;
    border-bottom: 1px solid #e2e8eb;
    background: #f3f6f7;
    overflow: visible;
    counter-reset: mobile-quote-step;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is([data-mq-step], [data-pq-go]) {
    display: grid;
    place-items: center;
    flex: 1 1 0;
    min-width: 0;
    min-height: 32px;
    padding: 0;
    border: 1px solid #b9cbd6;
    border-radius: 6px;
    font-size: 0;
    color: #23465d;
    background: #fff;
    counter-increment: mobile-quote-step;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is([data-mq-step], [data-pq-go]) > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is([data-mq-step], [data-pq-go])::before {
    content: counter(mobile-quote-step);
    content: counter(mobile-quote-step) / "";
    font-size: 12px;
    font-weight: 650;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is([data-mq-step], [data-pq-go])[aria-current] {
    border-color: #1e4056;
    color: #fff;
    background: #1e4056;
  }

  #product-quote:not(.ml-native) .mq-side {
    display: none;
  }

  #patch-quote-dialog:not(.ml-native) .pq-summary {
    position: static;
    padding: 13px var(--quote-right) 16px var(--quote-left);
    border: 0;
    border-top: 1px solid #e2e8eb;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(.mq-stage, .pq-stage) {
    min-height: 0;
    padding: 12px var(--quote-right) 14px var(--quote-left);
    scroll-padding-block: 12px;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(.mq-stage, .pq-stage) :is(select, textarea, input:not([type="checkbox"], [type="radio"], [type="file"])) {
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(footer.mq-actions, .pq-dialog-foot) {
    display: grid;
    grid-template-columns: minmax(78px, .68fr) minmax(0, 1.32fr);
    gap: 5px 8px;
    padding: 8px var(--quote-right) max(9px, env(safe-area-inset-bottom)) var(--quote-left);
  }

  dialog:is(#product-quote, #patch-quote-dialog):not(.ml-native) :is(footer.mq-actions, .pq-dialog-foot) > button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 7px 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #product-quote:not(.ml-native) footer.mq-actions [data-mq-progress] {
    grid-area: 1 / 1 / 2 / -1;
    justify-self: center;
    margin: 0;
    font-size: 12px;
  }

  #patch-quote-dialog:not(.ml-native) #pq-step-caption {
    display: none;
  }
}

/* Mobile Studio layout: keep the canvas and project actions within reach. */
@media (max-width: 899px) {
  .mgm-fist-page .fist-header {
    height: auto;
    min-height: 52px;
    padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left));
    gap: 4px 10px;
    flex-wrap: wrap;
  }
  .mgm-fist-page .fist-header > :is(a, details, button) { min-width: 0; }
  .mgm-fist-page .fist-header > :is(a, button),
  .mgm-fist-page .fist-header summary { white-space: nowrap; }
  .mgm-fist-page .fist-header .fist-file-menu { position: static; }
  .mgm-fist-page .fist-header .fist-file-menu > div {
    right: 8px;
    top: calc(100% - 1px);
    max-width: calc(100vw - 24px);
    max-height: min(65dvh, 22rem);
    overflow-y: auto;
  }
  .mgm-fist-page .fist-header .fist-studio-switcher > div { left: 8px; right: auto; }

  .fist-workbench .pin-workspace-grid {
    grid-template-rows: auto;
    grid-auto-rows: auto;
  }
  .fist-workbench .fist-rail {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-flow: row;
  }
  .fist-workbench.pin-studio .fist-rail button {
    min-width: 0;
    min-height: 52px;
    padding: 4px 1px;
    line-height: 1.12;
    overflow-wrap: normal;
  }
  .fist-workbench .fist-rail button svg { width: 18px; height: 18px; }
  .fist-workbench .pin-center {
    min-height: 0;
    overflow: visible;
    gap: 5px;
  }
  .fist-workbench .fist-drawer:is([data-panel="templates"], [data-panel="art"], [data-panel="emblems"]) {
    max-height: none;
    overflow: visible;
  }
  .fist-workbench .fist-drawer-head { min-height: 40px; }
  .fist-workbench #pin-library { padding-inline: 8px; }
  .fist-workbench .pin-library-chrome { align-items: center; }
  .fist-workbench .pin-library-chrome :is(button, select) { min-height: 40px; }
  .fist-workbench .pin-library-card .pin-inspect-card {
    width: auto;
    max-width: calc(100% - 42px);
    min-height: 32px;
    padding: 3px 7px !important;
    z-index: 1;
  }
  .fist-workbench :is(#pin-library-search, #fist-text-draft, #pin-text) { font-size: 16px; }

  .fist-workbench.pin-studio .pin-quick-tools { padding: 2px; }
  .fist-workbench.pin-studio .pin-quick-tools button {
    min-height: 40px;
    padding: 4px 2px;
  }
  .fist-workbench .pin-canvas-top {
    column-gap: 8px;
    row-gap: 3px;
  }
  .fist-workbench .pin-canvas-top #pin-spec {
    font-size: 12px;
    line-height: 1.25;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .fist-workbench.pin-studio .pin-canvas-top :is(button, select) {
    padding: 4px 8px;
    min-height: 40px;
    font-size: 13px;
  }
  .fist-workbench #pin-front-thumb { width: 20px; height: 20px; }
  .fist-workbench .pin-surface-bar,
  .fist-workbench .pin-light-tools {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
  }
  .fist-workbench .pin-surface-bar:not(:has(.fist-finish-open)) {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) minmax(0, .75fr);
    align-items: stretch;
  }
  .fist-workbench .pin-surface-switch { min-width: 0; }
  .fist-workbench .pin-surface-switch button {
    padding: 4px 5px !important;
    font-size: 12px !important;
    min-height: 32px !important;
  }
  .fist-workbench.pin-studio .pin-surface-bar > button {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 38px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
  }
  .fist-workbench.pin-studio .pin-surface-bar #pin-inspect-current {
    padding: 4px 6px;
    font-size: 12px;
  }
  .fist-workbench .pin-light-tools label {
    min-width: 0;
    font-size: 12px;
    line-height: 1.15;
    gap: 4px;
  }
  .fist-workbench .pin-light-tools label:has(input) { flex: 1 0 100px; }
  .fist-workbench .pin-light-tools input {
    flex: 1;
    width: min(18vw, 90px) !important;
    min-width: 42px;
    max-width: 100px;
  }
  .fist-workbench.pin-studio .pin-light-tools :is(select, button) {
    min-height: 36px;
    padding: 4px 6px !important;
    font-size: 12px;
  }
  .fist-workbench .pin-artboard {
    flex: none;
    min-height: 0;
    height: clamp(160px, calc(100svh - 392px), min(100vw, 53svh));
  }
  .fist-workbench .pin-artboard > svg {
    touch-action: pan-y;
  }
  .fist-workbench .pin-artboard :is([data-layer], [data-handle]) { touch-action: none; }
  .fist-workbench .pin-view-tools {
    max-width: 100%;
    justify-content: center;
    gap: 1px 3px;
    padding-inline: 4px;
  }
  .fist-workbench.pin-studio .pin-view-tools button {
    min-width: 0;
    min-height: 40px;
    font-size: 12px;
    line-height: 1.15;
    padding: 4px;
  }
  .fist-workbench .pin-view-tools #pin-zoom-label { font-size: 12px; }
  .fist-workbench .pin-toolbar {
    display: block;
    min-height: 0;
    padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .fist-workbench .pin-toolbar > div {
    display: grid;
    grid-template-columns: minmax(44px, max-content) minmax(44px, max-content) minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }
  .fist-workbench.pin-studio .pin-toolbar :is(button, .mgm-cta) {
    min-height: 44px;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    padding: 4px 9px;
  }
  .fist-workbench.pin-studio .pin-toolbar #fist-order-open {
    width: 100%;
    max-width: none;
    gap: 6px;
  }
  .fist-workbench.pin-studio .pin-toolbar #fist-order-open.mgm-cta {
    min-height: 44px !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    gap: 6px !important;
    white-space: nowrap;
  }
  .fist-workbench .pin-toolbar #fist-order-open .mgm-cta-label {
    line-height: inherit !important;
  }
  .fist-workbench .pin-toolbar #fist-order-open svg {
    width: 16px;
    height: 16px;
  }
  .fist-workbench .pin-toolbar #fist-order-open :is(.mgm-cta-arrow, .mgm-cta-icon) {
    width: 28px !important;
    height: 28px !important;
    flex-basis: 28px;
  }
  .fist-workbench .client-review-badge { margin-top: 4px; }
  .fist-workbench:has(.fist-drawer :is(input[type="number"], input[type="search"], input[type="text"], textarea):focus) .pin-toolbar {
    position: static;
  }

  .mgm-fist-page :is(#pin-inspector, .pin-small-dialog, #pin-share-dialog, #pin-color-dialog, .fist-guide, #fist-finish-samples) {
    box-sizing: border-box;
    width: min(620px, calc(100% - 16px));
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 12px;
    overscroll-behavior: contain;
  }
  .mgm-fist-page #pin-inspector .pin-inspector-head h2 {
    margin: 4px 0 8px;
    font-size: clamp(20px, 4.9vw, 26px);
    overflow-wrap: anywhere;
  }
  .mgm-fist-page #pin-inspector :is(.eyebrow, #pin-inspector-help) {
    font-size: 12px;
  }
  .mgm-fist-page #pin-inspector #pin-inspector-help { margin: 8px 0 0; }
  .mgm-fist-page #pin-inspector .pin-inspector-stage { min-height: 0; }
  .mgm-fist-page #pin-inspector .pin-inspector-stage svg {
    height: clamp(138px, calc(100dvh - 300px), min(65dvh, 420px));
  }
  .mgm-fist-page #pin-inspector .pin-inspector-tools {
    gap: 4px;
    margin-top: 8px;
  }
  .mgm-fist-page #pin-inspector button {
    min-height: 44px;
    padding: 5px 8px;
  }
  .mgm-fist-page #pin-inspector #pin-inspector-close { min-width: 44px; }
  .mgm-fist-page #pin-inspector .pin-inspector-tools:has(.pin-coin-pair-apply:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }
  .mgm-fist-page #pin-inspector #pin-inspector-apply.mgm-cta { align-self: stretch !important; }
  .mgm-fist-page #pin-inspector .pin-inspector-tools .pin-surface-switch { justify-content: center; }
  .mgm-fist-page #pin-inspector .pin-coin-pair-apply {
    background: #e9edf0;
    font-weight: 700;
  }
  .mgm-fist-page #pin-inspector :is(#pin-inspector-apply, .pin-coin-pair-apply) { width: 100%; }
  .mgm-fist-page #pin-inspector .pin-coin-pair-apply[hidden] { display: none; }
}

@media (max-width: 520px) {
  .mgm-fist-page .fist-header { gap: 4px; }
  .mgm-fist-page .fist-header .fist-brand { font-size: 23px; gap: 4px; }
  .mgm-fist-page .fist-brand small { font-size: 9px; }
  .mgm-fist-page .fist-header #fist-guide-open { padding: 4px 5px; white-space: nowrap; }
  .fist-workbench.pin-studio .fist-rail button { font-size: 10px; }
}

@media (max-width: 359px) {
  .mgm-fist-page .fist-header { gap: 2px; padding-inline: 4px; }
  .mgm-fist-page .fist-header .fist-brand small { display: none; }
  .mgm-fist-page .fist-header-spacer { display: none; }
}

@media (max-width: 899px) and (max-height: 480px) and (orientation: landscape) {
  .fist-workbench .pin-toolbar { position: static; }
  .mgm-fist-page #pin-inspector .pin-inspector-stage svg {
    height: clamp(112px, calc(100dvh - 190px), 240px);
  }
}
