
/* ==========================================================================
 * 10x UI UPGRADES (2026-10-11) — Mobile-first, step-reducing design system.
 * Core principle: every interaction ≤ current steps, preferably fewer.
 * ========================================================================== */

/* ---------- Feature 1: Mobile bottom nav ---------- */
.pui-bottomnav {
  display: none; /* desktop: hidden, top tabs used */
}
@media (max-width: 768px) {
  .pui { padding-bottom: 76px; } /* room for bottom nav */
  .pui-tabs { display: none; } /* bottom nav replaces top tabs on mobile */
  .pui-bottomnav {
    display: flex; position: fixed; left: 0; right: 0;
    bottom: 0; z-index: 8000;
    background: rgba(12, 18, 30, 0.97);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border, rgba(255,255,255,.1));
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .pui-bnav-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; color: var(--muted, #8a94a6);
    min-width: 56px; min-height: 52px; padding: 6px 4px;
    font-size: 10px; font-weight: 600; cursor: pointer; border-radius: 10px;
  }
  .pui-bnav-btn.active { color: var(--accent, #4f9cf9); }
  .pui-bnav-btn.active .pui-bnav-ico {
    background: rgba(79,156,249,.15); border-radius: 12px;
  }
  .pui-bnav-ico {
    font-size: 22px; line-height: 1; padding: 4px 10px;
    display: flex; align-items: center; justify-content: center;
  }
  .pui-bnav-lbl { font-size: 10px; letter-spacing: .2px; }
  /* Voice FAB shifts above bottom nav on mobile */
  .scout-voice-fab { bottom: calc(84px + env(safe-area-inset-bottom)) !important; right: 16px !important; width: 52px !important; height: 52px !important; font-size: 22px !important; }
}
/* More sheet (overflow tabs) */
.pui-moresheet {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 8001; background: rgba(12, 18, 30, 0.98);
  border: 1px solid var(--glass-border, rgba(255,255,255,.1));
  border-radius: 16px; padding: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 6px;
  max-height: 50vh; overflow-y: auto;
}
.pui-moresheet[hidden] { display: none; }
.pui-moresheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pui-moresheet-item { justify-content: flex-start; min-height: 48px; font-size: 15px; }

/* ---------- Features 2+8: Command palette ---------- */
.pui-palette-wrap[hidden] { display: none; }
.pui-palette-wrap {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
}
.pui-palette-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.pui-palette {
  position: relative; width: 100%; max-width: 560px;
  background: rgba(16, 22, 36, 0.98);
  border: 1px solid var(--glass-border, rgba(255,255,255,.12));
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: pui-palette-in .18s ease both;
}
@keyframes pui-palette-in {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.pui-palette-input {
  width: 100%; padding: 16px 18px; font-size: 16px;
  background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--text, #fff); outline: none;
}
.pui-palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pui-palette-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px;
  background: transparent; color: var(--text, #fff);
  cursor: pointer; text-align: left; font-size: 14px;
}
.pui-palette-item.sel, .pui-palette-item:hover { background: rgba(79,156,249,.14); }
.pui-palette-ico { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; }
.pui-palette-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pui-palette-txt b { font-weight: 600; }
.pui-palette-txt .hldim { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 440px; }
.pui-palette-hint { padding: 8px 16px; font-size: 11px; color: var(--muted, #8a94a6); border-top: 1px solid rgba(255,255,255,.06); }
.pui-palette-hint kbd { background: rgba(255,255,255,.1); border-radius: 4px; padding: 1px 6px; font-size: 10px; }

/* ---------- Feature 3: Unified timeline ---------- */
.pui-timeline { display: flex; flex-direction: column; }
.pui-tl-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05); align-items: flex-start; }
.pui-tl-row:last-child { border-bottom: none; }
.pui-tl-dot {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(79,156,249,.12); border: 1px solid rgba(79,156,249,.25);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.pui-tl-body { flex: 1; min-width: 0; font-size: 13.5px; }
.pui-tl-msg { color: var(--text, #fff); }
.pui-tl-act { margin-left: 6px; padding: 2px 8px !important; min-height: 28px !important; font-size: 12px !important; }

/* ---------- Feature 4: Kanban board ---------- */
.pui-tasks-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.pui-tasks-head h4 { margin: 0; }
.pui-viewtoggle { display: flex; gap: 4px; }
.pui-viewtoggle .btn.sm { padding: 6px 12px !important; min-height: 36px !important; font-size: 13px !important; }
.pui-viewtoggle .btn.active { background: rgba(79,156,249,.2); border-color: rgba(79,156,249,.4); }
.pui-kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
@media (max-width: 768px) {
  .pui-kanban { grid-template-columns: 1fr; }
  .pui-kcol-body { max-height: none; }
}
.pui-kcol {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px; padding: 8px; min-height: 120px;
  transition: border-color .15s, background .15s;
}
.pui-kcol.dragover { border-color: var(--accent, #4f9cf9); background: rgba(79,156,249,.08); }
.pui-kcol-head { font-size: 13px; font-weight: 700; padding: 4px 6px 8px; display: flex; align-items: center; gap: 6px; }
.pui-kcol-body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.pui-kcard {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px; padding: 10px 12px; cursor: grab;
  transition: transform .12s, box-shadow .12s;
}
.pui-kcard:hover { border-color: rgba(79,156,249,.35); }
.pui-kcard.dragging { opacity: .5; transform: scale(.97); cursor: grabbing; }
.pui-kcard-title { font-size: 13.5px; font-weight: 600; cursor: text; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.pui-kcard-title:hover { background: rgba(79,156,249,.1); }
.pui-kcol-empty { text-align: center; padding: 16px 8px; font-size: 12px; }

/* ---------- Feature 5: Inline editing ---------- */
.pui-task-title[data-pui-taskedit] { cursor: text; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; transition: background .12s; }
.pui-task-title[data-pui-taskedit]:hover { background: rgba(79,156,249,.12); }
.pui-task-title[data-pui-taskedit]:focus { background: rgba(79,156,249,.15); outline: 2px solid rgba(79,156,249,.4); }
.pui-inline-edit {
  width: 100%; font-size: 14px; font-weight: 600; font-family: inherit;
  background: rgba(79,156,249,.1); border: 1px solid rgba(79,156,249,.4);
  border-radius: 6px; padding: 4px 8px; color: var(--text, #fff); outline: none;
}

/* ---------- Feature 7: Smart empty states ---------- */
.pui-empty { text-align: center; padding: 32px 20px; }
.pui-empty-ico { font-size: 44px; margin-bottom: 12px; }
.pui-empty h4 { margin: 0 0 8px; font-size: 16px; }
.pui-empty .hldim { margin: 0 0 16px; font-size: 13.5px; }
.pui-empty .btn { margin-bottom: 12px; }
.pui-empty-tip { font-size: 12.5px; color: var(--muted, #8a94a6); background: rgba(79,156,249,.07); border-radius: 10px; padding: 10px 14px; display: inline-block; margin: 0; }

/* ---------- Feature 9: Partner branding ---------- */
.pui { --pui-brand: var(--accent, #4f9cf9); }
.pui-brand-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; margin-right: 8px; vertical-align: -6px; }
.pui-head h3 { display: flex; align-items: center; }

/* ---------- Feature 10: Onboarding tour ---------- */
.pui-tour-overlay { position: fixed; inset: 0; z-index: 9600; background: rgba(0,0,0,.55); }
.pui-tour-spot {
  position: fixed; border: 2px solid var(--accent, #4f9cf9); border-radius: 12px;
  box-shadow: 0 0 0 4000px rgba(0,0,0,.45); pointer-events: none;
  transition: all .25s ease;
}
.pui-tour-card {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 9601;
  width: min(360px, calc(100vw - 32px));
  background: rgba(16, 22, 36, 0.98);
  border: 1px solid var(--accent, #4f9cf9); border-radius: 16px;
  padding: 18px; box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
@media (min-width: 769px) { .pui-tour-card { bottom: 40px; } }
.pui-tour-progress { font-size: 11px; color: var(--muted, #8a94a6); letter-spacing: 1px; margin-bottom: 6px; }
.pui-tour-card h4 { margin: 0 0 8px; font-size: 16px; }
.pui-tour-card p { margin: 0 0 14px; font-size: 13.5px; color: var(--text, #ddd); line-height: 1.5; }
.pui-tour-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pui-tour-actions .btn.sm { min-height: 38px !important; }

/* ---------- Bottom nav safe-area for tablets ---------- */
@media (min-width: 769px) {
  .pui-moresheet { display: none; }
}
