/* Mobile navigation and categories; preserve the production Vue application. */
.workspace .miniapp-nav, .workspace .welcome-toggle { display: none; }

@media (max-width: 1180px), (max-width: 1366px) and (pointer: coarse) {
  :root body .workspace { --workspace-bottom-space: calc(82px + env(safe-area-inset-bottom, 0px)); }
  :root body .workspace .workspace-body { display: block; min-height: calc(100dvh - 60px); }
  :root body .workspace .sidebar,
  :root body .workspace .sidebar.collapsed { display: none; }
  :root body .workspace .content {
    width: 100%; max-width: 100%; min-width: 0; overflow: visible;
    padding-bottom: calc(var(--workspace-bottom-space) + 24px);
  }
  :root body .workspace .agents-page .welcome,
  :root body .workspace .welcome-toggle { display: none; }
  :root body .workspace .filter-bar {
    display: flex; flex-direction: column; align-items: stretch; gap: 10px;
    border: 0; border-radius: 0; background: none; box-shadow: none;
    padding: 0; margin-bottom: 18px;
  }
  :root body .workspace .cat-scroll {
    display: flex; flex: none; width: 100%; min-width: 0; flex-wrap: wrap;
    gap: 2px 10px; overflow: visible; padding: 0; scrollbar-width: none;
  }
  :root body .workspace .cat-chip,
  :root body .workspace .cat-chip:hover,
  :root body .workspace .cat-chip.active {
    display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px;
    min-height: 40px; max-width: 100%; padding: 4px 0; border: 0; border-radius: 0;
    background: transparent; box-shadow: none; transform: none; filter: none; transition: color .15s ease;
    font-size: 12px; line-height: 1.5; white-space: normal; text-align: left;
    color: var(--text-secondary);
  }
  :root body .workspace .cat-chip svg { flex-shrink: 0; }
  :root body .workspace .cat-chip.active,
  :root body .workspace .cat-chip:hover { color: var(--color-primary); }
  :root body .workspace .cat-chip.active { font-weight: 700; }
  :root body .workspace .cat-chip:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
  :root body .workspace .cat-count { display: none; }
  :root body .workspace .search-input { width: 100%; min-width: 0; margin-top: 0; }
  :root body .workspace .miniapp-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
    position: fixed; inset: auto 0 0; z-index: 480; height: var(--workspace-bottom-space);
    padding: 8px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--border); background: var(--bg-base);
    box-shadow: 0 -5px 24px rgba(0, 0, 0, .12); overflow: visible;
  }
  :root body .workspace .miniapp-link {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    gap: 5px; min-width: 0; min-height: 60px; padding: 3px 0;
    color: var(--text-secondary); text-decoration: none; font-size: 11px; line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
  }
  :root body .workspace .miniapp-icon { display: grid; place-items: center; width: 28px; height: 28px; }
  :root body .workspace .miniapp-icon svg { width: 23px; height: 23px; }
  :root body .workspace .miniapp-label { white-space: nowrap; }
  :root body .workspace .miniapp-link.active { color: var(--color-primary); font-weight: 700; }
  :root body .workspace .miniapp-link:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; border-radius: 10px; }
  :root body .workspace .miniapp-ai .miniapp-icon {
    width: 44px; height: 44px; border-radius: 16px;
    background: linear-gradient(140deg, #23efba, #36bde3);
    color: #053b40; box-shadow: 0 3px 14px rgba(0, 229, 160, .24);
  }
  :root body .workspace .miniapp-ai .miniapp-icon svg { width: 29px; height: 29px; }
  :root body .workspace .miniapp-ai { gap: 4px; color: var(--text-primary); }
  :root body .workspace .miniapp-ai.active { color: var(--color-primary); }
  :root body .workspace .profile-drawer,
  :root body .workspace.side-collapsed .profile-drawer {
    left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top));
    bottom: max(12px, env(safe-area-inset-bottom)); width: min(520px, calc(100vw - 24px));
  }
  :root body .workspace .sw-tab { bottom: calc(var(--workspace-bottom-space) + 20px); }
  :root body .workspace .sw-panel { bottom: calc(var(--workspace-bottom-space) + 12px); max-height: calc(100dvh - var(--workspace-bottom-space) - 96px); }
}

@media (max-width: 700px) {
  :root body .workspace .agents-page .grid,
  :root body .workspace .channel-page .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  :root body .workspace .agent-card { min-width: 0; padding: 12px 10px; }
  :root body .workspace .agent-card .card-top { gap: 4px; flex-wrap: wrap; min-height: 40px; }
  :root body .workspace .agent-card .agent-icon-tile { width: 40px !important; height: 40px !important; }
  :root body .workspace .agent-card .agent-icon-tile svg { width: 23px; height: 23px; }
  :root body .workspace .agent-card .badge { font-size: 10px; padding: 3px 6px; }
  :root body .workspace .agent-card .agent-cat { font-size: 11px; margin-top: 12px; overflow-wrap: anywhere; }
  :root body .workspace .agent-card .agent-name { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
  :root body .workspace .agent-card .agent-desc { font-size: 11px; min-height: 35px; overflow-wrap: anywhere; }
  :root body .workspace .agent-card .agent-tags { gap: 4px; margin-top: 8px; }
  :root body .workspace .agent-card .tag { font-size: 10px; padding: 3px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  :root body .workspace .agent-card .card-bottom { gap: 5px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
  :root body .workspace .agent-card .price,
  :root body .workspace .agent-card .open-link { font-size: 11px; }
  :root body .workspace .agent-card .quality-line { flex-wrap: wrap; gap: 3px; }
  :root body .workspace .agent-card .quality-stars { font-size: 11px; letter-spacing: 0; }
}
