/* Phone layout. Screen-only: the one-page printed report keeps its own layout. */
@media screen and (max-width: 767px) {
  html { scroll-padding-bottom: 110px; }
  body { -webkit-text-size-adjust: 100%; }
  .app-shell, .main-shell, .form-column, .work-fields, .field { min-width: 0; }
  .eco-auth-bar { height: auto; min-height: 44px; gap: 8px; padding: 6px 12px; flex-wrap: wrap; }
  .eco-auth-bar span { overflow-wrap: anywhere; }
  .eco-auth-bar a { min-height: 32px; display: inline-flex; align-items: center; }
  .topbar { padding: 0 14px; }
  .topbar-date { display: none; }
  .dashboard { padding: 24px 12px; }
  .editor { padding: 16px 12px calc(125px + env(safe-area-inset-bottom)); }
  .editor-layout { display: block; }
  .identity-strip, .form-grid, .form-grid.two-cols, .task-fields,
  .atelier-dialog .form-grid, .equipment-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .identity-strip { padding: 18px 16px; }
  .form-grid > .field, .signature-fields > .field:first-child,
  .task-fields > .field:only-child, .equipment-row > .field,
  .atelier-dialog .form-grid > .field { grid-column: 1; grid-row: auto; }
  .work-section { padding: 22px 16px; scroll-margin-top: 16px; }
  .section-header { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .section-header h2 { font-size: 19px; line-height: 1.3; }
  .section-header p { max-width: none; font-size: 13px; line-height: 1.5; }
  .section-action { grid-column: 1 / -1; margin: 4px 0 0; }
  .section-action > button { width: 100%; }
  .app-shell button, .atelier-dialog button, .pdf-dialog button { min-height: 44px; font-size: 14px; }
  .app-shell button[data-size="icon"], .atelier-dialog button[data-size="icon"] { min-width: 44px; }
  .field input, .field select, .field textarea, .add-task-bar select,
  .search-box input, .atelier-dialog input, .atelier-dialog select { font-size: 16px !important; min-height: 48px; max-width: 100%; }
  .field textarea { min-height: 100px; }
  .field > span:first-child:not(.input-action):not(.unit-input),
  .atelier-dialog .field > span:first-child { font-size: 14px !important; line-height: 1.4; }
  .field input, .field select { width: 100%; min-width: 0; }
  .input-action { display: flex; min-width: 0; gap: 8px; }
  .input-action > input, .input-action > [data-slot="native-select-wrapper"] { flex: 1; min-width: 0; width: 0; }
  .input-action > button { flex-shrink: 0; min-width: 48px; }
  .unit-input small { top: 17px; }
  .add-task-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .add-task-bar > button { width: 100%; }
  .task-card { padding: 0 14px 14px; }
  .task-card h3 { font-size: 16px; }
  .task-card header > button { min-width: 44px; }
  .task-notes summary { padding: 14px 0; font-size: 14px; }
  .allocation-strip { flex-direction: column; gap: 10px; font-size: 14px; }
  .allocation-strip > span { max-width: none; }
  .allocation-strip > b { font-size: 16px; }
  .employee-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 44px 44px; gap: 12px 6px; }
  .employee-name { grid-column: 2 / -1; overflow-wrap: anywhere; }
  .employee-duration { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .employee-transport { grid-column: 1 / -1; grid-row: 3; text-align: left; min-width: 0; }
  .employee-duration, .employee-transport { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px; }
  .employee-row strong { font-size: 16px; }
  .employee-row small { font-size: 13px; }
  .employee-row > button { grid-row: 4; width: 44px; height: 44px; }
  .employee-row > button:nth-last-child(2) { grid-column: 3; }
  .employee-row > button:last-child { grid-column: 4; }
  .team-totals { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .team-totals span { font-size: 14px; }
  .equipment-row { padding: 18px 0; border-bottom: 1px solid #e4e7e4; }
  .equipment-row > button { grid-column: 1; grid-row: auto; justify-self: end; width: 44px; }
  .signature-pad canvas { height: 190px; }
  .signature-pad > div { flex-wrap: wrap; gap: 8px; }
  .photo-tile > button { min-width: 44px; min-height: 44px; }
  .mobile-action-bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 6px; }
  .mobile-action-bar > button { padding: 0 10px; font-size: 14px; min-height: 48px; }
  .mobile-action-bar strong { font-size: 18px; }
  .mobile-action-bar small { font-size: 11px; }
  .mobile-action-bar > button svg { display: none; }
  .register-toolbar { padding: 14px 12px; }
  .search-box { min-width: 0; }
  .filters { flex-wrap: wrap; gap: 4px 14px; padding: 0 12px; }
  .order-table-header { display: none; }
  .order-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 16px; }
  .order-row > div, .order-row > .status, .order-row > svg,
  .order-row .row-date { grid-column: 1; grid-row: auto; }
  .order-row > div { min-width: 0; overflow-wrap: anywhere; }
  .order-row > .status { justify-self: start; }
  .order-row > svg { display: none; }
  .order-row strong { white-space: normal; }
  .register-footer { flex-wrap: wrap; }
  .notice > div { min-width: 0; }
  .atelier-dialog, .pdf-dialog { width: calc(100vw - 20px) !important; max-width: 560px !important; max-height: calc(100dvh - 24px) !important; overflow-y: auto; overscroll-behavior: contain; padding: 22px 16px !important; }
  .atelier-dialog [data-slot="dialog-description"], .pdf-dialog [data-slot="dialog-description"] { font-size: 14px; line-height: 1.5; }
  .atelier-dialog [data-slot="dialog-footer"], .pdf-dialog [data-slot="dialog-footer"] { display: flex; flex-direction: column; gap: 10px; }
  .atelier-dialog [data-slot="dialog-footer"] button, .pdf-dialog [data-slot="dialog-footer"] button { width: 100%; white-space: normal; height: auto; padding: 12px; }
  .atelier-dialog > button, .pdf-dialog > button { min-width: 44px; top: 4px; right: 4px; }
}
