/* ============================================================================
   47-cmdline.css — the command line at the top of .main (2026-10-05).
   Owns the .cmdl- namespace. Behaviour: static/js/cmdline.js. Spec: the
   board's Option B (worktrees/codes-research/mockups/board.html).

   One row, var(--cmdl-h) tall, first child of .main (a flex column), so every
   view below simply starts lower. Not on the chart view (rules at the end). The one thing anchored to .main's top
   edge, the floating view cluster (05-chart-panels.css .top-cluster, top:0),
   moves down by the same height. Rules: one font family, two sizes (13 and
   11 px at the base root), grey labels, active = filled background, no
   stripes or underlines, inset rings instead of borders.
   ============================================================================ */
:root{ --cmdl-h:2.5rem; }

.cmdl{
  position:relative;z-index:60;          /* the list paints over .top-cluster (50) */
  flex:0 0 auto;height:var(--cmdl-h);
  display:flex;align-items:center;
  padding:0 0.75rem;
  background:var(--bg-primary);
  box-shadow:inset 0 -1px 0 var(--border-subtle);
}
/* Everything else pinned to .main's top edge (their containing block is
   .main: container-type gives it layout containment, so even the fixed docks
   resolve against it) moves down by the same height. Same selectors as their
   owners, appended later, so these win by order. */
.main > .top-cluster{ top:var(--cmdl-h); }
#chart-rail,
.trade-rail,
.trade-overlay,
.ksd-panel{ top:calc(var(--header-h) + var(--cmdl-h)); }

.cmdl-box{
  position:relative;display:flex;align-items:center;
  width:min(34rem, 100%);height:1.875rem;
}
.cmdl-ico{
  position:absolute;left:0.625rem;top:50%;transform:translateY(-50%);
  color:var(--text-secondary);pointer-events:none;
}
.cmdl-input{
  width:100%;height:100%;box-sizing:border-box;
  padding:0 2rem 0 2rem;
  border:0;border-radius:0.375rem;outline:none;
  background:transparent;
  box-shadow:inset 0 0 0 1px var(--border-subtle);
  color:var(--text-primary);
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));font-weight:500;
  letter-spacing:0.02em;
  transition:box-shadow .12s var(--ease-out), background .12s var(--ease-out);
}
.cmdl-input::placeholder{color:var(--text-muted);opacity:1;font-weight:400;letter-spacing:0;}
.cmdl-input:hover{box-shadow:inset 0 0 0 1px var(--border-default);}
.cmdl-input:focus{
  background:color-mix(in srgb, var(--text-primary) 6%, transparent);
  box-shadow:inset 0 0 0 1px var(--accent);
}
/* At rest: where you are ("NVDA ANR" then the function's name in grey),
   drawn over the empty input; hidden while typing. */
.cmdl-rest{
  position:absolute;left:2rem;right:2rem;top:50%;transform:translateY(-50%);
  display:flex;align-items:baseline;gap:0.625rem;min-width:0;
  overflow:hidden;white-space:nowrap;pointer-events:none;
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));
}
.cmdl-rest-k{flex:0 0 auto;color:var(--text-primary);font-weight:500;letter-spacing:0.02em;}
.cmdl-rest-n{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--text-muted);}
.cmdl-box.has-rest .cmdl-input::placeholder{color:transparent;}
:root.cmdl-on .cmdl-rest{display:none;}
:root.cmdl-on .cmdl-box.has-rest .cmdl-input::placeholder{color:var(--text-muted);}
.cmdl-kbd{
  position:absolute;right:0.4375rem;top:50%;transform:translateY(-50%);
  min-width:1.125rem;height:1.125rem;padding:0 0.25rem;box-sizing:border-box;
  display:flex;align-items:center;justify-content:center;
  border-radius:0.25rem;box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--text-muted);
  font-family:var(--font-sans);font-size:max(0.6875rem, var(--fs-floor));line-height:1;
  pointer-events:none;
}
:root.cmdl-on .cmdl-kbd{opacity:0;}

/* Results: Functions, then Securities. */
.cmdl-list{
  position:absolute;left:0;top:calc(100% + 0.25rem);
  width:100%;max-height:min(26rem, 70vh);overflow-y:auto;box-sizing:border-box;
  padding:0.375rem;
  background:var(--bg-elevated);
  border-radius:0.5rem;
  box-shadow:var(--shadow-menu), inset 0 0 0 1px var(--border-default);
}
.cmdl-list[hidden]{display:none;}
.cmdl-gh{
  padding:0.375rem 0.5rem 0.25rem;
  color:var(--text-muted);
  font-family:var(--font-sans);font-size:max(0.6875rem, var(--fs-floor));
}
.cmdl-row{
  display:flex;align-items:center;gap:0.625rem;
  height:2rem;padding:0 0.5rem;border-radius:0.375rem;
  color:var(--text-secondary);cursor:pointer;
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));
  white-space:nowrap;
}
.cmdl-row[aria-selected="true"]{
  background:color-mix(in srgb, var(--text-primary) 9%, transparent);
  color:var(--text-primary);
}
.cmdl-row mark{background:none;color:var(--text-primary);font-weight:600;}
.cmdl-code{
  flex:0 0 auto;min-width:2.75rem;height:1.25rem;padding:0 0.3125rem;box-sizing:border-box;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:0.25rem;box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--text-secondary);
  font-size:max(0.6875rem, var(--fs-floor));font-weight:500;letter-spacing:0.04em;
}
.cmdl-sym{
  flex:0 0 auto;min-width:2.75rem;
  color:var(--text-primary);font-weight:600;letter-spacing:0.02em;
}
.cmdl-nm{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;}
.cmdl-meta{
  flex:0 0 auto;color:var(--text-muted);
  font-size:max(0.6875rem, var(--fs-floor));
}
.cmdl-none{
  padding:0.5rem;color:var(--text-muted);
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));
}

/* Chart zen hides every frame around the chart; the command line too. */
body.chart-zen .cmdl{display:none;}
body.chart-zen #chart-rail,
body.chart-zen .trade-rail,
body.chart-zen .trade-overlay,
body.chart-zen .ksd-panel{ top:var(--header-h); }

/* The chart view has no command line (owner, 2026-10-05: "why there is a
   search bar on the top of the chart page"), so everything there sits where it
   did before the bar: the cluster at .main's top edge, the docks at the
   header. body.no-charts is app.js's (syncBodyViewClasses); .cmdl-chart is
   the server's mark for a chart URL until app.js reveals #charts. */
body:not(.no-charts) .cmdl,
.cmdl.cmdl-chart{display:none;}
body:not(.no-charts) .main > .top-cluster,
.main > .cmdl.cmdl-chart ~ .top-cluster{ top:0; }
body:not(.no-charts) #chart-rail,
body:not(.no-charts) .trade-rail,
body:not(.no-charts) .trade-overlay,
body:not(.no-charts) .ksd-panel{ top:var(--header-h); }

@media (max-width: 640px){
  .cmdl{padding:0 0.5rem;}
}

/* Removed from every page (owner, 2026-10-05: "remove that from everywhere").
   The bar is hidden and its height is zero, so every element anchored with
   var(--cmdl-h) sits where it did before the bar; "/" falls back to the
   sidebar search (cmdline.js and sidenav.js both check that it is shown). */
:root{ --cmdl-h:0px; }
.cmdl{ display:none !important; }

/* The suggestion list under the SIDEBAR search box (2026-10-05, cmdline.js
   bind()). It lives on <body>, fixed, so the sidebar's clip and scroll never
   cut it; cmdline.js sets left, top, width and max-height from the box. A
   function row is two lines: the name, then one grey line saying what it
   shows (sitemap.py desc). */
.cmdl-list.cmdl-pop{
  position:fixed;z-index:10000;
  left:0;top:0;width:32rem;max-width:calc(100vw - 1rem);
}
.cmdl-row.cmdl-row2{height:auto;min-height:2.5rem;padding:0.3125rem 0.5rem;}
.cmdl-tx{
  flex:1 1 auto;min-width:0;
  display:flex;flex-direction:column;justify-content:center;gap:0.0625rem;
}
.cmdl-tx .cmdl-nm{flex:0 0 auto;line-height:1.25;}
.cmdl-desc{
  min-width:0;overflow:hidden;text-overflow:ellipsis;
  color:var(--text-muted);
  font-size:max(0.6875rem, var(--fs-floor));line-height:1.25;
}
.cmdl-row[aria-selected="true"] .cmdl-desc{color:var(--text-secondary);}

/* Scrollbars (2026-11-08): the app's slim bar (03-sources.css), a padded thumb on a transparent track;
   Chrome draws its own bar with arrow buttons when scrollbar-width is set, so where the webkit styling
   exists it gets that instead (the watchlist well above). */
.cmdl-list{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;}
.cmdl-list::-webkit-scrollbar{width:8px;height:8px;}
.cmdl-list::-webkit-scrollbar-track{background:transparent;}
.cmdl-list::-webkit-scrollbar-thumb{background:var(--border-default);border-radius:99px;border:2px solid transparent;background-clip:padding-box;}
@supports selector(::-webkit-scrollbar){ .cmdl-list{scrollbar-width:auto;scrollbar-color:auto;} }
