  /* ===== BUFFER TAB STRIP ===== */
  #tab-bar {
    display: flex;
    align-items: stretch;
    height: 30px;
    flex-shrink: 0;
    background: var(--title-bg);
    border-bottom: 1px solid var(--border);
    user-select: none;
  }

  #tab-strip {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  #tab-strip::-webkit-scrollbar { height: 0; }

  .tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px 0 10px;
    max-width: 220px;
    min-width: 0;
    border-right: 1px solid var(--border);
    background: var(--title-bg);
    color: var(--text-dim);
    font-size: 11px;
    cursor: pointer;
    position: relative;
    transition: background 0.12s, color 0.12s;
  }
  .tab:hover { background: var(--cur-line); color: var(--text); }
  .tab.active {
    background: var(--bg-normal);
    color: var(--text-bright);
    box-shadow: inset 0 2px 0 var(--accent);
  }

  .tab-icon {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--tk-type);
    min-width: 16px;
    text-align: center;
    opacity: 0.85;
  }
  .tab.active .tab-icon { opacity: 1; }

  .tab-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .tab.modified .tab-name { font-style: italic; color: var(--yellow); }

  .tab-close {
    font-size: 10px;
    width: 15px;
    height: 15px;
    line-height: 15px;
    text-align: center;
    border-radius: 3px;
    color: var(--text-dim);
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.12s, background 0.12s;
  }
  .tab:hover .tab-close,
  .tab.active .tab-close,
  .tab.modified .tab-close { opacity: 1; }
  .tab.modified .tab-close { color: var(--yellow); }
  .tab-close:hover { background: var(--red); color: var(--on-accent); }

  .tab-actions {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
  }
  .tab-act {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 11px;
    padding: 0 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
  }
  .tab-act:last-child { border-right: none; }
  .tab-act:hover { background: var(--cur-line); color: var(--accent); }
  .tab-act-icon  { font-size: 12px; line-height: 1; }
  .tab-act-label { letter-spacing: 0.3px; }
  .tab-act-quiz:hover  { color: var(--magenta); }
  .tab-act-tutor:hover { color: var(--green); }

  @media (max-width: 768px) {
    #tab-bar { height: 26px; }
    .tab { font-size: 10px; max-width: 140px; }
    .tab-act-label { display: none; }
    .tab-act { padding: 0 9px; }
  }

  /* The + button sits immediately after the last tab, Notepad++ style. */
  .tab-new {
    flex-shrink: 0;
    width: 30px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
  }
  .tab-new:hover { background: var(--cur-line); color: var(--green); }
  .tab-new:active { background: var(--border); }
