/* Google Sheets embed (_sections/calculator.latte) */
.xlsx-calculator {
    /* The surrounding `.article > *` rule applies `user-select: none`, which
     * breaks Google Sheets cell selection. Re-enable on the calculator only. */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.xlsx-calculator--google-demo {
    /* Stop scroll anchoring from yanking the page when the iframe reflows on cell focus. */
    overflow-anchor: none;
}

.xlsx-calculator-google-demo__frame {
    position: relative;
    width: 100%;
    height: min(80vh, 900px);
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    overscroll-behavior: contain;
    background: #fff;
}

.xlsx-calculator-google-demo__embed {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.xslx-calculator__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6.5rem;
    background-color: #fff;
    z-index: 90;
    pointer-events: none;
}

.xslx-calculator__overlay--bottom {
    top: auto;
    bottom: 0;
    height: 2.5rem;
}

/*
 * While the user edits inside the Google iframe, lock the parent document so
 * Google's scrollIntoView (it assumes the sheet sits at y=0) cannot move the page.
 */
html.is-google-sheets-scroll-locked,
body.is-google-sheets-scroll-locked {
    overflow: hidden;
    height: 100%;
}

body.is-google-sheets-scroll-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}
