/* Wave 3 — mobile workflows that matter (≤1024px)
   Assign spools · Print post · Project feasibility
   Depends on mobile-phase-a.css */

@media (max-width: 1024px) {
  /* ----- Print post: readable single column ----- */
  .print-post-main {
    padding: 0.75rem 0.75rem 6rem !important;
    align-items: stretch !important;
    width: 100%;
    box-sizing: border-box;
  }

  .print-post-header {
    text-align: left !important;
    width: 100%;
    max-width: 100% !important;
    padding: 0 0.25rem !important;
  }

  .print-post-header .site-title {
    font-size: 1.35rem !important;
    line-height: 1.25;
    flex-wrap: wrap;
  }

  .print-3col-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin-bottom: 1rem !important;
  }

  .print-col,
  .print-img-col,
  .print-summary-col,
  .print-spoolman-col {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .print-img-col img {
    max-width: 100% !important;
    height: auto;
    border-radius: 12px;
  }

  .print-detail-card,
  .print-notes,
  .print-spoolman-col > * {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Put assign block early / full width / big touch targets */
  .sm-assign-spools {
    margin: 0.5rem 0 1rem;
    padding: 1rem;
    border-radius: 14px;
  }

  .sm-assign-spools--attention {
    order: -1;
  }

  .print-spoolman-col {
    display: flex;
    flex-direction: column;
  }

  .print-spoolman-col #sm-assign-spools,
  .print-spoolman-col .sm-assign-spools {
    order: -1;
  }

  .sm-assign-tray {
    padding: 0.85rem;
    margin-bottom: 0.85rem;
  }

  .sm-assign-tray-meta {
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
  }

  .sm-assign-spools-form .select2-container,
  .sm-assign-spools-form select {
    width: 100% !important;
    max-width: 100% !important;
  }

  .sm-assign-spools-form .select2-selection--single {
    min-height: 48px !important;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .sm-assign-spools-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.35 !important;
    white-space: normal !important;
    padding-right: 2rem;
  }

  .sm-assign-save-bar {
    position: sticky;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    margin: 0.75rem -0.25rem 0;
    padding: 0.65rem 0.25rem;
    background: linear-gradient(to top, rgba(12, 18, 26, 0.98) 70%, rgba(12, 18, 26, 0));
  }

  .sm-assign-save-bar .save-spools-btn {
    width: 100%;
    min-height: 52px;
    font-size: 1.05rem;
  }

  /* Status strip / homepage chips */
  .sm-status-strip {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .sm-status-chip {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  /* ----- Projects / feasibility ----- */
  .sm-feasibility-panel,
  .sm-feasibility-panel--v2 {
    padding: 1rem !important;
    margin: 0.75rem 0;
  }

  .sm-feasibility-verdict {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .sm-feasibility-verdict-title {
    font-size: 1.35rem;
  }

  .sm-feasibility-kpis {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .sm-feasibility-wishlist-bar {
    flex-direction: column;
    align-items: stretch !important;
  }

  .sm-feasibility-wl-select,
  .sm-feasibility-add-all {
    width: 100%;
    min-height: 48px;
  }

  .sm-feasibility-item-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sm-feasibility-item-row .btn--tiny,
  .sm-feasibility-add-one {
    min-height: 44px;
    width: 100%;
    font-size: 0.9rem !important;
    padding: 0.55rem 0.75rem !important;
  }

  /* Project list: build badge readable */
  .sm-feasibility-badge--compact {
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.35rem 0.55rem;
    white-space: normal;
    line-height: 1.25;
  }

  /* Page headers: stack actions */
  .sm-page-header,
  .sm-page-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .sm-page-header-actions .btn,
  .sm-page-header .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Date presets on overview/stats */
  .sm-date-presets,
  .print-date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .sm-date-presets a,
  .sm-date-presets button,
  .print-date-presets a,
  .print-date-presets button {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  /* Select2 dropdown above bottom nav */
  .select2-container--open .select2-dropdown {
    z-index: 11000;
  }

  /* Hide FAB when assigning (less clutter) */
  body.sm-assign-focus .sm-mobile-fab {
    display: none !important;
  }
}
