/* EelaDesk mobile/PWA layout corrections — 2026-09-04 */

html {
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body,
.app-content,
.app-content > .container,
main {
  max-width: 100%;
}

img,
video,
canvas,
iframe {
  max-width: 100%;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  body.app-with-sidebar {
    width: 100%;
    min-width: 0;
    padding-top: calc(60px + env(safe-area-inset-top));
  }

  .mobile-app-header {
    height: calc(60px + env(safe-area-inset-top));
    padding: calc(7px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left));
  }

  .mobile-brand img {
    width: 66px !important;
    max-width: 66px !important;
    height: 38px !important;
  }

  .app-sidebar {
    top: 0;
    width: min(88vw, 320px);
    max-width: 320px;
    padding-top: env(safe-area-inset-top);
  }

  .app-content {
    width: 100% !important;
    min-width: 0;
    margin-left: 0 !important;
  }

  .app-content > .container {
    width: 100% !important;
    min-width: 0;
    margin: 10px 0 22px;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .grid,
  .split,
  .calendar-shell,
  .form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .grid > *,
  .split > *,
  .calendar-shell > *,
  .form-grid > *,
  [class*="span-"] {
    min-width: 0;
    grid-column: 1 / -1 !important;
  }

  .toolbar,
  .hero .toolbar,
  .hero-actions {
    width: 100%;
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .toolbar > div,
  .hero .toolbar > div {
    min-width: 0;
    max-width: 100%;
  }

  .hero .toolbar > div:last-child,
  .toolbar > div:last-child {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero .toolbar .btn,
  .hero-actions .btn {
    flex: 1 1 150px;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  button,
  .btn {
    max-width: 100%;
  }

  textarea {
    min-height: 120px;
  }

  .dev-board,
  .development-board,
  .kanban-board {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .dev-column,
  .kanban-column {
    min-width: min(82vw, 310px);
    scroll-snap-align: start;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 18px 16px !important;
    border-radius: 14px !important;
  }

  .hero h1 {
    font-size: clamp(21px, 7vw, 27px) !important;
    overflow-wrap: anywhere;
  }

  .hero p {
    margin-bottom: 0;
  }

  .card {
    padding: 14px !important;
    border-radius: 13px !important;
  }

  .card h2 {
    font-size: 20px;
  }

  .hero .toolbar .btn,
  .hero-actions .btn,
  .toolbar > .btn,
  .toolbar > a.btn,
  form > button[type="submit"] {
    width: 100%;
    flex-basis: 100%;
  }

  .table {
    min-width: 680px;
  }

  .mobile-brand small {
    display: none;
  }
}

@media (display-mode: standalone) and (max-width: 900px) {
  .mobile-app-header {
    user-select: none;
    -webkit-user-select: none;
  }
}
