/* ---------- Mobile Results Tray ---------- */
/* Only visible on mobile (< 768px) */

.mobile-results-tray {
  display: none;
}

@media (max-width: 767px) {
  .mobile-results-tray {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    transition: max-height 0.2s ease-out;
    max-height: 48px;
    overflow: hidden;
  }

  .mobile-results-tray.expanded {
    max-height: 40vh;
  }

  /* ---------- Header / Collapsed ---------- */

  .tray-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    min-height: 48px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
  }

  .tray-drag-handle {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin-bottom: 6px;
  }

  .tray-last-result {
    font-size: 13px;
    font-family: var(--mono);
    color: var(--text);
  }

  /* ---------- Expanded Content ---------- */

  .tray-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .tray-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
  }

  .tray-result-item:active {
    background: var(--accent-bg);
  }

  .tray-result-item.copied {
    background: var(--success-bg);
  }

  .tray-result-line {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text);
    opacity: 0.4;
    width: 40px;
    flex-shrink: 0;
  }

  .tray-result-expr {
    flex: 1;
    font-size: 13px;
    font-family: var(--mono);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tray-result-value {
    font-size: 13px;
    font-family: var(--mono);
    color: var(--result-number, var(--text-h));
    font-weight: 500;
    flex-shrink: 0;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tray-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text);
    opacity: 0.4;
  }
}
