/* Switch pill hover panel - Staff Portal top bar (2026-11-07, js/switch-panel.js).
   The "My tasks" card look (css/tasks-gadget.css): Css/themes.css tokens, 288 px card, the same shadow, so it follows the
   operator's theme. Opened = position: fixed under the Switch pill; closed = [hidden], so it never takes a click. */
.swp {
  --swp-shadow: 0 12px 32px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .05);
  position: fixed; z-index: 2; width: 288px; max-width: calc(100vw - 16px);
  background: var(--surface, #fff); color: var(--text, #0f172a);
  border: 1px solid var(--line, #e5e7eb); border-radius: 14px; box-shadow: var(--swp-shadow);
  font: 13px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: left;
  display: flex; flex-direction: column; animation: swp-in .14s ease-out;
}
.swp[hidden] { display: none; }
.swp * { box-sizing: border-box; }
/* keeps the pointer "inside" while it crosses the small gap between the pill and the card */
.swp::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }

.swp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; }
.swp-mark { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none;
            background: color-mix(in srgb, var(--sx-gold, #E5A100) 16%, var(--surface, #fff)); color: var(--sx-gold-dark, #8a6200); font-size: 12px; }
.swp-head h2 { margin: 0; font-size: 13.5px; line-height: 1.2; font-weight: 700; color: var(--text, #0f172a); }
.swp-head small { display: block; color: var(--muted, #64748b); font-size: 10.5px; line-height: 1.3; }

.swp-list { padding: 0 6px 6px; overflow-y: auto; min-height: 0; }
.swp-co { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
          padding: 7px 8px; border-radius: 10px; color: inherit; text-decoration: none !important; min-height: 48px; }
a.swp-co:hover, a.swp-co:focus-visible { background: var(--bg, #f3f4f6); color: inherit; }
a.swp-co:focus-visible { outline: 2px solid var(--brand, #4B6F0A); outline-offset: -2px; }
.swp-co.is-cur { background: color-mix(in srgb, var(--brand, #4B6F0A) 7%, var(--surface, #fff));
                 box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand, #4B6F0A) 22%, var(--surface, #fff)); }
.swp-logo { width: 44px; height: 32px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; flex: none;
            background: #fff; border: 1px solid var(--line, #e5e7eb); }
.swp-logo img { max-width: 40px; max-height: 28px; width: auto; height: auto; object-fit: contain; display: block; }
.swp-logo.is-ini { background: color-mix(in srgb, var(--brand, #4B6F0A) 12%, var(--surface, #fff)); border-color: transparent;
                   color: var(--brand, #4B6F0A); font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
.swp-txt { min-width: 0; }
.swp-txt b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swp-txt small { display: block; font-size: 10.5px; color: var(--muted, #64748b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swp-now { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--brand, #4B6F0A); white-space: nowrap; }
.swp-go { color: var(--muted, #64748b); font-size: 12px; }
a.swp-co:hover .swp-go { color: var(--brand, #4B6F0A); }
.swp-co.is-busy { pointer-events: none; opacity: .75; }
.swp-co.is-busy .swp-go { display: inline-block; color: var(--brand, #4B6F0A); animation: swp-spin .8s linear infinite; }   /* JS swaps in bi-arrow-repeat */

.swp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px 7px 12px;
            border-top: 1px solid var(--line, #e5e7eb); background: var(--bg, #f3f4f6); border-radius: 0 0 14px 14px; }
.swp-qs { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 4px 6px; margin-left: -6px; border-radius: 7px;
          font: 600 12px Inter, system-ui, sans-serif; color: var(--brand, #4B6F0A); cursor: pointer; }
.swp-qs:hover { text-decoration: underline; }
.swp-qs:focus-visible { outline: 2px solid var(--brand, #4B6F0A); outline-offset: 1px; }
.swp-foot kbd { font: 700 10px ui-monospace, Menlo, Consolas, monospace; color: var(--muted, #64748b); background: var(--surface, #fff);
                border: 1px solid var(--line, #e5e7eb); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; }

/* While the card is open the header is lifted above the "My tasks" card (z 1050) so the two never overlap wrongly,
   and the pill's own "Ctrl+S" hover hint (which sits where the card is) is hidden. */
html.swp-open .sx-header { z-index: 1066; }
html.swp-open .sx-pill-co::after { display: none !important; }
.sx-pill-co[aria-expanded="true"] { background: var(--sx-gold, #E5A100); color: #fff !important; border-color: var(--sx-gold, #E5A100); }
.sx-pill-co:focus-visible { outline: 2px solid var(--sx-gold-dark, #8a6200); outline-offset: 2px; }

@keyframes swp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes swp-spin { to { transform: rotate(360deg); } }

@media (hover: none) {
  .swp-co { min-height: 52px; }      /* touch: a full finger per company */
  .swp-foot kbd { display: none; }   /* no keyboard */
}
@media (prefers-reduced-motion: reduce) { .swp, .swp-co.is-busy .swp-go { animation: none !important; } }
@media print { .swp { display: none !important; } }
html.sx-embed .swp { display: none !important; }
