/* ═══ THE COMMAND PALETTE ═════════════════════════════════════════════════════
   Item 6 of his shell list. The search in the top bar stops being a box with a
   dropdown under it and becomes a screen of its own: one field, his own things
   in tabs across the top, and a list you can walk with the arrow keys.

   ⚠ HIS THINGS, NOT A PRODUCT'S. The tabs are customers, machines, jobs,
   projects, files and people — not Drive and Gmail. The note on his list says
   exactly this and it is the whole point of the screen.
   ⚠ NEAR THE TOP, NOT THE MIDDLE. A palette centred vertically moves the list
   under your eyes as it grows and shrinks; pinned near the top, the first row is
   always in the same place, which is where you are already looking.

   ── 21 Sep 2026: the Spotlight pass ──────────────────────────────────────────
   His ask, with macOS Spotlight as the reference: the app behind it is BLURRED
   rather than greyed, the panel is slightly see-through, the corners are rounder
   and the shadow deeper, every row carries a second line saying what the thing
   is, the row you are on has an arrow, and it grows into place instead of
   appearing. The bones of the screen did not change — this is its surface.

   ⚠ NOTHING WAS INSTALLED. The reference ships React, Tailwind and a motion
   library; none of those are in this app. Every rule here is hand-written.
   ⚠ `color-mix` RATHER THAN A NEW COLOUR VARIABLE. The translucency needs the
   surface colour with an alpha, and there is no --surface-rgb. Adding one means
   editing app.css, which another chat also edits; color-mix keeps the whole
   change inside this file. Every one is preceded by a solid fallback, so a
   browser that cannot do it gets the old opaque panel and nothing looks broken.
   ═════════════════════════════════════════════════════════════════════════════ */
/* ⚠⚠ NOT display:none — AND THAT IS THE WHOLE REASON THE ANIMATION WORKS.
   An element that is not drawn has no start state to move from, so adding the
   class that reveals it and the class that positions it in the same breath means
   the browser only ever sees the finished panel: it snaps. Hidden by visibility
   instead, the panel is laid out the whole time, its small-and-faded start state
   is already committed, and revealing it lets the transition run.
   ⚠ pointer-events:none IS NOT OPTIONAL. This is a fixed sheet over the entire
   screen; without it, a palette nobody can see swallows every click in the app. */
#cmdk{position:fixed;inset:0;z-index:900;visibility:hidden;pointer-events:none}
#cmdk.on,#cmdk.out{visibility:visible}
#cmdk.on{pointer-events:auto}

/* ── the app behind it ────────────────────────────────────────────────────────
   ⚠ BLURRED, NOT GREYED. A flat wash over the whole app is what made this read as
   a box sitting on top of a screenshot. The blur is what puts it in front of
   something. The dim is much lighter than it was, because the blur is doing the
   work of separating them now. */
#cmdk .cp-back{position:absolute;inset:0;background:rgba(var(--veil-rgb),.18);
  -webkit-backdrop-filter:blur(16px) saturate(1.1);backdrop-filter:blur(16px) saturate(1.1);
  opacity:0;transition:opacity .22s ease}
#cmdk.on .cp-back{opacity:1}
#cmdk.out .cp-back{opacity:0;transition:opacity .16s ease}

/* ── the panel ───────────────────────────────────────────────────────────────
   ⚠ THE TRANSFORM IS ONE PROPERTY AND CARRIES THREE THINGS: the centring, the
   lift and the scale. Writing any of them separately loses the other two — the
   old rule kept re-stating translateX(-50%) in every keyframe for exactly this
   reason, and forgetting it once drops the panel to the left edge. */
#cmdk .cp{position:absolute;left:50%;top:11vh;
  width:min(680px,94vw);max-height:74vh;display:flex;flex-direction:column;
  background:var(--surface);
  background:color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter:blur(30px) saturate(1.7);backdrop-filter:blur(30px) saturate(1.7);
  border:1px solid var(--rule);
  border-color:color-mix(in srgb, var(--rule) 70%, transparent);
  border-radius:16px;
  box-shadow:0 32px 80px -20px rgba(var(--shade-rgb),.42),
             0 4px 16px -6px rgba(var(--shade-rgb),.18),
             inset 0 1px 0 rgba(var(--lift-rgb),.10);
  overflow:hidden;
  transform:translate(-50%,-10px) scale(.94);opacity:0;
  transition:transform .34s cubic-bezier(.32,.72,0,1),opacity .2s ease}
#cmdk.on .cp{transform:translate(-50%,0) scale(1);opacity:1}
/* ⚠ SHUTTING IS FASTER THAN OPENING, and drops rather than lifts. A close that
   takes as long as an open feels like the app is holding on to you. */
#cmdk.out .cp{transform:translate(-50%,4px) scale(.97);opacity:0;
  transition:transform .16s ease-in,opacity .14s ease-in}

/* ── the field ── */
.cp-field{display:flex;align-items:center;gap:12px;padding:17px 19px;flex-shrink:0}
.cp-field svg{width:19px;height:19px;flex-shrink:0;fill:none;stroke:var(--ink-faint);
  stroke-width:2;stroke-linecap:round}
.cp-field input{flex:1;min-width:0;border:0;background:none;outline:none;
  font-family:'Inter',sans-serif;font-size:19px;letter-spacing:-.01em;color:var(--ink)}
.cp-field input::placeholder{color:var(--ink-faint)}
.cp-esc{flex-shrink:0;font-family:'Inter',sans-serif;font-size:12px;color:var(--ink-faint);
  border:1px solid var(--rule);border-radius:5px;padding:2px 7px}

/* ── the tabs: his own things ── */
.cp-tabs{display:flex;align-items:center;gap:2px;padding:0 13px 10px;flex-shrink:0;
  overflow-x:auto;scrollbar-width:none}
.cp-tabs::-webkit-scrollbar{display:none}
.cp-tabs button{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;
  background:none;border:0;border-radius:999px;padding:5px 11px;
  font-family:'Inter',sans-serif;font-size:13px;font-weight:500;color:var(--ink-soft);cursor:pointer;
  transition:background .12s var(--ease-out),color .12s var(--ease-out)}
.cp-tabs button:hover{background:var(--field);color:var(--ink)}
.cp-tabs button.on{background:var(--accent-soft);color:var(--ink);font-weight:600}
.cp-tabs .n{font-family:var(--num);font-variant-numeric:tabular-nums;font-size:12px;
  color:var(--ink-faint);font-weight:400}
.cp-tabs button.on .n{color:var(--ink-soft)}

/* ── the list ── */
.cp-list{flex:1;min-height:0;overflow-y:auto;padding:7px 8px 9px;
  border-top:1px solid var(--rule);
  border-top-color:color-mix(in srgb, var(--rule) 60%, transparent)}
.cp-grp{font-family:'Inter',sans-serif;font-size:12px;font-weight:600;letter-spacing:.02em;
  color:var(--ink-faint);padding:10px 11px 5px}

/* ⚠ A ROW IS TWO LINES NOW. The name on top and, under it, what the thing IS —
   which is the one question the old single line never answered: a row could be a
   customer, a machine or a file and looked the same either way. */
.cp-hit{display:flex;align-items:center;gap:13px;width:100%;text-align:left;
  background:none;border:0;border-radius:10px;padding:9px 11px;cursor:pointer;
  font-family:'Inter',sans-serif;font-size:14px;color:var(--ink);
  transition:background .12s var(--ease-out)}
/* ⚠ THE ARROW KEYS AND THE MOUSE LIGHT THE SAME ROW. Two different "this one" —
   one following the keyboard, one following the pointer — is how a palette ends up
   opening something other than what you were looking at. */
.cp-hit.on,.cp-hit:hover{background:var(--field);
  background:color-mix(in srgb, var(--ink) 7%, transparent)}
.cp-hit .cp-ic{width:30px;height:30px;flex-shrink:0;display:flex;align-items:center;
  justify-content:center;border-radius:7px;color:var(--ink-soft);
  background:color-mix(in srgb, var(--ink) 6%, transparent)}
.cp-hit .cp-ic svg{width:17px;height:17px;fill:none;stroke:currentColor;
  stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.cp-hit.on .cp-ic{color:var(--ink)}
.cp-main{flex:1;min-width:0}
.cp-hit .cp-t{display:block;font-weight:500;letter-spacing:-.005em;line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cp-hit .cp-sub{display:block;font-size:12px;color:var(--ink-faint);margin-top:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cp-hit .cp-when{font-family:var(--num);font-variant-numeric:tabular-nums;
  font-size:12px;color:var(--ink-faint);flex-shrink:0}
/* the arrow, on the row you are on and nowhere else */
.cp-hit .cp-go{flex-shrink:0;width:16px;height:16px;opacity:0;
  transform:translateX(-3px);transition:opacity .14s ease,transform .18s var(--ease-out)}
.cp-hit .cp-go svg{width:16px;height:16px;fill:none;stroke:var(--ink-faint);
  stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cp-hit.on .cp-go{opacity:1;transform:translateX(0)}
.cp-empty{padding:38px 12px;text-align:center;font-family:'Inter',sans-serif;
  font-size:13px;color:var(--ink-faint)}

/* ── the foot: what the keys do ── */
.cp-foot{display:flex;align-items:center;gap:16px;flex-shrink:0;
  padding:9px 15px;border-top:1px solid var(--rule);
  border-top-color:color-mix(in srgb, var(--rule) 60%, transparent);
  background:color-mix(in srgb, var(--paper) 55%, transparent)}
.cp-foot span{font-family:'Inter',sans-serif;font-size:12px;color:var(--ink-faint)}
.cp-foot b{font-weight:500;color:var(--ink-soft);border:1px solid var(--rule);
  border-radius:4px;padding:1px 5px;background:var(--surface);margin-right:5px}

@media (max-width:760px){
  /* ⚠ A PHONE GETS THE WHOLE SCREEN, so there is nothing behind it to blur and
     nothing for a corner radius to round. It slides up from the bottom instead —
     the same gesture language as every other sheet in this app. */
  #cmdk .cp{top:0;left:0;width:100%;max-height:100%;height:100%;
    border:0;border-radius:0;box-shadow:none;
    background:var(--surface);
    -webkit-backdrop-filter:none;backdrop-filter:none;
    transform:translateY(14px);opacity:0;
    transition:transform .3s cubic-bezier(.32,.72,0,1),opacity .18s ease}
  #cmdk.on .cp{transform:translateY(0);opacity:1}
  #cmdk.out .cp{transform:translateY(10px);opacity:0;transition:transform .16s ease-in,opacity .14s ease-in}
  #cmdk .cp-back{-webkit-backdrop-filter:none;backdrop-filter:none}
  .cp-esc{display:none}
  /* ⚠ a phone has no keys to tell him about */
  .cp-foot{display:none}
}
@media (prefers-reduced-motion:reduce){
  #cmdk .cp,#cmdk.on .cp,#cmdk.out .cp,#cmdk .cp-back,#cmdk.on .cp-back,#cmdk.out .cp-back{
    transition:none}
  .cp-hit .cp-go{transition:none}
}
