/* The top bar (design study D2): search pill, New request, the bell; the search palette and the notifications drawer.
   Existing tokens only. */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 40px;
  background: rgba(10,20,38,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar.hidden { display: none; }
.tb-search { flex: 1; max-width: 520px; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; border-radius: var(--pill);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--faint); font: inherit; font-size: 14px; font-weight: 500; cursor: text; text-align: left; }
.tb-search:hover, .tb-search:focus-visible { border-color: var(--line-strong); color: var(--muted); }
.tb-search .ic { width: 17px; height: 17px; flex: none; }
.tb-ph { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-search kbd, .tb-pal-in kbd { font: 600 11.5px var(--sans); padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--faint); background: rgba(255,255,255,.03); flex: none; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-new .ic { width: 15px; height: 15px; }
.tb-bell { position: relative; }
.tb-dot { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--pill); background: var(--critical); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums; }
/* the palette */
.tb-pal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(2,8,20,.55); display: none; }
.tb-pal-wrap.open { display: block; }
.tb-pal { position: absolute; left: 50%; top: 12vh; transform: translateX(-50%); width: min(720px, 92vw); max-height: 70vh; display: flex; flex-direction: column;
  border-radius: var(--radius); background: var(--glass-3, rgba(12,22,42,.94)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong); box-shadow: var(--lift); overflow: hidden; }
.tb-pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tb-pal-in .ic { width: 19px; height: 19px; color: var(--faint); flex: none; }
.tb-pal-in input { flex: 1; border: 0; background: transparent; box-shadow: none; font-size: 17px; font-weight: 600; padding: 4px 0; outline: none; }
.tb-res { overflow-y: auto; padding: 6px 8px 8px; }
.tb-group { font-size: 12px; font-weight: 700; color: var(--faint); padding: 12px 10px 6px; }
.tb-row, .tb-note { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
  background: transparent; border: 0; color: inherit; font: inherit; }
.tb-row.on, .tb-row:hover, .tb-note:hover { background: rgba(255,255,255,.05); }
.tb-row .h-ic, .tb-note .h-ic { width: 30px; height: 30px; flex: none; }
.tb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-txt b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-txt small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-empty { padding: 18px 12px; }
.tb-foot { font-size: 12px; padding: 8px 18px 12px; border-top: 1px solid var(--line); }
.tb-h3 { font-size: 14px; margin: 6px 0 6px; }
.tb-list { margin: 0 0 14px 18px; padding: 0; line-height: 1.5; }
/* the notifications drawer */
.tb-notes-wrap { position: fixed; inset: 0; z-index: 85; background: rgba(2,8,20,.4); display: none; }
.tb-notes-wrap.open { display: block; }
.tb-notes { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); display: flex; flex-direction: column; padding: 18px 16px;
  background: var(--glass-3, rgba(12,22,42,.96)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-left: 1px solid var(--line-strong); overflow-y: auto; }
.tb-notes-head { justify-content: space-between; margin-bottom: 10px; }
.tb-notes-head h2 { margin: 0; font-size: 21px; }
.tb-notes-tools { justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tb-note time { font-size: 12px; white-space: nowrap; flex: none; }
.tb-note.unread b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: 2px; }
.tb-note.tone-bad .h-ic { color: var(--critical); }
.tb-note.tone-warn .h-ic { color: var(--high); }
.tb-note.tone-ok .h-ic { color: var(--ok); }
@media (max-width: 900px) {
  .topbar { position: static; padding: 0 16px; height: 52px; }
  .tb-search kbd, .tb-new span { display: none; }
}
