.unified-toolbar {
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  flex-shrink: 0;
  gap: 0;
  position: relative;
  z-index: 10;
}

.toolbar-section {
  display: flex;
  align-items: center;
  height: 100%;
}

.toolbar-section-main {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.toolbar-section-settings {
  flex-shrink: 0;
}

.toolbar-divider {
  width: 1px;
  height: 32px;
  background: var(--border-default);
  flex-shrink: 0;
}

.toolbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.toolbar-logo .brand-name {
  font-weight: 800;
  font-size: var(--text-lg);
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.toolbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.toolbar-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.toolbar-tab:hover {
  color: var(--accent-primary);
  background: rgba(179, 0, 0, 0.1);
  transform: scale(1.05);
}

.toolbar-tab.active {
  color: var(--accent-primary);
  background: rgba(179, 0, 0, 0.1);
}

.toolbar-spacer { flex: 1; }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-icon-btn {
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s;
}

.toolbar-icon-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.toolbar-icon-btn .material-icons-outlined { font-size: 20px; }

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background: var(--red, #dc2626);
  color: #fff;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.notif-badge.hidden { display: none; }

.toolbar-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toolbar-settings-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.toolbar-settings-btn .material-icons-outlined {
  font-size: 20px;
}

/* User auth section */
.toolbar-section-user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toolbar-signin {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.toolbar-signin:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-tertiary);
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
  line-height: 1;
}

.user-avatar:hover {
  box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.2);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 200;
}

.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.user-dropdown a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.pause-modal-overlay {
  position: fixed;
  top:0;right:0;bottom:0;left:0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.pause-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.pause-modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.pause-modal-overlay.active .pause-modal {
  transform: scale(1);
}

.pause-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--status-error);
}

.pause-modal-icon .material-icons-outlined {
  font-size: 32px;
}

.pause-modal-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.pause-modal-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.pause-modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.pause-modal-actions .btn {
  min-width: 120px;
}

/* ── Mobile: Dashboard toolbar hamburger ──────── */
.toolbar-hamburger { display: none; }

@media (max-width: 768px) {
  .unified-toolbar {
    padding: 0 var(--space-2);
    height: 48px;
    flex-wrap: nowrap;
    gap: var(--space-1);
  }
  .toolbar-divider { display: none; }
  .toolbar-nav { display: none; }
  #toolbar-user { display: none; }
  .toolbar-spacer { flex: 1; }

  .toolbar-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    flex-shrink: 0;
  }
  .toolbar-hamburger:hover { background: var(--bg-tertiary); color: var(--text-primary); }
  .toolbar-hamburger svg { width: 20px; height: 20px; }

  .unified-toolbar.menu-open {
    flex-wrap: wrap;
    height: auto;
  }
  .unified-toolbar.menu-open .toolbar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 10;
    padding: var(--space-1) 0;
    border-top: 1px solid var(--border-default);
  }
  .unified-toolbar.menu-open .toolbar-nav .toolbar-tab {
    padding: 10px var(--space-3);
    font-size: 14px;
    justify-content: flex-start;
    border-radius: var(--radius-sm);
  }
  .unified-toolbar.menu-open .toolbar-nav .toolbar-tab:hover {
    background: var(--bg-tertiary);
  }
  .unified-toolbar.menu-open #toolbar-user {
    display: flex;
    width: 100%;
    order: 11;
    padding: var(--space-1) var(--space-3) var(--space-2);
    border-top: 1px solid var(--border-default);
  }
}

/* ── Mobile: Bottom Nav Bar (only visible in focus view modes) ── */
.mobile-nav { display: none; }

@media (max-width: 768px) {
  body.mobile-zoom .mobile-nav,
  body.mobile-chat .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-default);
    z-index: 50;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 16px;
    min-height: 44px;
  }
  .mobile-nav-btn.active { color: var(--accent-primary); }
  .mobile-nav-btn .material-icons-outlined { font-size: 22px; }
  .mobile-nav-label { font-size: 10px; font-weight: 600; }
}
