/* Shared Orders status plus phone-only Workbench presentation. Desktop layout remains owned by Webflow. */
.mobile-order-only {
  display: none;
}

.internal-order-page .orders-live-controls,
.internal-order-page .orders-live-region {
  display: flex;
  align-items: center;
  gap: 7px;
}

.internal-order-page .orders-live-controls {
  min-height: 32px;
  margin-left: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.internal-order-page .orders-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f3b248;
  box-shadow: 0 0 0 3px rgba(243, 178, 72, 0.16);
}

.internal-order-page .orders-live-controls[data-state="live"] .orders-live-dot {
  background: #43cf9b;
  box-shadow: 0 0 0 3px rgba(67, 207, 155, 0.16);
}

.internal-order-page .orders-live-controls[data-state="paused"] .orders-live-dot {
  background: #ff8077;
  box-shadow: 0 0 0 3px rgba(255, 128, 119, 0.16);
}

.internal-order-page .orders-live-refresh {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 767px) {
  html,
  body.internal-order-shell,
  body.internal-order-page {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.internal-order-shell.mobile-order-editor-open {
    overflow: hidden;
  }

  body.internal-order-shell.mobile-order-editor-open [data-id="module-content-holder"] iframe {
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-order-only {
    display: flex;
  }

  .internal-order-page .orders-live-controls {
    margin-left: 6px;
  }

  .internal-order-shell .integrity-header {
    min-width: 0;
    padding-right: 8px;
  }

  .internal-order-shell .nav-button {
    width: auto;
    min-width: 0;
    max-width: calc(100vw - 84px);
    min-height: 44px;
    padding-left: 14px;
  }

  .internal-order-shell .nav-button:focus-visible,
  .internal-order-shell .menu-tile:focus-visible,
  .internal-order-page a:focus-visible,
  .internal-order-page button:focus-visible,
  .internal-order-page input:focus-visible,
  .internal-order-page select:focus-visible,
  .internal-order-page textarea:focus-visible,
  .internal-order-page [role="button"]:focus-visible,
  .internal-order-page [role="tab"]:focus-visible {
    outline: 3px solid #54cbff;
    outline-offset: 2px;
  }

  .internal-order-shell .label-header-name-2 {
    max-width: calc(100vw - 118px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .internal-order-shell .home-button-2,
  .internal-order-shell .user-name-label-2 {
    display: none;
  }

  .internal-order-shell [data-id="main-content-holder"] {
    left: 0 !important;
    width: 100% !important;
  }

  /* Phone layer order: order editor 1000010 < scrim 1000020 < nav drawer 1000021. */
  .internal-order-shell [data-id="left-panel"] {
    z-index: 1000021;
    width: min(88vw, 320px) !important;
    max-width: 320px;
    position: fixed !important;
    inset: 50px auto 0 0;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: 12px 0 30px #00111f4d;
  }

  .internal-order-shell.mobile-nav-open [data-id="left-panel"] {
    transform: translateX(0);
  }

  .internal-order-shell [data-id="left-panel-content-holder"] {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .internal-order-shell .menu-tile,
  .internal-order-shell .menu-tile-out,
  .internal-order-shell .button-logout-2 {
    min-height: 52px;
  }

  .internal-order-shell [data-id="main-area-cover"] {
    z-index: 1000020;
    position: fixed;
    inset: 50px 0 0;
  }

  .internal-order-shell .main-frame-area,
  .internal-order-shell .iframe-holder,
  .internal-order-shell .iframe-holder iframe {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .internal-order-page .main-content-16 {
    min-width: 0;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 12px;
  }

  .internal-order-page .mobile-orders-title {
    color: #fff;
    align-items: center;
    min-height: 44px;
    margin: 0;
    font-family: Open Sans, sans-serif;
    font-size: 24px;
    line-height: 30px;
  }

  .internal-order-page .filter-section-8 {
    width: 100%;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 8px;
  }

  .internal-order-page .div-block-8709,
  .internal-order-page .left-side-wrapper-3,
  .internal-order-page .div-block-8706,
  .internal-order-page .order-id-wrapper,
  .internal-order-page .div-block-8701 {
    width: 100%;
    min-width: 0;
  }

  .internal-order-page .order-id-wrapper {
    display: block;
    margin-right: 0;
  }

  .internal-order-page .div-block-8709,
  .internal-order-page .left-side-wrapper-3 {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 0;
  }

  .internal-order-page [data-id="status-toggle"] {
    width: 100%;
    min-height: 44px;
  }

  .internal-order-page [role="tab"] {
    min-height: 44px;
  }

  .internal-order-page .order-id-wrapper .search-input-wrapper-17.short {
    flex: 1;
    width: auto;
    margin-right: 8px;
  }

  .internal-order-page [data-id="show-order-id-button"],
  .internal-order-page [data-id="apply-button"],
  .internal-order-page [data-id="reset-button"] {
    min-width: 54px;
    min-height: 44px;
  }

  .internal-order-page [data-id="show-order-id-button"] {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .internal-order-page [data-id="start-new-order-button"] {
    width: 100%;
    min-height: 48px;
    background-color: #0077b8;
  }

  .internal-order-page .mobile-filter-toggle {
    color: #fff;
    background: #0c3955;
    border: 1px solid #ffffff73;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    font: 600 15px/20px Open Sans, sans-serif;
  }

  .internal-order-page [data-id="filter-section"] {
    display: none;
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(4, 24, 37, 0.3);
  }

  .internal-order-page.mobile-filters-open [data-id="filter-section"] {
    display: grid;
    gap: 10px;
  }

  .internal-order-page .search-input-wrapper-17,
  .internal-order-page .filter-wrapper-16,
  .internal-order-page .date-range-22,
  .internal-order-page .form-block-21,
  .internal-order-page .sort-option-dd-copy-3,
  .internal-order-page .keyword-search-input-28 {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-right: 0;
  }

  .internal-order-page .filter-wrapper-16 {
    display: block;
    padding: 0;
  }

  .internal-order-page .keyword-search-input-28,
  .internal-order-page .sort-option-dd-copy-3 {
    min-height: 44px;
  }

  .internal-order-page [data-id="filter-section"] .date-range-22 {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .internal-order-page [data-id="filter-section"] .date-input-9 {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin: 0;
  }

  .internal-order-page [data-id="filter-section"] [data-id="apply-button"] {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .internal-order-page [data-id="filter-section"] [data-id="reset-button"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .internal-order-page input,
  .internal-order-page select,
  .internal-order-page textarea,
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] input,
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] select,
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] textarea {
    font-size: 16px !important;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"],
  .internal-order-page [data-id="data-table-view"],
  .internal-order-page [data-id="table-scroller"],
  .internal-order-page [data-id="results-holder"],
  .internal-order-page [data-id="frozen-results"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible !important;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] table,
  .internal-order-page [data-id="submitted-orders-table-holder"] tbody {
    display: block;
    width: 100%;
    white-space: normal !important;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] thead {
    display: none;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] tbody tr {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d9e8ee;
    border-radius: 8px;
    box-shadow: 0 3px 10px #00111f1a;
    cursor: pointer;
  }

  /* Keep the same table and controls. Cached controllers without field hooks
     retain the stacked fallback instead of placing cells in arbitrary slots. */
  .internal-order-page [data-id="submitted-orders-table-holder"] tbody tr:has(> td[data-mobile-field]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "id modified"
      "customer customer"
      "address address"
      "product equipment"
      "ack updates"
      "status status";
    gap: 4px 12px;
    padding: 10px 12px;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="id"] { grid-area: id; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="modified_at"] { grid-area: modified; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="customer_full_name"] { grid-area: customer; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="customer_full_address"] { grid-area: address; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="product"] { grid-area: product; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="equipment"] { grid-area: equipment; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="status"] { grid-area: status; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="review_rank"] { grid-area: ack; }
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="reviewed_at"] { grid-area: updates; }

  .internal-order-page [data-id="submitted-orders-table-holder"] tbody td {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0;
    padding: 2px 0;
    white-space: normal !important;
    text-align: left;
    border: 0;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] tbody td:last-child {
    border-bottom: 0;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] tbody td::before {
    content: attr(data-mobile-label);
    color: #526b78;
    flex: 0 0 auto;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 16px;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] tbody td[data-mobile-hidden="true"] {
    display: none;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] tbody td > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  /* Desktop cells reserve 56px and draw their own separator. Neither belongs
     inside a phone card; reset the child as well as the table cell. */
  .internal-order-page [data-id="submitted-orders-table-holder"] tbody td > .column-8 {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0;
    border: 0;
    align-items: flex-start;
    justify-content: flex-start;
    white-space: normal;
    line-height: 20px;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="customer_full_name"] [data-id="display"] {
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="status"] {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="status"] > .column-8 {
    width: auto !important;
    flex: 1;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="review_rank"],
  .internal-order-page [data-id="submitted-orders-table-holder"] td[data-mobile-field="reviewed_at"] {
    padding-top: 8px;
    border-top: 1px solid #d9e8ee;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] .ack-control,
  .internal-order-page [data-id="submitted-orders-table-holder"] .updates-mark-seen,
  .internal-order-page [data-id="submitted-orders-table-holder"] .form-button-48 {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .internal-order-page [data-id="submitted-orders-table-holder"] .ack-badge {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .internal-order-page [data-type="modal"] {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    padding: 8px !important;
    overflow: hidden;
  }

  .internal-order-page .modal-container-question-2 {
    width: calc(100% - 16px);
    min-width: 0;
    max-width: none;
    max-height: calc(100dvh - 16px);
    margin: 0 auto;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .internal-order-page [data-type="modal"] [data-id="close-modal"] {
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 7px;
  }

  .internal-order-page [class*="question-template-modal"],
  .internal-order-page .form-element-div-2,
  .internal-order-page .field-holder-horizontal-3,
  .internal-order-page .status-radio-buttons-2 {
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .internal-order-page [data-id="modal-whats-being-sold"] label.w-radio {
    box-sizing: border-box;
    align-items: center;
    width: 100%;
    min-height: 52px;
    margin: 0 0 8px;
    padding: 12px;
    border: 1px solid #b9d5e3;
    border-radius: 6px;
  }

  .internal-order-page [class*="autocomplete-search-wrapper"],
  .internal-order-page [class*="results-scroller"],
  .internal-order-page [class*="results-wrapper"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .internal-order-page .form-button-holder-4 {
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .internal-order-page [name="product-radio"] + .text-18-6,
  .internal-order-page label.w-radio {
    min-height: 48px;
  }

  .internal-order-shell .right-side-panel-2 {
    z-index: 1000010;
    pointer-events: none;
    position: fixed;
    inset: 50px 0 0;
    width: 100%;
    max-width: none;
    height: calc(100dvh - 50px);
  }

  .internal-order-shell .side-bar-positioner-16 {
    box-sizing: border-box;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100%;
    height: 100%;
    overflow: visible;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] {
    pointer-events: auto;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="response-row"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] [class*="response-row"] {
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding-left: 14px;
    padding-right: 14px;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="autocomplete-search-wrapper"],
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="results-scroller"],
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="results-wrapper"],
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] input,
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] select,
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] textarea {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [data-id="save-changes-button"],
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [data-id="submit-order-button"],
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [data-id="cancel-changes-button"] {
    min-height: 44px;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="button-holder"],
  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="form-button-holder"] {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] .item-submit-holder-7 {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* The order editor scrolls up and down only. Rows built for the desktop sidebar
     (agreement checkbox + upload + file chip, sales reps) wrap instead of
     pushing the form wider than the phone. */
  .internal-order-shell [data-id="side-order-view-wrapper-editable"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="customer-checkbox-flex"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] [class*="customer-checkbox-flex"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] .response-row-365.reps > * {
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [class*="uploaded-file"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] [class*="uploaded-file"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] .file-missing-wrapper {
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  .internal-order-shell [data-id="side-order-view-wrapper-editable"] [data-id="file-name"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] [data-id="file-name"],
  .internal-order-shell [data-id="side-order-view-wrapper-read-only"] [data-id="second_sales_rep_name"] {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  @media (prefers-reduced-motion: reduce) {
    .internal-order-shell [data-id="left-panel"] {
      transition: none;
    }
  }
}
