/* ===== Keyboard shortcuts (Nick, 11/6/26; js/shortcuts.js) =====
   The keys as words, the tip on a button, the search boxes' "/", Cmd+K's
   Jump to, the ? list and Settings > Keyboard shortcuts. Tokens only, so
   dark mode needs no second rule except the tip, which inverts. */
:root{ --ks-spring:cubic-bezier(.22,1,.36,1); }

.ks-keys{ display:inline-flex; align-items:center; gap:7px; white-space:nowrap; font:600 12.5px/1 var(--font-sans); color:var(--text-head); font-variant-numeric:tabular-nums; letter-spacing:.01em; }
.ks-keys kbd{ font:inherit; color:inherit; }
.ks-keys .ks-then{ font-weight:400; color:var(--text-muted); font-size:12px; }
.ks-none{ font:400 12.5px var(--font-sans); color:var(--text-muted); }

/* The rail's Jump to row: the key sits at the row's end. */
.lh-jump{ font-family:inherit; text-align:left; margin:0 0 8px; flex:none; }
/* Every role has it: the role rules hide rail rows by page, and this is not a page. */
.lh-sidebar .lh-nav-item.lh-jump{ display:flex !important; }
.lh-jump .lh-jump-key[hidden]{ display:none; }
.lh-jump .lh-jump-key{ margin-left:auto; padding-left:12px; font-size:12px; color:var(--sidebar-muted); }
body.ks-nohints .lh-jump .lh-jump-key, body.ks-off .lh-jump .lh-jump-key{ display:none; }

/* Search boxes say "/" until you are in them (the image is the key, drawn by js/shortcuts.js). */
body:not(.ks-off):not(.ks-nohints) #crmRoot input.crm-search:placeholder-shown:not(:focus),
body:not(.ks-off):not(.ks-nohints) #salesScreen .crm-search input[data-act="search"]:placeholder-shown:not(:focus){
  background-image:var(--ks-slash, none); background-repeat:no-repeat; background-position:right 12px center; padding-right:34px; }

/* The selected row, walked with J and K. */
.ks-row-on, .ks-row-on > td{ background:var(--gold-faint) !important; }
.ks-row-on:focus{ outline:0; }
.ks-row-on:focus-visible > td:first-child{ box-shadow:inset 0 0 0 1px var(--gold); }

/* The tip: name, then keys. Waits a beat so passing over things stays quiet. */
.ks-tip{ position:fixed; z-index:500; left:0; top:0; pointer-events:none; display:flex; align-items:center; gap:12px; padding:7px 10px; border-radius:10px;
  background:#1f2533; color:#f4f2ec; font:400 12.5px/1.2 var(--font-sans); box-shadow:var(--my-pop-shadow);
  opacity:0; transform:translateY(3px); transition:opacity .12s ease, transform .18s var(--ks-spring); }
[data-theme="dark"] .ks-tip{ background:#f4f2ec; color:#1f2533; }
.ks-tip.on{ opacity:1; transform:none; }
.ks-tip .ks-keys{ color:var(--gold-soft); }
[data-theme="dark"] .ks-tip .ks-keys{ color:#7a6222; }

/* The one-line note shares Settings' toast; it sits over the page, not the rail. */
.set-toast.ks-say{ left:calc(var(--pane-left, 0px) + (100vw - var(--pane-left, 0px)) / 2); z-index:520; font-weight:500; }

/* ---- The ? list and Cmd+K: centred pop-ups ---- */
.ks-ref, .ks-k{ position:fixed; inset:0; z-index:510; display:flex; align-items:flex-start; justify-content:center; padding:6vh 16px 16px; background:rgba(13,18,32,.42); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.ks-k{ padding-top:14vh; }
.ks-ref[hidden], .ks-k[hidden]{ display:none; }
.ks-ref:not([hidden]), .ks-k:not([hidden]){ animation:ks-fade .16s ease; }
@keyframes ks-fade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes ks-in{ from{ opacity:0; transform:translateY(-6px) scale(.97); } to{ opacity:1; transform:none; } }
.ks-card, .ks-k-card{ display:flex; flex-direction:column; overflow:hidden; background:var(--surface); border-radius:var(--my-r-xl);
  box-shadow:var(--my-pop-shadow); font-family:var(--font-sans); transform-origin:50% 0; animation:ks-in .32s var(--ks-spring); }
.ks-card{ width:min(840px,100%); max-height:86vh; }
.ks-k-card{ width:min(600px,100%); max-height:70vh; }

.ks-card-h{ display:flex; align-items:center; gap:16px; padding:20px 24px 12px; }
.ks-card-h h2{ margin:0; font:600 19px var(--font-serif); color:var(--text-head); letter-spacing:-.01em; }
.ks-find{ margin-left:auto; width:220px; height:36px; padding:0 12px; box-sizing:border-box; border:0; border-radius:10px; background:var(--canvas); box-shadow:inset 0 0 0 1px var(--hairline); font:400 14px var(--font-sans); color:var(--text-head); }
.ks-find:focus{ outline:0; box-shadow:inset 0 0 0 1.5px var(--gold); }
.ks-x{ width:36px; height:36px; border:0; border-radius:10px; background:none; color:var(--text-muted); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.ks-x:hover{ background:var(--gold-faint); color:var(--text-head); }
.ks-x svg{ width:18px; height:18px; }
.ks-cols{ overflow-y:auto; padding:4px 24px 20px; columns:2 320px; column-gap:40px; }
.ks-grp{ break-inside:avoid; padding-top:14px; }
.ks-grp h3{ margin:0 0 4px; font:600 13.5px var(--font-sans); color:var(--text-head); }
.ks-grp h3 small{ font-weight:400; color:var(--text-muted); font-size:12.5px; margin-left:6px; }
.ks-line{ display:flex; align-items:baseline; gap:16px; padding:6px 0; font-size:14px; color:var(--text-body); }
.ks-line .ks-keys{ margin-left:auto; }
.ks-empty{ padding:24px 0; color:var(--text-muted); font-size:14px; column-span:all; }
.ks-card-f{ display:flex; align-items:center; gap:16px; padding:12px 24px 16px; color:var(--text-muted); font-size:12.5px; }
.ks-card-f button{ border:0; background:none; padding:0; font:500 12.5px var(--font-sans); color:var(--gold-ink); cursor:pointer; }
.ks-card-f button:hover{ text-decoration:underline; }
.ks-card-f .ks-f-end{ margin-left:auto; }

.ks-k-in{ display:flex; align-items:center; gap:12px; padding:0 18px; }
.ks-k-in svg{ width:19px; height:19px; color:var(--text-muted); flex:none; }
.ks-k-in input, .ks-k-in input:focus, .ks-k-in input:focus-visible{ outline:0 !important; box-shadow:none !important; }
.ks-k-in input{ flex:1; min-width:0; height:58px; border:0; background:transparent; font:400 17px var(--font-sans); color:var(--text-head); }
.ks-k-in input::placeholder{ color:var(--text-muted); }
.ks-k-list{ overflow-y:auto; padding:4px 8px 10px; }
.ks-k-group{ padding:12px 12px 6px; font-size:13px; color:var(--text-muted); }
.ks-k-row{ display:flex; align-items:center; gap:12px; min-height:44px; padding:0 12px; border-radius:10px; cursor:pointer; color:var(--text-body); font-size:14.5px; }
.ks-k-row .ks-k-t{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ks-k-row small{ margin-left:auto; padding-left:12px; color:var(--text-muted); font-size:13px; white-space:nowrap; }
.ks-k-row .ks-keys{ margin-left:auto; padding-left:12px; color:var(--text-muted); font-weight:500; }
.ks-k-row[aria-selected="true"]{ background:var(--gold-faint); color:var(--text-head); }
.ks-k-empty{ padding:18px 12px; color:var(--text-muted); font-size:14px; }
.ks-k-foot{ padding:8px 18px 14px; color:var(--text-muted); font-size:12.5px; }

/* The avatar menu's entry. */
.lh-user-menu .ks-mi .ks-keys{ margin-left:auto; color:var(--sidebar-muted); font-weight:500; }

/* ---- Settings > Keyboard shortcuts ---- */
.ks-set > .sx-part, .ks-list > .sx-part{ margin-top:32px; }
.ks-set > .sx-part:first-child{ margin-top:8px; }
.ks-set .sx-h3{ margin-bottom:4px; }
.ks-set .sx-p{ margin:0 0 12px; }
.ks-set table.sx-table td{ padding:9px 16px; vertical-align:middle; }
.ks-set .ks-c-act{ width:100%; }
.ks-set .ks-c-key{ white-space:nowrap; }
.ks-set .ks-c-rst{ white-space:nowrap; text-align:right; width:72px; }
.ks-bind{ min-width:116px; height:34px; padding:0 12px; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:flex-start; gap:8px;
  border:1px solid var(--border-btn); border-radius:10px; background:transparent; cursor:pointer; font:inherit; transition:border-color .15s, background .15s; }
.ks-bind:hover{ border-color:var(--text-muted); }
.ks-bind:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.ks-bind.ks-rec{ border-color:var(--gold); background:var(--gold-faint); }
.ks-bind.ks-rec .ks-keys{ font-weight:500; color:var(--gold-ink); }
.ks-bind[disabled]{ cursor:default; opacity:.55; }
.ks-fixed{ font-size:12.5px; color:var(--text-muted); }
.ks-rst{ border:0; background:none; padding:6px 0; font:500 12.5px var(--font-sans); color:var(--gold-ink); cursor:pointer; }
.ks-rst:hover{ text-decoration:underline; }
.ks-changed td.ks-c-act::after{ content:"Changed"; margin-left:10px; font-size:12px; color:var(--text-muted); }
.ks-clash td{ padding-top:0 !important; }
.ks-clash-in{ display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; padding:2px 0 10px; font-size:13px; color:var(--text-body); }
.ks-clash-in b{ font-weight:600; color:var(--text-head); }
.ks-clash-in button{ border:0; background:none; padding:4px 0; font:500 13px var(--font-sans); color:var(--gold-ink); cursor:pointer; }
.ks-clash-in button:hover{ text-decoration:underline; }
.ks-clash-in .ks-warn{ color:var(--red-ink); }
.ks-set.ks-is-off .ks-list{ opacity:.5; }
.ks-actions{ display:flex; align-items:center; gap:16px; margin-top:20px; }
.ks-saved{ font-size:12.5px; color:var(--text-muted); opacity:0; transition:opacity .2s; }
.ks-saved.on{ opacity:1; }

@media (max-width:640px){
  .ks-cols{ columns:1; padding:4px 18px 18px; }
  .ks-find{ width:140px; }
  .ks-set .ks-c-rst{ width:auto; }
  .ks-bind{ min-width:92px; }
  .ks-card-f .ks-f-end{ display:none; }
  .ks-k-foot{ display:none; }
}
@media (hover:none){ .ks-tip{ display:none; } }
@media (prefers-reduced-motion:reduce){
  .ks-tip{ transition:opacity .12s ease; transform:none !important; }
  .ks-card, .ks-k-card, .ks-ref, .ks-k{ animation:none !important; }
}
