/* Keep the advertiser's tasks in normal flow on small screens.
   The same navigation and permission classes serve mobile and desktop. */
@media (max-width: 820px) {
  .app-shell:not(.dealer-mode) .main {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .app-shell:not(.dealer-mode) .topbar {
    height: auto;
    min-height: 72px;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .app-shell:not(.dealer-mode) .top-actions {
    flex-wrap: wrap;
    margin-left: auto;
  }

  .app-shell:not(.dealer-mode) .top-actions .secondary {
    min-height: 44px;
    padding: 10px 12px;
    font-size: .875rem;
  }

  /* Cadastrar veículo is always available in the task grid below. */
  .app-shell:not(.dealer-mode) .topbar [data-go="cadastro"] {
    display: none;
  }

  .app-shell:not(.dealer-mode) .sidebar {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    padding: 12px 16px;
    overflow: visible;
    border: 0;
  }

  .app-shell:not(.dealer-mode) .sidebar .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    height: auto;
    overflow: visible;
  }

  .app-shell:not(.dealer-mode) .sidebar .nav-item {
    min-width: 0;
    min-height: 52px;
    padding: 10px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    border: 1px solid #454039;
    border-radius: 14px;
    background: #1b1c21;
    color: #e5e6eb;
    font-size: .875rem;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .app-shell:not(.dealer-mode) .sidebar .nav-item > span {
    width: 20px;
    flex: 0 0 20px;
    color: #f0c666;
    font-size: 1.125rem;
  }

  .app-shell:not(.dealer-mode) .sidebar .nav-item:hover {
    background: #2b2c32;
    border-color: #e8bd62;
  }

  .app-shell:not(.dealer-mode) .sidebar .nav-item.active {
    background: linear-gradient(135deg, #ffe29a, #d8a52f);
    color: #17120a;
    border-color: #ffe29a;
    box-shadow: none;
  }

  .app-shell:not(.dealer-mode) .sidebar .nav-item.active > span {
    color: inherit;
  }

  .app-shell:not(.dealer-mode) .nav-count {
    display: block;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .app-shell:not(.dealer-mode) .dealer-nav {
    padding: 0 16px 12px;
    gap: 8px;
  }

  .app-shell:not(.dealer-mode) .dealer-nav a {
    flex: 1 1 120px;
    min-width: 0;
    min-height: 44px;
    padding: 10px;
    justify-content: center;
    font-size: .875rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  /* These destinations already have task buttons: Catálogo and Propostas. */
  .app-shell:not(.dealer-mode) .dealer-nav a[data-dealer-view="catalogo"],
  .app-shell:not(.dealer-mode) .dealer-nav a[data-dealer-view="propostas"] {
    display: none;
  }
}
