html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

/* Override main styles so the file input stays inside the button on mobile */
.add-steps-upload-methods-local-form {
  position: relative;
}
#local-upload {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  transform: none;
  -webkit-transform: none;
  -moz-transform: none;
  -ms-transform: none;
  -o-transform: none;
  z-index: 2;
}

.header {
  height: auto;
}

.header-content {
  position: relative;
  width: 100%;
  height: auto;
  padding: 10px 12px 12px;
  box-sizing: border-box;
}

.header-logo {
  position: relative;
  left: auto;
  top: auto;
  margin: 0 90px 4px 0;
}

.header-description {
  position: relative;
  right: auto;
  top: auto;
  text-align: left;
  margin-right: 90px;
  font-size: 14px;
  line-height: 1.4;
}

.header-fade-container {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 85px;
  height: 85px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header-fade-percent {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.header-fade-percent-num {
  font-size: 20px;
}

.header-fade-percent-symbol {
  position: static;
  margin-left: 2px;
}

.header-fade-text {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.2;
}

/* Mobile card: image on top, text below */
@media (max-width: 800px) {
  .post-2d {
    overflow: hidden;
    z-index: 1000000;
  }

  .post-2d-center-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 92vw !important;        /* Override desktop inline width */
    height: auto !important;
    max-width: 420px;
    max-height: 88vh;
    margin: 0 !important;          /* Clear desktop negative margins */
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
  }

  .post-2d-img {
    float: none;
    width: 100% !important;
    height: auto !important;
    padding-top: 62%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
  }

  .post-2d-content-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;        /* Override desktop 348px width */
    max-height: 42vh;              /* Cap height so long text scrolls instead of overflowing */
    padding: 16px 16px 18px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
    line-height: 1.6;
    background: #000;
  }

  .post-2d-content-wrapper .scroll-indicator-wrapper {
    display: none !important;
  }

  .post-2d-content {
    position: static;
    left: auto;
    width: 100%;
  }

  .post-2d-content-top {
    position: static;
    width: auto;
    height: 0;
    padding: 0;
    margin: 0;
    background: transparent;
  }

  .post-2d-matched-wrapper {
    display: none !important;
  }

  .post-2d-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
  }
}


/* Small screens: keep back/confirm below crop area */
@media (max-width: 550px) {/* 550 */
  .add-steps-back-btn,
  .add-steps-validate-btn {
    position: absolute;
    top: calc(50% + 170px);/* 170 */
    right: auto;
    margin: 0;
    width: auto;
    max-width: 220px;
    min-width: 120px;
    padding: 0 14px;
    transform: none;
    line-height: 36px;
    z-index: 4; /* keep above overlay */
  }
  .add-steps-back-btn {
    left: 16px;
    text-align: left;
  }
  .add-steps-validate-btn {
    right: 16px;
    left: auto;
    text-align: right;
  }
  .add-steps-message-terms {
    margin-top: 40px; /* 40 */
  }
}
