/* Shared mobile / touch styles for cabinet, door, checkout, and related pages */

body.innosaw-touch-device {
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
}

/* Compact sticky header row */
body.innosaw-touch-device .nav-header {
  flex-shrink: 0;
  position: relative;
  z-index: 100000;
  margin-bottom: 8px;
}

body.innosaw-touch-device .nav-container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  max-width: 100% !important;
  width: 100% !important;
  min-height: 48px !important;
  height: auto !important;
  padding: 6px 10px !important;
  margin: 0 !important;
  gap: 6px !important;
  flex-wrap: wrap;
}

body.innosaw-touch-device .nav-brand {
  flex-shrink: 0;
  margin-left: 0 !important;
  order: 1;
}

body.innosaw-touch-device .nav-brand img {
  height: 28px !important;
}

body.innosaw-touch-device .header-cart,
body.innosaw-touch-device .nav-cart-btn {
  order: 3;
  margin-left: auto !important;
  min-height: 34px;
  padding: 4px 8px !important;
  font-size: 11px !important;
  white-space: nowrap;
}

/* Door / cabinet order pages: compact cart so centered logo has room */
@media (max-width: 900px) {
  body.innosaw-touch-device:has(#appTopBar) .header-cart,
  body.innosaw-touch-device:has(#appTopBar) .nav-cart-btn {
    min-width: 0 !important;
    max-width: 92px;
    min-height: 32px !important;
    padding: 3px 6px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.innosaw-touch-device:has(#appTopBar) .header-theme-toggle {
    min-width: 34px !important;
    width: 34px !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-mobile-menu-toggle {
    min-width: 34px !important;
    width: 34px !important;
    min-height: 32px !important;
    padding: 0 !important;
    gap: 0 !important;
    flex-shrink: 0;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-mobile-menu-toggle .nav-mobile-menu-label {
    display: none;
  }
}

body.innosaw-touch-device .nav-actions {
  order: 3;
  margin-left: auto !important;
  gap: 6px !important;
}

body.innosaw-touch-device .nav-actions .nav-button {
  min-height: 34px;
  padding: 4px 8px !important;
  font-size: 11px !important;
}

.nav-mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  order: 2;
  min-height: 34px;
  min-width: 52px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

body.innosaw-touch-device .nav-mobile-menu-toggle {
  display: inline-flex;
}

body.innosaw-touch-device .nav-menu,
body.innosaw-touch-device .nav-menu.nav-experience-gate {
  order: 4;
  flex: 0 0 100%;
  width: 100%;
  display: none;
  gap: 6px;
  justify-content: stretch;
}

body.innosaw-touch-device .nav-header.innosaw-nav-menu-open .nav-menu,
body.innosaw-touch-device .nav-header.innosaw-nav-menu-open .nav-menu.nav-experience-gate {
  display: grid;
  grid-template-columns: 1fr;
}

body.innosaw-touch-device .nav-experience-gate .experience-tab,
body.innosaw-touch-device .nav-menu .nav-button {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px !important;
  padding: 6px 10px !important;
  line-height: 1.2;
}

/* Order pages portrait: logo row 1; menu + theme left, cart right on row 2 */
@media (max-width: 900px) and (orientation: portrait) {
  body.innosaw-touch-device:has(#appTopBar) .nav-container {
    display: grid !important;
    grid-template-columns: auto auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 6px !important;
    flex-wrap: nowrap !important;
    padding: 4px 8px !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-brand {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    order: unset !important;
    margin: 0 auto !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-brand img {
    height: 26px !important;
    max-width: 120px;
    object-fit: contain;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-mobile-menu-toggle {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    order: unset !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .header-theme-toggle {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    order: unset !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .header-cart,
  body.innosaw-touch-device:has(#appTopBar) .nav-cart-btn {
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
    order: unset !important;
    margin-left: 0 !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-menu,
  body.innosaw-touch-device:has(#appTopBar) .nav-menu.nav-experience-gate {
    grid-column: 1 / -1;
    grid-row: 3;
    order: unset !important;
    flex: unset !important;
    width: 100% !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-header.innosaw-nav-menu-open .nav-menu,
  body.innosaw-touch-device:has(#appTopBar) .nav-header.innosaw-nav-menu-open .nav-menu.nav-experience-gate {
    display: grid;
  }
}

/* Order pages landscape: menu + theme left, logo center, compact cart right */
@media (max-width: 900px) and (orientation: landscape) {
  body.innosaw-touch-device:has(#appTopBar) .nav-container {
    display: grid !important;
    grid-template-columns: auto auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 4px 6px !important;
    flex-wrap: nowrap !important;
    padding: 3px 8px !important;
    min-height: 40px !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-mobile-menu-toggle {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    order: unset !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .header-theme-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    order: unset !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-brand {
    grid-column: 3;
    grid-row: 1;
    justify-self: center;
    order: unset !important;
    margin: 0 !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-brand img {
    height: 24px !important;
    max-width: 100px;
    object-fit: contain;
  }

  body.innosaw-touch-device:has(#appTopBar) .header-cart,
  body.innosaw-touch-device:has(#appTopBar) .nav-cart-btn {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    order: unset !important;
    margin-left: 0 !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-menu,
  body.innosaw-touch-device:has(#appTopBar) .nav-menu.nav-experience-gate {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    order: unset !important;
    flex: unset !important;
    width: 100% !important;
  }

  body.innosaw-touch-device:has(#appTopBar) .nav-header.innosaw-nav-menu-open .nav-menu,
  body.innosaw-touch-device:has(#appTopBar) .nav-header.innosaw-nav-menu-open .nav-menu.nav-experience-gate {
    display: grid;
  }
}

/* Cabinet / door top option bar — compact; portrait wraps to 2 rows */
@media (max-width: 900px) {
  body.innosaw-touch-device #appTopBar.top-bar,
  body.innosaw-touch-device #appTopBar {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    padding: 3px 4px !important;
    gap: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  body.innosaw-touch-device #appTopBar .top-bar-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 4px !important;
    padding: 2px 4px !important;
    width: auto !important;
    min-width: min-content !important;
    overflow: visible !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 112px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    gap: 1px !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group label {
    font-size: 9px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group select {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 80px !important;
    max-width: 112px !important;
    min-height: 26px !important;
    height: 26px !important;
    padding: 1px 4px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    border-radius: 4px !important;
  }

  body.innosaw-touch-device #appTopBar .btn-secondary-lite,
  body.innosaw-touch-device #appTopBar #doorStyleDetailsBtn {
    min-height: 26px !important;
    height: 26px !important;
    padding: 2px 6px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group:has(button):not(:has(select)) {
    flex-direction: column !important;
    justify-content: flex-end !important;
    max-width: none !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-messages {
    order: 99;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 140px !important;
    margin-left: 4px !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    align-self: center !important;
  }
}

/* Portrait: wrap top-bar dropdowns into ~2 rows (no horizontal scroll) */
@media (max-width: 900px) and (orientation: portrait) {
  body.innosaw-touch-device #appTopBar.top-bar,
  body.innosaw-touch-device #appTopBar {
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-inner {
    flex-wrap: wrap !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 4px 6px !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group[data-top-row="1"] {
    flex: 1 1 calc(50% - 6px) !important;
    width: calc(50% - 6px) !important;
    min-width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
    order: 1;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group[data-top-row="2"],
  body.innosaw-touch-device #appTopBar .top-bar-group.top-bar-group-inline-action[data-top-row="2"],
  body.innosaw-touch-device #appTopBar .unit-pref-control[data-top-row="2"] {
    flex: 1 1 calc(33.33% - 6px) !important;
    width: calc(33.33% - 6px) !important;
    min-width: calc(33.33% - 6px) !important;
    max-width: calc(33.33% - 6px) !important;
    order: 2;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group[data-top-row="3"],
  body.innosaw-touch-device #appTopBar .top-bar-group.top-bar-group-inline-action[data-top-row="3"],
  body.innosaw-touch-device #appTopBar .unit-pref-control[data-top-row="3"] {
    flex: 1 1 calc(33.33% - 6px) !important;
    width: calc(33.33% - 6px) !important;
    min-width: calc(33.33% - 6px) !important;
    max-width: calc(33.33% - 6px) !important;
    order: 3;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group:not([data-top-row]) {
    flex: 1 1 calc(50% - 6px) !important;
    width: calc(50% - 6px) !important;
    min-width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group.top-bar-group-inline-action {
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group.top-bar-group-inline-action button {
    width: 100% !important;
  }

  body.innosaw-touch-device #appTopBar .unit-pref-control {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    gap: 1px !important;
    margin-left: 0 !important;
    min-width: 0 !important;
  }

  body.innosaw-touch-device #appTopBar .unit-pref-control label {
    font-size: 9px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.innosaw-touch-device #appTopBar .unit-pref-control select {
    min-height: 26px !important;
    height: 26px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 1px 4px !important;
    font-size: 10px !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-group select {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  body.innosaw-touch-device #appTopBar .top-bar-messages {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    order: 99 !important;
  }

  body.innosaw-touch-device main#appMainLayout .door-import-section {
    margin-top: 12px;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  body.landscape-desktop.innosaw-touch-device #appTopBar.top-bar,
  body.landscape-desktop.innosaw-touch-device #appTopBar {
    padding: 2px 4px !important;
  }

  body.landscape-desktop.innosaw-touch-device #appTopBar .top-bar-group {
    max-width: 100px !important;
  }

  body.landscape-desktop.innosaw-touch-device #appTopBar .top-bar-group select {
    min-width: 72px !important;
    max-width: 100px !important;
    min-height: 24px !important;
    height: 24px !important;
    font-size: 9px !important;
  }

  body.landscape-desktop.innosaw-touch-device #appTopBar .top-bar-group label {
    font-size: 8px !important;
  }

  body.landscape-desktop.innosaw-touch-device #appTopBar .btn-secondary-lite,
  body.landscape-desktop.innosaw-touch-device #appTopBar #doorStyleDetailsBtn {
    min-height: 24px !important;
    height: 24px !important;
    font-size: 8px !important;
    padding: 1px 5px !important;
  }
}

/* Checkout */
@media (max-width: 768px) {
  body.checkout-page .container {
    margin: 12px auto;
    padding: 14px;
    border-radius: 8px;
  }

  body.checkout-page .input-grid,
  body.checkout-page .checkout-grid {
    grid-template-columns: 1fr !important;
  }

  body.checkout-page .submit-btn {
    min-height: 44px;
    font-size: 15px;
  }

  body.checkout-page input,
  body.checkout-page textarea,
  body.checkout-page select {
    min-height: 40px;
    font-size: 16px;
  }
}

/* Landing cards */
@media (max-width: 900px) {
  body.landing-active .mp-card {
    min-height: 38vh;
  }

  body.landing-active .mp-card h2 {
    font-size: 1.35rem;
  }
}

/* Help page */
@media (max-width: 900px) {
  body.rd-help-body .rd-help-page {
    padding: 12px;
  }

  body.rd-help-body .rd-help-hero {
    flex-direction: column;
    gap: 12px;
  }
}

/* Touch-friendly controls on order pages */
@media (max-width: 900px) {
  body.innosaw-touch-device .btn-cart-primary,
  body.innosaw-touch-device .btn-secondary-strong,
  body.innosaw-touch-device .btn-secondary-lite,
  body.innosaw-touch-device button.cabinet-grid-tile {
    touch-action: manipulation;
  }

  body.innosaw-touch-device .panel-left select,
  body.innosaw-touch-device .panel-left input,
  body.innosaw-touch-device .panel-left button {
    min-height: 38px;
  }
}

/* Mobile landscape: 3-column layout — match door page (narrow sides, flexible viewer) */
@media (max-width: 920px) and (orientation: landscape) {
  body.landscape-desktop.innosaw-touch-device main#app,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    grid-template-columns: none !important;
    height: calc(var(--innosaw-vh, 100vh) - 48px) !important;
    max-height: calc(var(--innosaw-vh, 100vh) - 48px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    gap: 4px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }

  body.landscape-desktop.innosaw-touch-device main#app .panel-left,
  body.landscape-desktop.innosaw-touch-device main#app .panel-right,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-right {
    flex: 0 0 26vw !important;
    width: 26vw !important;
    max-width: 220px !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 6px !important;
    font-size: 10px !important;
    height: auto !important;
  }

  body.landscape-desktop.innosaw-touch-device main#app .panel-middle,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-middle {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 4px !important;
    min-height: 0 !important;
    height: auto !important;
  }

  body.landscape-desktop.innosaw-touch-device #viewerContainer {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    order: 0 !important;
  }

  body.landscape-desktop.innosaw-touch-device main#app .panel-left h3,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left h4,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left label,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left h3,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left label,
  body.landscape-desktop.innosaw-touch-device main#app .panel-right h3,
  body.landscape-desktop.innosaw-touch-device main#app .panel-right h5,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-right h3 {
    font-size: 10px !important;
    margin: 2px 0 !important;
  }

  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left select,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left input,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left textarea,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left button,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left select,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left input,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left textarea,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left button {
    min-height: 28px !important;
    font-size: 11px !important;
  }

  body.landscape-desktop.innosaw-touch-device #appTopBar.top-bar {
    margin-bottom: 0 !important;
  }
}

/* 3D layer controls — single row at bottom of viewer (cabinet / index) */
#viewerContainer {
  position: relative;
}

.viewer-3d-controls {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  z-index: 12;
  pointer-events: none;
}

.viewer-3d-controls__row {
  display: flex;
  flex-direction: row;
  gap: 3px;
  pointer-events: auto;
  padding: 3px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.viewer-3d-controls__btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 2px 4px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  border-radius: 4px !important;
}

body.theme-light .viewer-3d-controls__row {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.12);
}

/* Field pairs: normal stack on desktop, 2-up grid on touch mobile */
.mobile-field-row {
  display: block;
}

.mobile-field-cell {
  display: block;
  margin-bottom: 8px;
}

.mobile-field-cell:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  body.innosaw-touch-device .mobile-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    margin-bottom: 4px;
  }

  body.innosaw-touch-device .mobile-field-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    margin-bottom: 0;
  }
}

/* Collapsible notes on touch */
.mobile-notes-toggle {
  display: none;
}

@media (max-width: 900px) {
  body.innosaw-touch-device .mobile-notes-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 34px;
    margin: 0 0 6px;
    padding: 6px 10px;
    border: 1px solid var(--theme-border-panel, #d1d5db);
    border-radius: 6px;
    background: var(--theme-bg-base, #f8fafc);
    color: var(--theme-fg-primary, #334155);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
  }

  body.innosaw-touch-device .mobile-notes-block.has-notes .mobile-notes-toggle {
    border-color: #0ea5e9;
    color: #0f5f9e;
  }

  body.innosaw-touch-device .mobile-notes-block > label[for="customerNotes"],
  body.innosaw-touch-device .mobile-notes-block > label[for="customerNotesPreview"] {
    display: none;
  }

  body.innosaw-touch-device .mobile-notes-preview {
    display: none !important;
  }

  body.innosaw-touch-device .mobile-notes-block:not(.mobile-notes-expanded) .mobile-notes-body,
  body.innosaw-touch-device .mobile-notes-block:not(.mobile-notes-expanded) #customerNotesExpandedWrapper {
    display: none !important;
  }

  body.innosaw-touch-device .mobile-notes-block.mobile-notes-expanded .mobile-notes-toggle {
    display: none;
  }

  body.innosaw-touch-device .mobile-notes-block.mobile-notes-expanded .mobile-notes-body,
  body.innosaw-touch-device .mobile-notes-block.mobile-notes-expanded #customerNotesExpandedWrapper {
    display: block !important;
  }

  body.innosaw-touch-device .mobile-notes-body textarea,
  body.innosaw-touch-device #customerNotesExpandedWrapper textarea {
    min-height: 72px !important;
    font-size: 14px !important;
  }

  body.innosaw-touch-device .mobile-notes-hint {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.3;
    color: var(--theme-fg-muted, #64748b);
  }

  body.innosaw-touch-device #customerNotesSection.mobile-notes-block {
    margin: 6px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }
}

/* Compact order-page side panels — portrait + landscape touch */
@media (max-width: 900px) {
  body.innosaw-touch-device main#app .panel-left,
  body.innosaw-touch-device main#appMainLayout .panel-left,
  body.innosaw-touch-device main#app .panel-right,
  body.innosaw-touch-device main#appMainLayout .panel-right {
    padding: 6px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  body.innosaw-touch-device .panel-left h3,
  body.innosaw-touch-device .panel-right h3,
  body.innosaw-touch-device .panel-right h5 {
    font-size: 11px !important;
    margin: 0 0 4px !important;
    padding-bottom: 4px !important;
  }

  body.innosaw-touch-device .panel-left label,
  body.innosaw-touch-device .panel-right label {
    font-size: 10px !important;
    margin: 0 0 2px !important;
    line-height: 1.15 !important;
  }

  body.innosaw-touch-device .panel-left select,
  body.innosaw-touch-device .panel-left input:not([type="checkbox"]):not([type="radio"]),
  body.innosaw-touch-device .panel-left textarea,
  body.innosaw-touch-device .panel-left .btn-secondary-lite {
    min-height: 34px !important;
    height: auto !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
    margin-bottom: 2px !important;
  }

  body.innosaw-touch-device .panel-left .btn-cart-primary,
  body.innosaw-touch-device #addToCartButton {
    min-height: 38px !important;
    font-size: 13px !important;
    margin-top: 4px !important;
  }

  body.innosaw-touch-device #doorSelectionSection {
    display: block;
  }

  body.innosaw-touch-device .mobile-field-cell label {
    margin: 0 !important;
  }

  body.innosaw-touch-device .mobile-field-cell input,
  body.innosaw-touch-device .mobile-field-cell select {
    width: 100% !important;
    margin: 0 !important;
  }

  body.innosaw-touch-device #unifiedParametricCatalogStatus,
  body.innosaw-touch-device #unifiedParametricSelectedStatus,
  body.innosaw-touch-device #unifiedParametricSmokePanel,
  body.innosaw-touch-device #unifiedParametricOptionsPanel {
    padding: 6px !important;
    margin: 4px 0 !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
  }

  body.innosaw-touch-device #pricingSection,
  body.innosaw-touch-device .door-pricing-section {
    margin: 0 !important;
    padding: 0 !important;
  }

  body.innosaw-touch-device #priceBreakdown,
  body.innosaw-touch-device .door-pricing-section,
  body.innosaw-touch-device .basic-info-grid {
    font-size: 10px !important;
    line-height: 1.3 !important;
  }

  body.innosaw-touch-device #priceBreakdown > div,
  body.innosaw-touch-device .door-pricing-section > div {
    margin-bottom: 4px !important;
    padding-top: 4px !important;
  }

  body.innosaw-touch-device #totalPriceDisplay {
    font-size: 13px !important;
  }

  body.innosaw-touch-device #hingeCountText {
    font-size: 10px !important;
    margin: 2px 0 !important;
  }

  body.innosaw-touch-device .viewer-3d-controls__btn {
    min-height: 28px !important;
    height: 28px !important;
    font-size: 9px !important;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  body.landscape-desktop.innosaw-touch-device .viewer-3d-controls__btn {
    min-height: 24px !important;
    height: 24px !important;
    font-size: 8px !important;
  }

  body.landscape-desktop.innosaw-touch-device main#app .panel-left select,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left select,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left input,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left input,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left textarea,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left textarea,
  body.landscape-desktop.innosaw-touch-device main#app .panel-left button,
  body.landscape-desktop.innosaw-touch-device main#appMainLayout .panel-left button {
    min-height: 30px !important;
    font-size: 11px !important;
    padding: 3px 5px !important;
  }

  body.landscape-desktop.innosaw-touch-device .panel-right #pricingSection h3 {
    font-size: 10px !important;
    margin-bottom: 2px !important;
  }

  body.landscape-desktop.innosaw-touch-device #priceBreakdown,
  body.landscape-desktop.innosaw-touch-device .door-pricing-section {
    font-size: 9px !important;
  }

  body.landscape-desktop.innosaw-touch-device #totalPriceDisplay {
    font-size: 12px !important;
  }

  body.landscape-desktop.innosaw-touch-device .mobile-notes-toggle {
    min-height: 28px !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }
}

/* Door portrait: viewer → pricing → form inputs */
@media (max-width: 900px) and (orientation: portrait) {
  body.innosaw-touch-device main#appMainLayout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.innosaw-touch-device main#appMainLayout .panel-middle {
    order: 1 !important;
    width: 100% !important;
  }

  body.innosaw-touch-device main#appMainLayout .panel-right {
    order: 2 !important;
    width: 100% !important;
  }

  body.innosaw-touch-device main#appMainLayout .panel-left {
    order: 3 !important;
    width: 100% !important;
  }

  body.innosaw-touch-device main#appMainLayout #viewerContainer {
    min-height: 240px !important;
    max-height: 42vh !important;
  }
}

/* Hide sign-in FAB while guided setup / selections modal is open */
body.innosaw-touch-device:has(#doorStyleModal.modal[style*="display: block"]) .innosaw-account-fab,
body.innosaw-touch-device:has(#doorStyleModal.modal[style*="display:block"]) .innosaw-account-fab,
body.innosaw-touch-device:has(#doorStyleModal.modal[style*="display: flex"]) .innosaw-account-fab,
body.innosaw-touch-device:has(#doorStyleModal.modal[style*="display:flex"]) .innosaw-account-fab,
body.innosaw-touch-device:has(#doorStyleModal[style*="display: block"]) .innosaw-account-fab,
body.innosaw-touch-device:has(#doorStyleModal[style*="display:block"]) .innosaw-account-fab,
body.innosaw-touch-device:has(#doorStyleModal[style*="display: flex"]) .innosaw-account-fab,
body.innosaw-touch-device:has(#doorStyleModal[style*="display:flex"]) .innosaw-account-fab {
  display: none !important;
}
