/* D5 · side menu + quick switcher + project picker. Loads after d4.css.
   - Side menu is home: a drawer on the phone, a pinned sidebar on desktop (D4 Drawer).
   - Quick switcher (D4 Sheet) on top: title tap or ⌘K. A sheet on the phone, a palette on desktop.
   - Project picker: the "harness ▾" chip under the card, or the project name in the greeting. */

/* ---- quick switcher ---- */
.sw-pal { position: absolute; z-index: 47; display: none; flex-direction: column; min-height: 0; background: var(--card); color: var(--ink); }
.sw-quick .sw-pal { display: flex; }
.sw-quick .sw-scrim { display: block !important; opacity: 1; pointer-events: auto; }
.vp-phone .sw-pal { left: 0; right: 0; bottom: 0; height: 78%; border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.8); animation: palup .3s cubic-bezier(.2,.8,.2,1); }
.vp-phone .sw-pal .sw-grab { display: block; }
@keyframes palup { from { transform: translateY(40%); opacity: 0; } }
.vp-desktop .sw-pal { left: 50%; top: 72px; width: min(600px, calc(100% - 340px)); max-height: min(540px, calc(100% - 120px)); transform: translateX(-50%); border-radius: 18px; border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); animation: palin .18s cubic-bezier(.2,.8,.2,1); }
.vp-desktop.side-pinned .sw-pal { left: calc(50% + 144px); }
@keyframes palin { from { opacity: 0; transform: translate(-50%, -6px) scale(.985); } }
.vp-desktop .sw-pal .sw-top { display: none; }
.vp-desktop .sw-pal .sw-search { margin: 10px 10px 4px; border: 0; background: transparent; height: 48px; }
.vp-desktop .sw-pal .sw-search input { font-size: 16px; }
.vp-desktop .sw-pal .sw-new { margin: 0; border-radius: 0 0 18px 18px; border-top: 1px solid var(--line); background: transparent; }
.sw-combo .sw-search kbd { margin-left: auto; }

/* ---- project picker ---- */
.pj { position: absolute; z-index: 48; display: none; flex-direction: column; min-height: 0; background: var(--card); color: var(--ink); }
.pj-open .pj { display: flex; }
.pj-open.vp-phone .sw-scrim { display: block !important; opacity: 1; pointer-events: auto; }
.vp-phone .pj { left: 0; right: 0; bottom: 0; height: 82%; border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.8); animation: palup .3s cubic-bezier(.2,.8,.2,1); }
.vp-phone .pj .sw-grab { display: block; }
.vp-desktop .pj { width: 400px; max-height: 440px; border-radius: 16px; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -16px rgba(0,0,0,.8); animation: popin .18s cubic-bezier(.2,.8,.2,1); }
.vp-desktop .pj .sw-grab { display: none; }
.pj-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 4px 18px; min-height: 48px; }
.pj-ttl { font: 600 15px var(--sans); }
.vp-phone .pj-ttl { font-size: 17px; }
.pj-note { margin: 0 18px 8px; font-size: 13px; line-height: 1.45; color: var(--dim); }
.pj-note b { color: var(--mid); font-weight: 600; }
.pj .sw-list { padding-bottom: 4px; }
.pj-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 16px; gap: 10px; align-items: center; width: 100%; min-height: 50px; padding: 6px 12px 6px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; }
.pj-row:hover { background: rgba(255,255,255,.035); }
.pj-row.on { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.pj-ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--bg); color: var(--dim); }
.pj-row.on .pj-ic { color: var(--clay); background: var(--clay-wash); }
.pj-text { display: flex; flex-direction: column; min-width: 0; }
.pj-name { font: 500 14.5px/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-path { font: 11.5px var(--mono); color: var(--dimmer); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-meta { font-size: 12px; color: var(--dimmer); white-space: nowrap; }
.pj-run { display: inline-flex; align-items: center; gap: 6px; color: var(--clay); }
.pj-check { color: var(--clay); display: grid; place-items: center; }
.pj-new { display: flex; align-items: center; gap: 10px; height: 48px; margin: 0; padding: 0 18px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--mid); font-size: 14px; text-align: left; }
.pj-new:hover { color: var(--ink); background: rgba(255,255,255,.03); }
.vp-desktop .pj-new { border-radius: 0 0 16px 16px; }
.vp-phone .pj-new, .vp-phone .pj-make { padding-bottom: 20px; height: auto; min-height: 56px; }
.pj-make { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--line); }
.pj-root { font: 12.5px var(--mono); color: var(--dim); white-space: nowrap; }
.pj-make input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); color: var(--ink); font: 13px var(--mono); padding: 0 10px; outline: 0; }
.pj-make input:focus { border-color: var(--clay); }
.pj-make button { height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--clay); color: var(--clay-ink); font-weight: 600; }
.pj-make button:disabled { opacity: .4; }

/* the chip says it opens something; the greeting's project name does the same */
.pj-open #project { background: var(--card); color: var(--ink); }
.pj-greet { display: inline-flex; align-items: center; gap: 2px; border: 0; padding: 2px 6px 2px 8px; margin: 0 1px; border-radius: 8px; background: var(--card); color: var(--ink); font: 600 inherit; font-size: inherit; box-shadow: inset 0 0 0 1px var(--line); vertical-align: baseline; }
.pj-greet:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.pj-greet svg { color: var(--dim); }

/* toasts carry session names here; let them wrap on a phone instead of running off the screen */
.vp-phone .toast { white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; line-height: 1.35; border-radius: 16px; padding: 9px 14px; }
