/* The top bar every Clipmark staff page shares (admin, curation, annotation).
 *   left:  brand · the three apps (Home = admin, Curation, Annotation) · this page's tabs
 *   right: chat (admin) · who is signed in (with the account menu on the admin page)
 * Uses each page's colour tokens (--surface, --line, --accent…), so it follows light/dark. */
.cm-bar{display:flex; align-items:center; gap:14px; min-height:56px; padding:0 18px; border-bottom:1px solid var(--line);
  background:var(--surface); flex:0 0 auto; position:relative; z-index:20}
.cm-bar::-webkit-scrollbar{display:none}
.cm-bar > *{flex:0 0 auto}
.cm-brand{display:flex; align-items:center; gap:9px; font-weight:700; font-size:16.5px; letter-spacing:-.015em; color:var(--ink); text-decoration:none; white-space:nowrap}
.cm-brand i{display:inline-flex; gap:3px; align-items:center}
.cm-brand i b{width:4px; height:17px; background:var(--accent); border-radius:1.5px}
.cm-brand i b:nth-child(2){height:11px; opacity:.55}
/* the three apps: a segmented switch, each with its own colour dot */
.cm-apps{display:inline-flex; gap:2px; padding:3px; border-radius:10px; background:var(--surface-2); border:1px solid var(--line)}
.cm-apps a{display:inline-flex; align-items:center; gap:7px; padding:5px 12px; border-radius:7px; font-size:12.5px; font-weight:600;
  color:var(--muted); text-decoration:none; white-space:nowrap; transition:background .15s, color .15s}
.cm-apps a::before{content:""; width:7px; height:7px; border-radius:50%; background:var(--dot); opacity:.55}
.cm-apps a:hover{color:var(--ink)}
.cm-apps a[aria-current="page"]{background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.14), 0 0 0 1px var(--line)}
.cm-apps a[aria-current="page"]::before{opacity:1}
.cm-apps .home{--dot:var(--accent)}
.cm-apps .cur{--dot:#12B886}
.cm-apps .ann{--dot:#4DABF7}
.cm-sep{width:1px; height:24px; background:var(--line)}
/* this page's own tabs: plain text, the active one underlined in the accent colour */
.cm-tabs{display:flex; align-items:stretch; gap:2px; align-self:stretch}
.cm-tabs > button{position:relative; border:0; background:none; padding:0 11px; font-size:13px; font-weight:500; color:var(--muted); cursor:pointer; white-space:nowrap}
.cm-tabs > button:hover{color:var(--ink)}
.cm-tabs > button.active, .cm-tabs > button[aria-selected="true"]{color:var(--ink); font-weight:600}
.cm-tabs > button.active::after, .cm-tabs > button[aria-selected="true"]::after{content:""; position:absolute; left:9px; right:9px; bottom:-1px; height:2px; border-radius:2px; background:var(--accent)}
/* right side */
.cm-right{margin-left:auto; display:flex; align-items:center; gap:8px; padding-left:8px}
.cm-icon{position:relative; display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 12px; border:1px solid var(--line); border-radius:8px;
  background:var(--surface); color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap}
.cm-icon svg{width:16px; height:16px}
.cm-icon:hover, .cm-icon.active{color:var(--ink); border-color:var(--faint)}
.cm-icon.active{background:var(--surface-2)}
.cm-who{display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); white-space:nowrap}
.cm-avatar{display:inline-grid; place-items:center; width:28px; height:28px; border-radius:50%; background:var(--accent-soft); color:var(--accent-strong, var(--accent));
  font-size:12px; font-weight:700; text-transform:uppercase}
/* account menu (admin page) */
.cm-acct{position:relative}
.cm-acct > summary{list-style:none; display:inline-flex; align-items:center; gap:8px; height:34px; padding:0 8px 0 4px; border-radius:8px; cursor:pointer;
  font-size:13px; color:var(--ink); white-space:nowrap}
.cm-acct > summary::-webkit-details-marker{display:none}
.cm-acct > summary::after{content:""; width:6px; height:6px; margin:0 2px 3px 2px; border:solid var(--muted); border-width:0 1.6px 1.6px 0; transform:rotate(45deg)}
.cm-acct > summary:hover{background:var(--surface-2)}
.cm-acct .role{color:var(--muted); font-size:12px}
.cm-pop{position:absolute; right:0; top:calc(100% + 6px); min-width:210px; padding:6px; border:1px solid var(--line); border-radius:10px; background:var(--surface);
  box-shadow:0 12px 32px rgba(0,0,0,.22); z-index:50; display:flex; flex-direction:column}
.cm-pop button{display:flex; align-items:center; gap:9px; width:100%; border:0; background:none; text-align:left; padding:8px 10px; border-radius:6px;
  font-size:13px; color:var(--ink); cursor:pointer}
.cm-pop button:hover{background:var(--surface-2)}
.cm-pop button.danger{color:var(--err, #C92A2A)}
.cm-pop hr{border:0; border-top:1px solid var(--line); margin:4px 2px}
.cm-badge{min-width:17px; height:17px; padding:0 5px; border-radius:9px; background:var(--accent); color:var(--accent-ink, #fff); font:700 10.5px/17px var(--sans, system-ui)}
@media (max-width:760px){ .cm-bar{gap:10px; padding:0 12px; overflow-x:auto; scrollbar-width:none} .cm-pop{position:fixed; top:58px; right:12px} .cm-brand span{display:none} .cm-who .name{display:none} }
