/* P2 v424: mobile/small-screen layout reliability. Business logic stays untouched. */
@media (max-width: 760px) {
  .platform-shell {
    min-height: 100dvh;
  }

  .platform-header {
    gap: 8px;
    padding: 9px 10px 8px;
  }

  .platform-brand-line {
    width: 100%;
    flex-wrap: nowrap;
  }

  .brand-dealer-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .platform-header-actions {
    width: calc(100% + 20px);
    margin-inline: -10px;
    padding: 1px 10px 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
  }

  .platform-header-actions button,
  .platform-header-actions .platform-nav-link {
    flex: 0 0 auto;
    min-height: 42px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .platform-page {
    min-width: 0;
    padding: 12px 10px max(18px, env(safe-area-inset-bottom));
  }

  .platform-page-head {
    gap: 10px;
    margin-bottom: 14px;
  }

  .platform-page-head > button,
  .platform-page-head > .form-actions {
    width: 100%;
  }

  .platform-page-head > button {
    min-height: 44px;
  }

  .installer-page .content-card,
  .installer-page .installer-task,
  .installer-page .installer-node,
  .installer-page .installation-coordination-card {
    min-width: 0;
  }

  .installer-task-head,
  .installer-handoff-panel .section-title-row,
  .installer-today-panel .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .installer-task-head > span,
  .installer-status-pill {
    align-self: flex-start;
    white-space: normal;
  }

  .installer-task-actions,
  .installer-node-actions,
  .installer-page .coordination-actions,
  .installer-page .handoff-accept-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .installer-task-actions .primary,
  .installer-page .handoff-accept-actions .primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .installer-task-actions button,
  .installer-node-actions button,
  .installer-page .coordination-actions button,
  .installer-page .handoff-accept-actions button {
    width: 100%;
    min-height: 44px;
    white-space: normal;
  }

  .installer-node .upload-placeholder {
    min-width: 0;
  }

  .installer-node input[type="file"] {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
  }

  .installer-page .coordination-message-box input {
    min-height: 44px;
    font-size: 16px;
  }

  .installer-page .coordination-message-box button {
    min-height: 44px;
  }

  #app > div.customer-share-page {
    height: 100dvh;
  }

  .customer-share-page {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .customer-story-nav {
    scroll-snap-type: inline mandatory;
    scroll-padding-inline: 8px;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .customer-story-nav button {
    min-height: 44px;
    scroll-snap-align: start;
  }

  .customer-long-image-scroll,
  .customer-config-quote-section .customer-config-table-scroll {
    scroll-padding-inline: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .customer-mobile-table-hint {
    position: sticky;
    left: 0;
    z-index: 4;
  }

  .customer-share-fixed-cta {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-height: calc(100dvh - 16px);
  }

  .customer-share-fixed-cta button {
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .customer-share-fixed-cta:not(.quote-only) {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .customer-share-fixed-cta:not(.quote-only) .primary {
    grid-column: 1 / -1;
  }

  .customer-share-page:has(.customer-share-fixed-cta:not(.quote-only)) {
    padding-bottom: calc(154px + env(safe-area-inset-bottom));
  }

  .customer-share-hero h1,
  .customer-share-decision-card h3,
  .customer-config-sheet-heading h3 {
    overflow-wrap: anywhere;
  }

  .installer-task-actions,
  .installer-page .coordination-actions,
  .installer-page .handoff-accept-actions {
    grid-template-columns: 1fr;
  }

  .installer-task-actions .primary,
  .installer-page .handoff-accept-actions .primary {
    grid-column: 1;
  }
}

@media (min-width: 761px) and (max-width: 1024px) {
  .platform-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-header-actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .platform-header-actions button,
  .platform-header-actions .platform-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .installer-task-grid,
  .installer-node-grid {
    grid-template-columns: 1fr;
  }
}
