/* ELIUM mobile hotfix 2026-10-03. Desktop styles remain unchanged. */
@media (max-width: 760px) {
  .app-shell { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .app-shell > *, .main, .topbar, .queue-tools > * { min-width: 0; }
  .topbar { gap: 10px; flex-wrap: wrap; }
  .topbar h1 { font-size: 21px; overflow-wrap: anywhere; }
  .topbar .user-menu { margin-left: auto; flex-wrap: wrap; gap: 8px; }
  .main { padding: 14px 12px 24px; }
  .queue-tools { gap: 10px; }
  .queue-tools .search-wrap, .queue-tools .filter-search,
  .queue-tools select { width: 100%; max-width: none; min-width: 0; }
  .queue-tools input, .queue-tools select { min-height: 44px; font-size: 16px; }
  .queue-result { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .queue-result .table-wrap { width: 100%; overflow: visible; }
  .ticket-table { display: block; width: 100%; min-width: 0; }
  .ticket-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .ticket-table tbody { display: grid; gap: 12px; width: 100%; }
  .ticket-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px; padding: 16px; border: 1px solid var(--border);
    border-radius: 12px; background: var(--panel); min-width: 0;
  }
  .ticket-table tbody tr:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
  }
  .ticket-table tbody tr td {
    display: block; padding: 0; border: 0; min-width: 0;
    max-width: 100%; white-space: normal; overflow-wrap: anywhere;
  }
  .ticket-table td:nth-child(1) {
    grid-column: 1; grid-row: 1; align-self: center;
    font-size: 13px; font-weight: 650;
  }
  .ticket-table td:nth-child(5) { grid-column: 2; grid-row: 1; justify-self: end; }
  .ticket-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .ticket-table td:nth-child(3) {
    grid-column: 1 / -1; grid-row: 3; font-size: 13px;
  }
  .ticket-table td:nth-child(4) { grid-column: 1; grid-row: 4; align-self: end; }
  .ticket-table td:nth-child(6) { grid-column: 2; grid-row: 4; font-size: 13px; }
  .ticket-table td:nth-child(7) {
    grid-column: 1 / -1; grid-row: 5; padding-top: 10px;
    border-top: 1px solid var(--border); color: var(--muted); font-size: 12px;
  }
  .ticket-table td:nth-child(3)::before,
  .ticket-table td:nth-child(6)::before {
    display: block; margin-bottom: 3px; font-size: 11px; color: var(--muted);
  }
  .ticket-table td:nth-child(3)::before { content: "Организация / объект"; }
  .ticket-table td:nth-child(6)::before { content: "Исполнитель"; }
  .ticket-table td:nth-child(7)::before { content: "Обновлена: "; }
  .ticket-table .ticket-subject-line { align-items: flex-start; min-width: 0; }
  .ticket-table .ticket-subject {
    white-space: normal; overflow: visible; text-overflow: clip;
    max-width: none; min-width: 0; overflow-wrap: anywhere;
    font-size: 16px; line-height: 1.4;
  }
  .ticket-table .unread-dot { margin-top: 7px; }
  .ticket-table .ticket-secondary { overflow-wrap: anywhere; }
  .ticket-table .status-chip, .ticket-table .priority-chip {
    max-width: 100%; white-space: normal; overflow-wrap: anywhere;
  }
  .queue-pager { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .queue-pager > :not(button) { text-align: center; overflow-wrap: anywhere; }
  .queue-pager button { min-height: 44px; padding: 8px; }
  .primary, .ghost, .mobile-nav button { min-height: 44px; }
  .mobile-nav { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .auth-shell { padding: 16px; min-height: 100dvh; }
  .auth-card { padding: 24px 20px; }
  .field input, .field select, .field textarea, .chat-composer textarea {
    font-size: 16px; min-width: 0; max-width: 100%;
  }
  .form-panel, .ticket-detail { width: 100%; min-width: 0; }
  .form-grid > *, .detail-facts > *, .sla-facts > * { min-width: 0; }
  .form-actions { flex-wrap: wrap; }
  .detail-context, .detail-description, .workflow-history,
  .bubble-files a, .attachment { overflow-wrap: anywhere; }
  .detail-state > *, .detail-priority, .detail-priority select { max-width: 100%; }
  .detail-state .status-chip, .detail-state .priority-chip { white-space: normal; }
  .ticket-actions { margin: 12px; padding: 12px; }
  .ticket-actions h3 { grid-column: 1 / -1; }
  .ticket-actions button { min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
  .attachment { min-width: 0; max-width: 100%; }
  .attachment > * { min-width: 0; }
  .composer-footer { flex-wrap: wrap; gap: 10px; }
  .composer-tools { flex-wrap: wrap; }
  .tool-button, .send-button { width: 44px; height: 44px; }
  .emoji-picker { grid-template-columns: repeat(6, 32px); max-width: calc(100vw - 64px); }
  .chat-message { max-width: 94%; min-width: 0; }
  .message-selection-bar { flex-wrap: wrap; padding: 10px 12px; }
  .sla-panel { padding: 14px 17px; }
  .sla-heading { flex-wrap: wrap; }
  .transfer-dialog { padding: 18px; max-width: calc(100vw - 24px); }
}
@media (max-width: 360px) {
  .ticket-actions, .detail-facts { grid-template-columns: minmax(0, 1fr); }
}
