#toolbar {
  position: fixed; top: 0; left: 0; right: 0; height: 44px;
  background: #2d2d2d; display: flex; align-items: center; gap: 2px;
  padding: 0 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  z-index: 3100;
}
.tb-sep { width: 1px; height: 24px; background: #555; margin: 0 6px; }
#filename-label { color: #aaa; font-size: 12px; }
#filename-label.dirty::after { content: ' ●'; color: #e8875a; }

.menu-item { position: relative; display: inline-flex; align-items: center; height: 44px; }
.menu-item-label {
  padding: 0 12px; cursor: pointer; border-radius: 4px;
  color: #ddd; font-size: 13px; line-height: 28px; height: 28px;
  user-select: none; display: block;
}
.menu-item-label:hover,
.menu-item.open .menu-item-label { background: rgba(255,255,255,0.12); color: #fff; }
.menu-dropdown {
  position: absolute; top: 40px; left: 0; z-index: 2000;
  background: #2d2d2d; border: 1px solid #505050; border-radius: 6px;
  padding: 4px 0; min-width: 190px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  display: none;
}
.menu-item.open .menu-dropdown { display: block; }
.menu-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 7px 16px; background: none; border: none;
  color: #ddd; font-size: 13px; cursor: pointer; font-family: inherit;
}
.menu-dropdown button:hover { background: rgba(255,255,255,0.1); color: #fff; }
.menu-dropdown .menu-sep { height: 1px; background: #444; margin: 4px 8px; }

#menu-share { --share-accent: #fff176; margin-left: auto; }
.menu-share-btn {
  height: 28px; padding: 0 14px; border: 1px solid var(--share-accent); border-radius: 14px;
  background: transparent; color: var(--share-accent); font-family: inherit; font-size: 13px; line-height: 26px; cursor: pointer;
}
.menu-share-btn:hover, #menu-share.open .menu-share-btn { background: var(--share-accent); color: #222; }
#menu-share .menu-dropdown { left: auto; right: 0; width: max-content; border-color: var(--share-accent); }
.menu-share-row { display: flex; align-items: center; gap: 8px; padding: 2px 8px 2px 0; }
.menu-share-row a {
  flex: 1 0 auto; padding: 7px 16px; color: #ddd; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.menu-share-row a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.menu-dropdown .menu-share-copy {
  display: inline-block; width: auto; min-width: 46px; flex: none; padding: 4px 10px; text-align: center;
  border: 1px solid #555; border-radius: 999px; font-size: 12px;
}
.menu-dropdown .menu-share-copy:hover { border-color: #888; }
.menu-dropdown .menu-share-copy.copied { border-color: var(--share-accent); color: var(--share-accent); }

#tab-bar {
  position: fixed; top: 44px; left: 0; right: 0; height: 34px;
  background: #252525; display: flex; align-items: flex-end;
  z-index: 490; padding: 0 8px; gap: 2px; overflow-x: auto;
  scrollbar-width: none;
}
#tab-bar::-webkit-scrollbar { display: none; }
body.ng-single-doc #tab-bar { display: none; }
body.ng-single-doc { --top-h: 44px; }
.tab {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 8px 5px 12px; border-radius: 6px 6px 0 0;
  background: #3c3c3c; color: #999; font-size: 12px; cursor: pointer;
  max-width: 180px; border: 1px solid #555; border-bottom: none;
  transition: background 0.1s; min-width: 80px;
}
.tab:hover { background: #474747; }
.tab.active { background: #e5e5e5; color: #111; border-color: #aaa; }
.tab-dragging { opacity: 0.4; }
.tab-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-rename-wrap { flex: 1; min-width: 0; display: flex; align-items: baseline; overflow: hidden; }
.tab-rename-static { flex-shrink: 0; white-space: nowrap; }
.tab-rename-input {
  flex-shrink: 0; font: inherit; line-height: inherit; color: inherit;
  background: transparent; border: none; outline: none; padding: 0; margin: 0;
  text-decoration: underline;
}
.tab-close {
  width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; color: inherit; opacity: 0.5;
}
.tab-close:hover { background: rgba(128,128,128,0.3); opacity: 1; }
.tab-add {
  flex-shrink: 0; padding: 0 10px; color: #888; font-size: 18px;
  cursor: pointer; align-self: center; border-radius: 4px; line-height: 1;
  margin-left: 2px;
}
.tab-add:hover { background: rgba(255,255,255,0.1); color: #fff; }
