/* Mobile: single-column, one panel at a time, bottom navigation. */

@media (max-width: 1100px) and (min-width: 801px) {
  .brand .ver {
    display: none;
  }
  .topbar .badge-text {
    display: none;
  }
  .tool-btn .tool-label {
    display: none;
  }
  .tool-btn {
    padding: 0 9px;
  }
}

@media (max-width: 800px) {
  .app {
    grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--nav-h);
  }

  .topbar {
    padding: 0 10px;
  }
  .topbar .desktop-only,
  .topbar .topbar-sep {
    display: none;
  }
  .topbar .btn .btn-label {
    display: none;
  }
  .topbar .btn {
    padding: 0 10px;
  }
  .topbar .btn-primary .btn-label {
    display: inline;
  }

  .workspace {
    display: block;
    position: relative;
  }
  .workspace > .panel,
  .workspace > .panel-center {
    position: absolute;
    inset: 0;
    display: none;
    border: 0;
  }
  .workspace[data-mobile-tab='files'] > .panel-left,
  .workspace[data-mobile-tab='canvas'] > .panel-center,
  .workspace[data-mobile-tab='controls'] > .panel-right,
  .workspace[data-mobile-tab='queue'] > .panel-queue {
    display: flex;
  }
  .resizer,
  .panel-header .collapse-btn {
    display: none;
  }

  .panel-header {
    min-height: 46px;
  }
  .viewport {
    padding: 12px;
  }
  .toolbar-file {
    display: none;
  }
  .tool-btn .tool-label {
    display: none;
  }
  .tool-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  .toolbar {
    height: 50px;
  }
  .icon-btn,
  .lock-btn {
    min-width: 38px;
    min-height: 38px;
  }
  .icon-btn.sm {
    min-width: 34px;
    min-height: 34px;
  }
  .btn {
    height: 40px;
  }
  .btn-sm {
    height: 34px;
  }
  .input,
  .select {
    height: 40px;
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }
  .seg-btn {
    height: 34px;
  }
  .acc-head {
    padding: 14px;
  }

  .help-cols {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 6;
  }
  .bottom-nav button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
  }
  .bottom-nav button[aria-current='page'] {
    color: var(--primary);
  }
  .bottom-nav button[aria-current='page']::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28%;
    right: 28%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--primary);
  }
  .bottom-nav .nav-badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    min-width: 17px;
    padding: 0 5px;
    height: 17px;
    line-height: 17px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
  }

  .toasts {
    left: 12px;
    right: 12px;
    top: auto;
    transform: none;
    bottom: calc(var(--nav-h) + 10px);
    width: auto;
  }

  /* Toolbar must fit a phone without scrolling: keep tools, navigation and zoom out/in/fit. */
  .toolbar {
    padding: 0 6px;
    gap: 2px;
  }
  .toolbar .mobile-hide {
    display: none;
  }
  .toolbar .icon-btn,
  .toolbar .tool-btn {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
  }
  .toolbar .zoom-label {
    min-width: 42px;
  }
}

@media (max-width: 440px) {
  .brand .ver {
    display: none;
  }
  /* The page heading stays for screen readers when there is no room to show it. */
  .brand .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .panel-queue .btn-label {
    display: none;
  }
  .q-summary {
    display: none;
  }
  .progress {
    width: 70px;
  }
}
