/**
 * LibZen Header — compact top bar (menu-height).
 * Load menu.css alongside for ⋯ overflow styling.
 * Default theme matches LibZen Panel / TripZen dark tokens.
 */

:root {
  --libzen-hd-bg: var(--panel, #1a2332);
  --libzen-hd-text: var(--text, #e2e8f0);
  --libzen-hd-muted: var(--text-muted, #94a3b8);
  --libzen-hd-border: var(--border, #2d3a4f);
  --libzen-hd-hover: rgba(255, 255, 255, 0.06);
  --libzen-hd-accent: var(--accent, #3b82f6);
  --libzen-hd-accent-text: #ffffff;
  --libzen-hd-danger: #f87171;
  --libzen-hd-chip-bg: rgba(255, 255, 255, 0.08);
  --libzen-hd-height: 40px;
  --libzen-hd-font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-libzen-header-theme='light'] {
  --libzen-hd-bg: #ffffff;
  --libzen-hd-text: #37352f;
  --libzen-hd-muted: #9b9a97;
  --libzen-hd-border: rgba(55, 53, 47, 0.09);
  --libzen-hd-hover: rgba(55, 53, 47, 0.06);
  --libzen-hd-accent: #2383e2;
  --libzen-hd-danger: #eb5757;
  --libzen-hd-chip-bg: rgba(55, 53, 47, 0.06);
}

.libzen-hd-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--libzen-hd-height);
  height: var(--libzen-hd-height);
  padding: 0 12px;
  box-sizing: border-box;
  background: var(--libzen-hd-bg);
  color: var(--libzen-hd-text);
  border-bottom: 1px solid var(--libzen-hd-border);
  font-family: var(--libzen-hd-font);
  font-size: 13px;
  line-height: 1.2;
  flex-shrink: 0;
}

.libzen-hd-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.libzen-hd-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.libzen-hd-subtitle {
  font-size: 13px;
  color: var(--libzen-hd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.libzen-hd-subtitle::before {
  content: '·';
  margin: 0 6px;
  opacity: 0.5;
}

.libzen-hd-labels {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.libzen-hd-label {
  font-size: 12px;
  color: var(--libzen-hd-muted);
  white-space: nowrap;
}

.libzen-hd-label-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--libzen-hd-chip-bg);
  color: var(--libzen-hd-text);
  font-size: 12px;
  line-height: 1.35;
}

.libzen-hd-label-muted {
  opacity: 0.85;
}

.libzen-hd-spacer {
  flex: 1;
  min-width: 8px;
}

.libzen-hd-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.libzen-hd-menu-anchor {
  display: flex;
  align-items: center;
}

.libzen-hd-panel-manager-anchor {
  display: flex;
  align-items: center;
}

/* Glyph shortcut buttons */
.libzen-hd-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--libzen-hd-muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}

.libzen-hd-glyph:hover:not(:disabled) {
  background: var(--libzen-hd-hover);
  color: var(--libzen-hd-text);
}

.libzen-hd-glyph:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.libzen-hd-glyph-primary {
  color: var(--libzen-hd-accent);
}

.libzen-hd-glyph-primary:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.15);
  color: var(--libzen-hd-accent);
}

.libzen-hd-glyph-danger:hover:not(:disabled) {
  color: var(--libzen-hd-danger);
  background: rgba(248, 113, 113, 0.12);
}

.libzen-hd-glyph-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.libzen-hd-glyph-icon svg {
  width: 16px;
  height: 16px;
}

/* Menu trigger inside header — match glyph sizing */
.libzen-hd-bar .libzen-mn-trigger {
  width: 28px;
  height: 28px;
}
