/* ───────────────────────────────────────────────────────────
   Activity bar — vertical icon strip pinned to the left edge.
   Element id is #toolbar (kept for backwards compat with
   mobileToolbar.js / cinema.css). Functionally it is the
   "activity bar" in the VSCode sense.
   ─────────────────────────────────────────────────────────── */

#toolbar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--ab-w);
  height: 100vh;
  z-index: 40;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 10px;

  background: var(--surface-0);
  border-right: 1px solid var(--border);

  /* Cinema mode hides this via opacity, NOT display, so transitions stay smooth. */
  transition: opacity var(--motion-slow);
}

/* ── Brand mark — top corner ─────────────────────────── */
.ab-brand {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  pointer-events: none;
}
.ab-brand-mark {
  font: 700 11px/1 var(--font);
  letter-spacing: 0.16em;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 5px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent-edge);
}

/* Spacer to push remaining items to the bottom on desktop */
.ab-spacer {
  flex: 1;
}

/* ── Buttons (all activity-bar items use .tbtn) ──────── */
.tbtn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    color var(--motion-fast),
    background var(--motion-fast);
}
.tbtn .ti {
  font-size: 17px;
  line-height: 1;
}
.tbtn .ic {
  width: 17px;
  height: 17px;
}
.tbtn:hover {
  color: var(--bright);
  background: var(--surface-hover);
}
.tbtn.on {
  color: var(--accent-text);
  background: var(--accent-soft);
}
.tbtn.on::before {
  /* VSCode-style activity rail indicator */
  content: '';
  position: absolute;
  left: -1px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.tbtn.disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
}

/* Subtle divider between item groups */
.tbtn-sep {
  width: 24px;
  height: 1px;
  background: var(--divider);
  margin: 4px auto;
  flex-shrink: 0;
}

/* ── View-level segmented control (1 / 2 / 3) ─────────── */
.tseg {
  display: flex;
  flex-direction: column;
  width: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-1);
}
.tseg-btn {
  flex: 1;
  padding: 5px 0;
  font: 600 10px/1 var(--mono);
  color: var(--muted);
  letter-spacing: 0.04em;
  transition:
    color var(--motion-fast),
    background var(--motion-fast);
}
.tseg-btn:hover {
  color: var(--bright);
  background: var(--surface-hover);
}
.tseg-btn.on {
  color: var(--accent-text);
  background: var(--accent-soft);
}
.tseg-btn + .tseg-btn {
  border-top: 1px solid var(--border);
}

/* ─────────────────────────────────────────────────────────
   Language menu (anchored popover spawned from #btn-lang)
   ───────────────────────────────────────────────────────── */
#lang-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px;
  min-width: 158px;

  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-2);

  opacity: 0;
  transform: translateX(-4px);
  pointer-events: none;
  transition:
    opacity var(--motion-fast),
    transform var(--motion-fast);
}
#lang-menu.open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.lang-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-sm);
  text-align: left;
  transition:
    color var(--motion-fast),
    background var(--motion-fast);
}
.lang-opt:hover {
  color: var(--bright);
  background: var(--surface-hover);
}
.lang-opt.on {
  color: var(--accent-text);
  background: var(--accent-soft);
}
.fi {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────
   Hover button-tip (rendered by buttonTooltips.js).
   Stays minimal — single line, mono-spaced kbd chips.
   ───────────────────────────────────────────────────────── */
#btn-tip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 5px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);

  font-size: var(--fs-sm);
  color: var(--bright);
  white-space: nowrap;

  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity var(--motion-fast),
    transform var(--motion-fast);
}
#btn-tip.show {
  opacity: 1;
  transform: translateX(0);
}
#btn-tip .tip-kbd {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
#btn-tip kbd {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-color: rgba(255, 255, 255, 0.24);
  border-radius: 3px;
  color: var(--bright);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.02em;
}
