/* Components added by the 2026-08-17 reachability pass.
 *
 * Three unrelated pieces share one stylesheet because app.css is at its size
 * budget and three ~50-line files would be worse: the queue strip, the mobile
 * bottom-bar overflow, and the uk-select primitive. (It was briefly named
 * queue-strip.css, which stopped being true the moment the second one landed.)
 *
 * ─── Queue strip container ──────────────────────────────────────────────────
 *
 * renderQ() in app.js has always rendered a complete strip — summary bar, ETA,
 * per-job cards with thumbnails, progress and cancel/retry — and every INNER
 * class (.qc, .qc-thumb, .q-summary, .qc-progress) has styling in app.css.
 * Only the CONTAINER was missing: no #qstrip in the template and no .qstrip
 * rule anywhere. So renderQ returned on its first line and the sidebar pill's
 * onclick="toggleQBar()" called a function that does not exist.
 *
 * Separate stylesheet because app.css is at its size budget.
 */
.qstrip {
  display: none;
  margin: 0 0 12px;
  padding: 0;
  background: var(--glass-bg, rgba(255, 255, 255, .03));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, .07));
  border-radius: 12px;
  overflow: hidden;
}
.qstrip.open { display: block; }
.qstrip.collapsed .qstrip-inner { display: none; }

.qstrip-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The strip is a status surface, not a destination — never let it push the
   workspace off-screen on a small viewport. */
@media (max-width: 480px) {
  .qstrip-inner { max-height: 180px; }
}

/* ─── P6.3 · Mobile bottom bar: 5 destinations + More ────────────────────────
 * The bar previously carried every section plus the footer utility group —
 * 11+ destinations in a horizontally-scrolling row, where every mobile platform
 * convention is 5 and an overflow affordance. Scrolling nav is reachable but
 * undiscoverable: nothing indicates there is more to the right.
 *
 * Five items carry data-mobile-primary and stay inline. The rest are hidden
 * until #sidebar gains .more-open, at which point they wrap above the bar as a
 * sheet. Above 480px nothing here applies and the sidebar is unchanged.
 */
.sidebar-more-wrap { display: none; }

@media (max-width: 480px) {
  .sidebar-more-wrap { display: flex; }

  #sidebar .sidebar-item:not([data-mobile-primary]):not(.sidebar-more) {
    display: none;
  }
  #sidebar.more-open .sidebar-item:not([data-mobile-primary]):not(.sidebar-more) {
    display: flex;
  }
  #sidebar.more-open .sidebar-nav {
    flex-wrap: wrap;
    align-content: flex-end;
    max-height: 60vh;
    overflow-y: auto;
  }
  #sidebar.more-open {
    background: var(--bg, #060607);
  }
  /* No horizontal scroll once the count is bounded — the affordance is the
     More button, not a hidden scroll region. */
  #sidebar, #sidebar .sidebar-nav { overflow-x: visible; }
  .sidebar-more[aria-expanded="true"] { color: var(--accent-strong, #76767f); }
}

/* ─── P6.4 · uk-select ───────────────────────────────────────────────────────
 * Styling for uiKit.enhanceSelect. The native <select> stays in the DOM as the
 * source of truth and is visually hidden, so form semantics, .value, change
 * events and every existing querySelector keep working — and if the JS never
 * runs, the native control is still there and usable.
 */
.uk-select { position: relative; display: inline-block; width: 100%; }
.uk-select > select {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.uk-select-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: var(--text-xs, 12px);
  color: var(--t1);
  background: var(--surface-1, rgba(255, 255, 255, .04));
  border: 1px solid var(--border, rgba(255, 255, 255, .07));
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.uk-select-btn::after {
  content: '';
  flex: none;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .6;
}
.uk-select-btn:hover { border-color: var(--accent, #606068); }
.uk-select-btn:focus-visible { outline: 2px solid var(--accent-strong, #76767f); outline-offset: 1px; }
.uk-select-btn[disabled] { opacity: .5; cursor: not-allowed; }
.uk-select-list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px); left: 0; right: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-elev, #101012);
  border: 1px solid var(--border, rgba(255, 255, 255, .09));
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.uk-select-item {
  padding: 6px 8px;
  border-radius: 5px;
  font-size: var(--text-xs, 12px);
  color: var(--t2);
  cursor: pointer;
}
.uk-select-item:hover { background: rgba(255, 255, 255, .06); color: var(--t1); }
.uk-select-item.is-selected { background: var(--accent-soft, rgba(255, 255, 255, .08)); color: var(--t1); }
.uk-select-item[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
