/* LibZen CSS bundle — generated by scripts/bundle-libzen.mjs; do not edit */

/* === Menu/menu.css === */
/**
 * LibZen Menu — vertical overflow menu.
 * Default theme matches LibZen Panel / TripZen dark tokens.
 */

:root {
  --libzen-mn-bg: var(--panel, #1a2332);
  --libzen-mn-text: var(--text, #e2e8f0);
  --libzen-mn-muted: var(--text-muted, #94a3b8);
  --libzen-mn-border: var(--border, #2d3a4f);
  --libzen-mn-hover: rgba(255, 255, 255, 0.06);
  --libzen-mn-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --libzen-mn-accent: var(--accent, #3b82f6);
  --libzen-mn-danger: #f87171;
  --libzen-mn-toggle-off: rgba(255, 255, 255, 0.16);
  --libzen-mn-radius: 8px;
  --libzen-mn-font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-libzen-menu-theme='light'] {
  --libzen-mn-bg: #ffffff;
  --libzen-mn-text: #37352f;
  --libzen-mn-muted: #9b9a97;
  --libzen-mn-border: rgba(55, 53, 47, 0.09);
  --libzen-mn-hover: rgba(55, 53, 47, 0.06);
  --libzen-mn-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px,
    rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 9px 24px;
  --libzen-mn-accent: #2383e2;
  --libzen-mn-danger: #eb5757;
  --libzen-mn-toggle-off: rgba(55, 53, 47, 0.16);
}

/* —— Trigger (⋯) —— */
.libzen-mn-trigger {
  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-mn-muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}

.libzen-mn-trigger:hover,
.libzen-mn-trigger[aria-expanded='true'] {
  background: var(--libzen-mn-hover);
  color: var(--libzen-mn-text);
}

.libzen-mn-trigger-dots {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transform: translateY(-1px);
}

.libzen-mn-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.libzen-mn-trigger-icon svg {
  width: 16px;
  height: 16px;
}

/* —— Panel —— */
.libzen-mn-panel {
  position: fixed;
  z-index: 10000;
  background: var(--libzen-mn-bg);
  color: var(--libzen-mn-text);
  border: 1px solid var(--libzen-mn-border);
  border-radius: var(--libzen-mn-radius);
  box-shadow: var(--libzen-mn-shadow);
  font-family: var(--libzen-mn-font);
  font-size: 14px;
  line-height: 1.4;
  padding: 6px 0;
  /* max-height is set in px by Menu.#layoutPanel from viewport space */
  max-height: min(85vh, 560px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .libzen-mn-panel,
  .libzen-mn-submenu {
    max-width: calc(100vw - 16px);
  }
}

.libzen-mn-submenu {
  position: fixed;
  z-index: 10000;
  background: var(--libzen-mn-bg);
  color: var(--libzen-mn-text);
  border: 1px solid var(--libzen-mn-border);
  border-radius: var(--libzen-mn-radius);
  box-shadow: var(--libzen-mn-shadow);
  font-family: var(--libzen-mn-font);
  font-size: 14px;
  line-height: 1.4;
  padding: 6px 0;
  min-width: 200px;
  max-height: min(60vh, 400px);
  overflow-y: auto;
}

/* —— Search —— */
.libzen-mn-search-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 8px 6px;
  padding: 0 10px;
  border: 1px solid var(--libzen-mn-border);
  border-radius: 6px;
  background: var(--libzen-mn-bg);
}

.libzen-mn-search-wrap:focus-within {
  border-color: var(--libzen-mn-accent);
  box-shadow: 0 0 0 1px var(--libzen-mn-accent);
}

.libzen-mn-search-icon {
  display: flex;
  color: var(--libzen-mn-muted);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.libzen-mn-search-icon svg {
  width: 16px;
  height: 16px;
}

.libzen-mn-search {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--libzen-mn-text);
  font: inherit;
  font-size: 14px;
  padding: 8px 0;
  outline: none;
}

.libzen-mn-search::placeholder {
  color: var(--libzen-mn-muted);
}

/* —— List (scroll) + footer (pinned) —— */
.libzen-mn-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.libzen-mn-footer {
  flex-shrink: 0;
  padding: 4px 0 2px;
  border-top: 1px solid var(--libzen-mn-border);
}

.libzen-mn-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--libzen-mn-border);
}

.libzen-mn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 8px);
  margin: 0 4px;
  padding: 6px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.libzen-mn-item:hover:not(:disabled),
.libzen-mn-item-submenu-open {
  background: var(--libzen-mn-hover);
}

.libzen-mn-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.libzen-mn-item-danger {
  color: var(--libzen-mn-danger);
}

.libzen-mn-item-toggle {
  cursor: default;
}

.libzen-mn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--libzen-mn-text);
  opacity: 0.85;
}

.libzen-mn-icon svg {
  width: 16px;
  height: 16px;
}

.libzen-mn-item-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.libzen-mn-item-trailing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--libzen-mn-muted);
}

.libzen-mn-shortcut {
  font-size: 12px;
  color: var(--libzen-mn-muted);
  white-space: nowrap;
}

.libzen-mn-badge {
  font-size: 12px;
  min-width: 18px;
  text-align: center;
  color: var(--libzen-mn-muted);
}

.libzen-mn-chevron {
  display: flex;
  width: 16px;
  height: 16px;
  opacity: 0.55;
}

.libzen-mn-chevron svg {
  width: 16px;
  height: 16px;
}

/* —— Toggle switch —— */
.libzen-mn-toggle {
  position: relative;
  width: 32px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--libzen-mn-toggle-off);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.libzen-mn-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.libzen-mn-toggle-on {
  background: var(--libzen-mn-accent);
}

.libzen-mn-toggle-on::after {
  transform: translateX(14px);
}

/* —— Meta footer —— */
.libzen-mn-meta {
  padding: 8px 14px 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--libzen-mn-muted);
  white-space: pre-line;
}

.libzen-mn-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--libzen-mn-muted);
  text-align: center;
}

/* === Header/header.css === */
/**
 * 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;
}

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

/* === LoginScreen/login-screen.css === */
/**
 * LibZen LoginScreen styles (NetZen / TripZen auth form).
 * Host app may define theme tokens; fallbacks match Zen dark theme.
 */

:root {
  --libzen-ls-bg: var(--bg, #0f1419);
  --libzen-ls-text: var(--text, #e8edf4);
  --libzen-ls-muted: var(--text-muted, var(--muted, #8b9cb3));
  --libzen-ls-border: var(--border, #2d3a4f);
  --libzen-ls-accent: var(--accent, #3b82f6);
  --libzen-ls-accent-dim: var(--accent-dim, #2563eb);
  --libzen-ls-danger: var(--danger, #ef4444);
  --libzen-ls-radius: var(--btn-radius, 6px);
  --libzen-ls-focus-ring: var(--btn-focus-ring, 2px solid var(--libzen-ls-accent));
}

.libzen-ls-page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--libzen-ls-bg);
  color: var(--libzen-ls-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.libzen-ls-form {
  width: 100%;
  max-width: 420px;
}

.libzen-ls-form h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.libzen-ls-error {
  color: var(--libzen-ls-danger);
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.libzen-ls-fields label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--libzen-ls-muted);
  font-size: 0.9rem;
}

.libzen-ls-fields input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-radius: var(--libzen-ls-radius);
  border: 1px solid var(--libzen-ls-border);
  background: var(--libzen-ls-bg);
  color: var(--libzen-ls-text);
  font: inherit;
  box-sizing: border-box;
}

.libzen-ls-fields input:focus {
  outline: none;
  border-color: var(--libzen-ls-accent);
}

.libzen-ls-submit {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--libzen-ls-radius);
  background: var(--libzen-ls-accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.libzen-ls-submit:hover:not(:disabled) {
  background: var(--libzen-ls-accent-dim);
}

.libzen-ls-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.libzen-ls-submit:focus-visible {
  outline: var(--libzen-ls-focus-ring);
  outline-offset: 2px;
}

.libzen-ls-links {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.libzen-ls-link {
  font: inherit;
  font-size: inherit;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--libzen-ls-text);
  cursor: pointer;
  text-decoration: none;
}

.libzen-ls-link:hover {
  color: var(--libzen-ls-accent);
}

.libzen-ls-link-muted {
  opacity: 0.6;
}

/* === Dialog/dialog.css === */
/**
 * LibZen Dialog — centered modal with header, scrollable body, and footer.
 * Uses host app CSS variables when present; includes dark-theme fallbacks.
 */

:root {
  --libzen-dg-surface: var(--surface, #1a2332);
  --libzen-dg-bg: var(--bg, #0f1419);
  --libzen-dg-text: var(--text, #e8edf4);
  --libzen-dg-muted: var(--text-muted, #8b9cb3);
  --libzen-dg-border: var(--border, #2d3a4f);
  --libzen-dg-accent: var(--accent, #3b82f6);
  --libzen-dg-accent-hover: var(--accent-dim, #2563eb);
  --libzen-dg-danger: var(--danger, #ef4444);
  --libzen-dg-radius: 12px;
  --libzen-dg-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.libzen-dg-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}

.libzen-dg-panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 400px);
  max-height: min(90vh, 720px);
  background: var(--libzen-dg-surface);
  color: var(--libzen-dg-text);
  border: 1px solid var(--libzen-dg-border);
  border-radius: var(--libzen-dg-radius);
  box-shadow: var(--libzen-dg-shadow);
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.libzen-dg-panel-wide {
  width: min(100%, 480px);
}

.libzen-dg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--libzen-dg-border);
}

.libzen-dg-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.libzen-dg-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -6px -8px -6px 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--libzen-dg-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.libzen-dg-close:hover {
  color: var(--libzen-dg-text);
  background: rgba(255, 255, 255, 0.06);
}

.libzen-dg-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.libzen-dg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--libzen-dg-border);
  background: color-mix(in srgb, var(--libzen-dg-bg) 40%, var(--libzen-dg-surface));
}

.libzen-dg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--libzen-dg-border);
  background: transparent;
  color: var(--libzen-dg-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.libzen-dg-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.libzen-dg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.libzen-dg-btn-primary {
  border-color: var(--libzen-dg-accent);
  background: var(--libzen-dg-accent);
  color: #fff;
}

.libzen-dg-btn-primary:hover:not(:disabled) {
  background: var(--libzen-dg-accent-hover);
  border-color: var(--libzen-dg-accent-hover);
}

.libzen-dg-message {
  margin: 0;
  white-space: pre-wrap;
}

.libzen-dg-inline-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* === TribeMembersScreen/tribe-members-screen.css === */
/**
 * LibZen TribeMembersScreen — NetZen family_members-style tribe-scoped table.
 */

:root {
  --libzen-tm-bg: var(--bg, #0f1419);
  --libzen-tm-surface: var(--surface, #1a2332);
  --libzen-tm-text: var(--text, #e8edf4);
  --libzen-tm-muted: var(--text-muted, var(--muted, #8b9cb3));
  --libzen-tm-border: var(--border, #2d3a4f);
  --libzen-tm-accent: var(--accent, #3b82f6);
  --libzen-tm-danger: var(--danger, #ef4444);
  --libzen-tm-success: var(--success, #22c55e);
}

.libzen-tm-page {
  min-height: 100%;
  overflow: auto;
  background: var(--libzen-tm-bg);
  color: var(--libzen-tm-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.libzen-tm-wrap {
  max-width: 88rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.libzen-tm-back {
  margin: 0 0 0.75rem;
}

.libzen-tm-back button {
  background: transparent;
  border: 1px solid var(--libzen-tm-border);
  color: var(--libzen-tm-muted);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font: inherit;
}

.libzen-tm-back button:hover {
  color: var(--libzen-tm-text);
}

.libzen-tm-wrap h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.libzen-tm-sub {
  color: var(--libzen-tm-muted);
  margin: 0 0 1.25rem;
  max-width: 48rem;
}

.libzen-tm-error {
  color: var(--libzen-tm-danger);
  margin: 0 0 1rem;
}

.libzen-tm-section {
  background: var(--libzen-tm-surface);
  border: 1px solid var(--libzen-tm-border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.libzen-tm-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.libzen-tm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.libzen-tm-row input[type='text'],
.libzen-tm-row input[type='email'],
.libzen-tm-row input[type='password'],
.libzen-tm-row select {
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--libzen-tm-border);
  background: var(--libzen-tm-bg);
  color: var(--libzen-tm-text);
  font: inherit;
}

.libzen-tm-row button,
.libzen-tm-table button {
  font: inherit;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  border: 1px solid var(--libzen-tm-border);
  background: transparent;
  color: var(--libzen-tm-text);
}

.libzen-tm-row button.primary,
.libzen-tm-table button.primary {
  background: var(--libzen-tm-accent);
  border-color: var(--libzen-tm-accent);
  color: #fff;
}

.libzen-tm-table button.warn {
  color: #fca5a5;
}

.libzen-tm-table button.unblock {
  color: var(--libzen-tm-success);
}

.libzen-tm-table {
  width: 100%;
  border-collapse: collapse;
}

.libzen-tm-table th {
  text-align: left;
  padding: 0.5rem;
  font-size: 0.78rem;
  color: var(--libzen-tm-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.libzen-tm-table td {
  padding: 0.5rem;
  vertical-align: top;
  border-top: 1px solid var(--libzen-tm-border);
}

.libzen-tm-table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.libzen-tm-table .col-actions button + button {
  margin-left: 0.35rem;
}

.libzen-tm-role-badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 4px;
  background: var(--chip, #243044);
  color: var(--libzen-tm-text);
}

.libzen-tm-role-badge.super {
  background: var(--libzen-tm-accent);
  color: #fff;
  font-weight: 600;
}

.libzen-tm-you-tag {
  font-size: 0.72rem;
  color: var(--libzen-tm-muted);
  font-style: italic;
  margin-left: 0.35rem;
}

.libzen-tm-role-picker {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.libzen-tm-role-opt {
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.libzen-tm-role-opt input {
  margin: 0;
}

.libzen-tm-meta {
  opacity: 0.7;
  font-size: 0.9em;
}

.libzen-tm-empty {
  color: var(--libzen-tm-muted);
  margin: 0;
}

/* === UserScreen/user-screen.css === */
/**
 * LibZen UserScreen — NetZen-style user / membership management.
 */

:root {
  --libzen-us-bg: var(--bg, #0f1419);
  --libzen-us-surface: var(--surface, #1a2332);
  --libzen-us-surface-hover: var(--surface-hover, #243044);
  --libzen-us-text: var(--text, #e8edf4);
  --libzen-us-muted: var(--text-muted, var(--muted, #8b9cb3));
  --libzen-us-border: var(--border, #2d3a4f);
  --libzen-us-accent: var(--accent, #3b82f6);
  --libzen-us-danger: var(--danger, #ef4444);
  --libzen-us-success: var(--success, #22c55e);
  --libzen-us-radius: var(--btn-radius, 6px);
}

.libzen-us-page {
  min-height: 100%;
  overflow: auto;
  background: var(--libzen-us-bg);
  color: var(--libzen-us-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.libzen-us-wrap {
  max-width: 88rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.libzen-us-wrap h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.libzen-us-sub {
  color: var(--libzen-us-muted);
  margin: 0 0 1.25rem;
  max-width: 48rem;
}

.libzen-us-error {
  color: var(--libzen-us-danger);
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.libzen-us-empty {
  color: var(--libzen-us-muted);
  margin: 0;
}

.libzen-us-section {
  background: var(--libzen-us-surface);
  border: 1px solid var(--libzen-us-border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.libzen-us-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.libzen-us-list-title {
  margin: 1rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.libzen-us-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.libzen-us-row input,
.libzen-us-row select {
  width: auto;
  min-width: 10rem;
  flex: 1 1 10rem;
  max-width: 16rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--libzen-us-radius);
  border: 1px solid var(--libzen-us-border);
  background: var(--libzen-us-bg);
  color: var(--libzen-us-text);
  font: inherit;
}

.libzen-us-card {
  background: var(--libzen-us-surface);
  border: 1px solid var(--libzen-us-border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.libzen-us-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.libzen-us-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.libzen-us-head-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.libzen-us-email {
  color: var(--libzen-us-muted);
  font-size: 0.85rem;
  margin: 0.15rem 0 0;
}

.libzen-us-details {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--libzen-us-border);
}

.libzen-us-detail-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  align-items: center;
}

.libzen-us-detail-label {
  color: var(--libzen-us-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.libzen-us-detail-value {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.libzen-us-detail-input {
  min-width: 10rem;
  flex: 1 1 10rem;
  max-width: 16rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--libzen-us-radius);
  border: 1px solid var(--libzen-us-border);
  background: var(--libzen-us-bg);
  color: var(--libzen-us-text);
  font: inherit;
}

.libzen-us-pw-row {
  gap: 0.65rem;
}

.libzen-us-pw-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.libzen-us-detail-row-stack {
  align-items: start;
}

.libzen-us-detail-row-stack .libzen-us-detail-label {
  padding-top: 0.35rem;
}

.libzen-us-pw-mask {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.12em;
  color: var(--libzen-us-muted);
}

.libzen-us-badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 4px;
  background: var(--libzen-us-surface-hover);
  color: var(--libzen-us-text);
}

.libzen-us-badge.super {
  background: var(--libzen-us-accent);
  color: #fff;
  font-weight: 600;
}

.libzen-us-badge.blocked {
  background: var(--libzen-us-danger);
  color: #fff;
}

.libzen-us-badge.active {
  background: transparent;
  border: 1px solid var(--libzen-us-border);
  color: var(--libzen-us-muted);
}

.libzen-us-mem-list {
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 16rem auto 1fr auto;
  gap: 0.4rem 0.9rem;
}

.libzen-us-mem-row,
.libzen-us-assign-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
}

.libzen-us-mem-row {
  padding: 0.4rem 0.55rem;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 6px;
}

.libzen-us-mem-tribe-cell {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.libzen-us-mem-tribe {
  font-weight: 500;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.libzen-us-mem-actions {
  grid-column: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.libzen-us-mem-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--libzen-us-muted);
}

.libzen-us-assign-form {
  margin-top: 0.15rem;
  padding: 0.6rem 0.55rem 0.15rem;
  border-top: 1px solid var(--libzen-us-border);
}

.libzen-us-assign-form > button {
  grid-column: 4;
  justify-self: start;
}

.libzen-us-role-picker {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

.libzen-us-role-opt {
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.libzen-us-role-opt input {
  margin: 0;
  width: auto;
}

.libzen-us-role-form {
  margin-top: 0.7rem;
}

.libzen-us-you-tag {
  font-size: 0.72rem;
  color: var(--libzen-us-muted);
  font-style: italic;
  font-weight: 400;
}

.libzen-us-page button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--libzen-us-radius);
}

.libzen-us-page button.primary {
  padding: 0.45rem 0.9rem;
  border: none;
  background: var(--libzen-us-accent);
  color: #fff;
  font-weight: 500;
}

.libzen-us-page button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.libzen-us-page button.ghost {
  background: transparent;
  border: 1px solid var(--libzen-us-border);
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
  color: var(--libzen-us-text);
}

.libzen-us-page button.warn {
  color: var(--libzen-us-danger);
  border: 1px solid var(--libzen-us-danger);
  background: transparent;
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
}

.libzen-us-page button.unblock {
  color: var(--libzen-us-success);
  border: 1px solid var(--libzen-us-success);
  background: transparent;
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
}

.libzen-us-page button.danger {
  color: var(--libzen-us-danger);
  border: 1px solid var(--libzen-us-danger);
  background: transparent;
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
}

.libzen-us-page button.secondary {
  background: transparent;
  border: 1px solid var(--libzen-us-border);
  color: var(--libzen-us-text);
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
}

@media (max-width: 720px) {
  .libzen-us-mem-list {
    grid-template-columns: 1fr;
  }

  .libzen-us-mem-row,
  .libzen-us-assign-form {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .libzen-us-mem-actions {
    grid-column: 1;
  }

  .libzen-us-assign-form > button {
    grid-column: 1;
  }
}

/* === Select/select.css === */
/**
 * LibZen Select — dropdown / creatable combobox.
 */

:root {
  --libzen-sl-bg: var(--bg, #0f1419);
  --libzen-sl-surface: var(--surface, #1a2332);
  --libzen-sl-text: var(--text, #e2e8f0);
  --libzen-sl-muted: var(--text-muted, #94a3b8);
  --libzen-sl-border: var(--border, #2d3a4f);
  --libzen-sl-hover: rgba(255, 255, 255, 0.06);
  --libzen-sl-accent: var(--accent, #3b82f6);
  --libzen-sl-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --libzen-sl-radius: 6px;
  --libzen-sl-font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-libzen-select-theme='light'] {
  --libzen-sl-bg: #ffffff;
  --libzen-sl-surface: #ffffff;
  --libzen-sl-text: #37352f;
  --libzen-sl-muted: #9b9a97;
  --libzen-sl-border: rgba(55, 53, 47, 0.16);
  --libzen-sl-hover: rgba(55, 53, 47, 0.06);
  --libzen-sl-accent: #2383e2;
  --libzen-sl-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px,
    rgba(15, 15, 15, 0.1) 0px 3px 6px;
}

.libzen-sl-root {
  position: relative;
  width: 100%;
  font-family: var(--libzen-sl-font);
}

.libzen-sl-control {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 34px;
  /* Base size for the whole control; text + chevron derive from this (em units). */
  font-size: 14px;
  border: 1px solid var(--libzen-sl-border);
  border-radius: var(--libzen-sl-radius);
  background: var(--libzen-sl-bg);
  overflow: hidden;
}

.libzen-sl-root:focus-within .libzen-sl-control {
  border-color: var(--libzen-sl-accent);
}

/* Transparent variant — no background fill or border, for embedding inside cards. */
.libzen-sl-transparent .libzen-sl-control,
.libzen-sl-transparent.libzen-sl-root:focus-within .libzen-sl-control {
  background: transparent;
  border-color: transparent;
}

.libzen-sl-transparent .libzen-sl-toggle {
  border-left-color: transparent;
}

/*
 * Belong to a host container: inherit body font family + size (instead of forcing our own)
 * and let the chevron/toggle scale with that size. Applies to both `contained` and
 * `transparent` (transparent is always contained).
 */
.libzen-sl-contained.libzen-sl-root,
.libzen-sl-transparent.libzen-sl-root {
  font-family: inherit;
}

.libzen-sl-contained .libzen-sl-control,
.libzen-sl-transparent .libzen-sl-control {
  font-size: inherit;
}

.libzen-sl-contained .libzen-sl-toggle,
.libzen-sl-transparent .libzen-sl-toggle {
  /*
   * Width tracks the inherited font-size so the arrow stays proportionate, but the
   * toggle should hug the chevron — not reserve a wide box. Tight padding keeps the
   * arrow snug against the value text (the value's own right padding supplies the gap).
   */
  width: auto;
  padding: 0 0.15em;
}

/*
 * Chip layout: the select sizes to its content so the label + chevron sit together,
 * instead of flex-filling a full-width box. Implies `contained` (inherits font + scales
 * chevron). Composes with `transparent`.
 */
.libzen-sl-chip.libzen-sl-root {
  width: auto;
  display: inline-flex;
}

.libzen-sl-chip .libzen-sl-control {
  width: auto;
}

.libzen-sl-chip .libzen-sl-value,
.libzen-sl-chip .libzen-sl-input {
  flex: 0 1 auto;
  padding-left: 0;
  padding-right: 0;
}

.libzen-sl-panel-inherit-font .libzen-sl-option,
.libzen-sl-panel-inherit-font .libzen-sl-empty {
  font-family: inherit;
  font-size: inherit;
}

.libzen-sl-input,
.libzen-sl-value {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--libzen-sl-text);
  font: inherit;
  padding: 6px 10px;
  text-align: left;
}

.libzen-sl-input::placeholder {
  color: var(--libzen-sl-muted);
}

.libzen-sl-value {
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.libzen-sl-value-placeholder {
  color: var(--libzen-sl-muted);
}

.libzen-sl-toggle {
  flex-shrink: 0;
  width: 34px;
  /* Defend against a host app's global `button { min-width }` leaking in (mirrors the value). */
  min-width: 0;
  border: none;
  border-left: 1px solid var(--libzen-sl-border);
  background: transparent;
  color: var(--libzen-sl-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.libzen-sl-toggle:hover {
  background: var(--libzen-sl-hover);
  color: var(--libzen-sl-text);
}

.libzen-sl-chevron {
  display: inline-block;
  /* Sized in em so the arrow scales with the (possibly inherited) font-size. */
  width: 0.55em;
  height: 0.55em;
  border-right: 0.14em solid currentColor;
  border-bottom: 0.14em solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.2em;
}

.libzen-sl-panel {
  position: fixed;
  z-index: 10000;
  background: var(--libzen-sl-surface);
  color: var(--libzen-sl-text);
  border: 1px solid var(--libzen-sl-border);
  border-radius: var(--libzen-sl-radius);
  box-shadow: var(--libzen-sl-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
}

.libzen-sl-list {
  overflow-y: auto;
  padding: 4px 0;
}

.libzen-sl-option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  /* Never wrap a label onto two lines — the panel grows to fit instead
     (Select.js #positionPanel sizes the panel to its widest option). */
  white-space: nowrap;
}

.libzen-sl-option:hover,
.libzen-sl-option-highlight {
  background: var(--libzen-sl-hover);
}

.libzen-sl-option-selected {
  color: var(--libzen-sl-accent);
  font-weight: 600;
}

.libzen-sl-option-create {
  color: var(--libzen-sl-accent);
  font-weight: 600;
  border-bottom: 1px solid var(--libzen-sl-border);
}

.libzen-sl-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--libzen-sl-muted);
}

.libzen-sl-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.libzen-sl-value[hidden],
.libzen-sl-input[hidden] {
  display: none !important;
}

.libzen-sl-select-mode .libzen-sl-value {
  cursor: pointer;
}

.libzen-sl-select-mode .libzen-sl-value:hover {
  background: var(--libzen-sl-hover);
}

/* === Panel/panel.css === */
/**
 * LibZen Panel — column panels, nested cards, lists, horizontal stack.
 * Theme tokens: --libzen-panel, --libzen-surface, --libzen-border, --libzen-accent, etc.
 */

:root {
  --libzen-panel: var(--panel, #1a2332);
  --libzen-surface: var(--surface, #243044);
  --libzen-surface-hover: var(--surface-hover, #2a3850);
  --libzen-bg: var(--bg, #151c28);
  --libzen-border: var(--border, #2d3a4f);
  --libzen-text: var(--text, #e2e8f0);
  --libzen-text-muted: var(--text-muted, #94a3b8);
  --libzen-highlight: var(--highlight, #f1f5f9);
  --libzen-accent: var(--accent, #3b82f6);

  /* Spacing tokens — drive the vertical density of panels, cards, and lists.
     Override these (e.g. via .libzen-pn-tight) to compact the whole subtree. */
  --libzen-pn-header-pad: 16px;
  --libzen-pn-header-row-gap: 12px;
  --libzen-pn-scroll-pad: 12px;
  --libzen-pn-card-gap: 10px;
  --libzen-pn-card-header-pad-y: 10px;
  --libzen-pn-card-header-pad-x: 12px;
  --libzen-pn-card-body-pad: 12px;
  --libzen-pn-card-host-gap: 6px;
  --libzen-pn-list-gap: 6px;
  --libzen-pn-list-row-pad-y: 8px;
  --libzen-pn-list-row-pad-x: 10px;
}

/* Tight mode — compact spacing for dense layouts. Put `libzen-pn-tight` on a
   PanelStack/Panel (cascades to every nested card + list) or on an individual
   card/list. Only spacing changes; colors, fonts, and behavior are untouched. */
.libzen-pn-tight {
  --libzen-pn-header-pad: 10px;
  --libzen-pn-header-row-gap: 8px;
  --libzen-pn-scroll-pad: 8px;
  --libzen-pn-card-gap: 6px;
  --libzen-pn-card-header-pad-y: 6px;
  --libzen-pn-card-body-pad: 8px;
  --libzen-pn-card-host-gap: 4px;
  --libzen-pn-list-gap: 4px;
  --libzen-pn-list-row-pad-y: 5px;
}

/* —— Workspace: main slot (map) + panel stack —— */
.libzen-pn-workspace {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  --libzen-main-min-width: 200px;
}

.libzen-pn-main-slot {
  flex: 1 1 0;
  min-width: var(--libzen-main-min-width, 200px);
  position: relative;
  overflow: hidden;
}

.libzen-pn-stack-host {
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  overflow: hidden;
}

/* —— Horizontal stack —— */
.libzen-pn-stack {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 100%;
  flex-shrink: 0;
  position: relative;
}

.libzen-pn-stack-unit {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 100%;
  flex-shrink: 0;
}

.libzen-pn-stack-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.libzen-pn-stack-panel > .libzen-pn-panel {
  flex: 1;
  width: 100%;
  min-width: 0;
}

.libzen-pn-resize-handle {
  position: relative;
  flex: 0 0 6px;
  width: 6px;
  cursor: col-resize;
  touch-action: none;
  z-index: 20;
  background: transparent;
}

.libzen-pn-resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: transparent;
  transition: background 0.15s;
  pointer-events: none;
}

.libzen-pn-resize-handle:hover::after,
.libzen-pn-resize-handle.libzen-pn-resize-handle-active::after {
  background: var(--libzen-accent);
}

body.libzen-pn-resize-active {
  cursor: col-resize;
  user-select: none;
}

/* —— Column panel —— */
.libzen-pn-panel {
  background: var(--libzen-panel);
  border-left: 1px solid var(--libzen-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  color: var(--libzen-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.libzen-pn-panel-header {
  padding: var(--libzen-pn-header-pad);
  border-bottom: 1px solid var(--libzen-border);
  flex-shrink: 0;
}

.libzen-pn-panel-header-collapsed {
  padding: 10px 16px;
}

.libzen-pn-panel-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--libzen-pn-header-row-gap);
}

.libzen-pn-panel-header-collapsed .libzen-pn-panel-header-row {
  margin-bottom: 0;
}

.libzen-pn-panel-header-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
  gap: 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.libzen-pn-panel-header-toggle:hover {
  background: transparent;
}

.libzen-pn-panel-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--libzen-highlight);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.libzen-pn-panel-header-collapsed .libzen-pn-panel-title {
  font-size: 16px;
}

.libzen-pn-panel-collapsed .libzen-pn-panel-toolbar,
.libzen-pn-panel-collapsed .libzen-pn-panel-scroll {
  display: none;
}

.libzen-pn-panel-title-activatable {
  cursor: pointer;
}

/* —— Dock-to-corner button —— */
.libzen-pn-panel-dock-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--libzen-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.libzen-pn-panel-dock-btn:hover {
  background: var(--libzen-surface-hover);
  color: var(--libzen-text);
}

.libzen-pn-panel-dock-btn-active {
  color: var(--libzen-accent);
}

/* —— Docked state: float as a compact pill in the bottom-right corner —— */
.libzen-pn-panel-docked {
  position: fixed;
  right: 12px;
  bottom: var(--libzen-pn-dock-offset, 12px);
  left: auto;
  top: auto;
  width: auto !important;
  min-width: 0 !important;
  max-width: min(70vw, 320px) !important;
  height: auto !important;
  border: 1px solid var(--libzen-border);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 1200;
  cursor: move;
  touch-action: none;
}

.libzen-pn-panel-docked-dragging {
  cursor: grabbing;
  user-select: none;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

.libzen-pn-panel-docked .libzen-pn-panel-header {
  padding: 8px 10px 8px 16px;
  border-bottom: none;
}

.libzen-pn-panel-docked .libzen-pn-panel-header-row {
  margin-bottom: 0;
}

.libzen-pn-panel-docked .libzen-pn-panel-title {
  font-size: 14px;
}

.libzen-pn-panel-docked .libzen-pn-panel-toolbar,
.libzen-pn-panel-docked .libzen-pn-panel-scroll,
.libzen-pn-panel-docked .libzen-pn-collapse-chevron {
  display: none;
}

/* —— Mobile / narrow screens ——
   Expanded panels use the bottom half; top half stays map. Docked pills stay
   as bottom-corner chips above the map but below route detail sheets. */
@media (max-width: 768px) {
  .libzen-pn-resize-handle {
    display: none;
  }

  .libzen-pn-stack-unit:not(.libzen-pn-stack-unit-docked) {
    position: fixed;
    left: 0;
    right: 0;
    top: 50vh;
    bottom: 0;
    width: 100vw !important;
    height: auto;
    max-height: none;
    z-index: 1250;
  }

  .libzen-pn-stack-unit:not(.libzen-pn-stack-unit-docked) .libzen-pn-stack-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 100%;
  }

  .libzen-pn-stack-unit:not(.libzen-pn-stack-unit-docked) .libzen-pn-panel {
    height: 100%;
    border-left: none;
    border-top: 1px solid var(--libzen-border);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
  }

  /* Slightly larger tap target for the docked pills on touch screens. */
  .libzen-pn-panel-docked .libzen-pn-panel-header {
    min-height: 40px;
  }
}

.libzen-pn-panel-drag-handle {
  cursor: grab;
  color: var(--libzen-text-muted);
  font-size: 16px;
  padding: 4px;
  user-select: none;
  flex-shrink: 0;
}

.libzen-pn-panel-drag-handle:active {
  cursor: grabbing;
}

.libzen-pn-panel-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.libzen-pn-panel-toolbar[hidden] {
  display: none;
}

.libzen-pn-panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--libzen-pn-scroll-pad);
}

/* —— Nested card panel —— */
.libzen-pn-card {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background: var(--libzen-bg);
  border: 1px solid var(--libzen-border);
  border-radius: 10px;
  margin-bottom: var(--libzen-pn-card-gap);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.libzen-pn-card-unchecked {
  opacity: 0.55;
}

.libzen-pn-card-unchecked .libzen-pn-card-header {
  opacity: 0.85;
}

.libzen-pn-card-drop-before,
.libzen-pn-card-drop-after {
  border-color: var(--libzen-accent);
}

.libzen-pn-card-drop-before::before,
.libzen-pn-card-drop-after::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  background: var(--libzen-accent);
  border-radius: 2px;
  pointer-events: none;
  z-index: 2;
}

.libzen-pn-card-drop-before::before {
  top: 0;
}

.libzen-pn-card-drop-after::after {
  bottom: 0;
}

.libzen-pn-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--libzen-pn-card-header-pad-y) var(--libzen-pn-card-header-pad-x);
  cursor: pointer;
  user-select: none;
  background: var(--libzen-surface);
}

.libzen-pn-card-header:hover {
  background: var(--libzen-surface-hover);
}

.libzen-pn-card-header-text {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.libzen-pn-card-header-trailing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.libzen-pn-card-grip,
.libzen-pn-list-grip {
  color: var(--libzen-text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  flex-shrink: 0;
  padding: 2px;
}

.libzen-pn-card-grip:active,
.libzen-pn-list-grip:active {
  cursor: grabbing;
}

.libzen-pn-card-title {
  font-weight: 600;
  font-size: 14px;
}

.libzen-pn-card-leading-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Second-row / expanded-body summary (e.g. leg drive · distance · stop). */
.libzen-pn-card-summary {
  margin: 0;
  font-size: 12px;
  color: var(--libzen-text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.libzen-pn-card-body {
  padding: var(--libzen-pn-card-body-pad);
  border-top: 1px solid var(--libzen-border);
  /* Match inset content areas (drop zones, lists) — not page --bg. */
  background: var(--libzen-surface);
}

.libzen-pn-card-body[hidden] {
  display: none;
}

.libzen-pn-card-title[hidden],
.libzen-pn-card-oneline[hidden] {
  display: none !important;
}

/* Nested cards inside a parent body (e.g. itinerary legs in a trip section). */
.libzen-pn-card-body-host {
  display: flex;
  flex-direction: column;
  gap: var(--libzen-pn-card-host-gap);
  min-width: 0;
}

.libzen-pn-card-body-host > .libzen-pn-card {
  margin-bottom: 0;
  background: transparent;
  border-color: var(--libzen-border);
}

.libzen-pn-card-body-host > .libzen-pn-card .libzen-pn-card-header {
  background: transparent;
}

.libzen-pn-card-body-host > .libzen-pn-card .libzen-pn-card-header:hover {
  background: var(--libzen-surface-hover);
}

.libzen-pn-card-body-host > .libzen-pn-card .libzen-pn-card-body {
  background: transparent;
}

.libzen-pn-card-body-host > .libzen-pn-card:not(.libzen-pn-card-collapsed) > .libzen-pn-card-body {
  padding: 8px 12px;
}

.libzen-pn-card-body-host > .libzen-pn-card:last-child {
  margin-bottom: 0;
}

.libzen-pn-card-collapsed .libzen-pn-card-header {
  padding-top: 6px;
  padding-bottom: 6px;
}

.libzen-pn-checkbox-row input {
  cursor: pointer;
  accent-color: var(--libzen-accent);
}

.libzen-pn-collapse-chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid var(--libzen-text-muted);
  border-bottom: 2px solid var(--libzen-text-muted);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.15s ease;
}

.libzen-pn-collapse-chevron.libzen-pn-is-collapsed {
  transform: rotate(-45deg);
  margin-top: 0;
  margin-left: 1px;
}

.libzen-pn-card-header-trailing .libzen-pn-collapse-chevron {
  width: 10px;
  height: 10px;
  border-color: var(--libzen-text);
  opacity: 0.85;
}

.libzen-pn-card-oneline {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.libzen-pn-card-oneline-title {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 13px;
}

.libzen-pn-card-oneline-sep {
  flex-shrink: 0;
  color: var(--libzen-text-muted);
  font-size: 12px;
}

.libzen-pn-card-oneline-route {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--libzen-text-muted);
}

.libzen-pn-card-selected {
  border-color: var(--libzen-accent);
  box-shadow: 0 0 0 1px var(--libzen-accent);
}

/* —— Form helpers inside panel body —— */
.libzen-pn-field-label {
  display: block;
  font-size: 11px;
  color: var(--libzen-text-muted);
  margin-bottom: 4px;
}

.libzen-pn-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.libzen-pn-field-row input[type='text'] {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--libzen-border);
  border-radius: 6px;
  background: var(--libzen-bg);
  color: var(--libzen-text);
  font: inherit;
  box-sizing: border-box;
}

.libzen-pn-field-row input:focus {
  outline: none;
  border-color: var(--libzen-accent);
}

.libzen-pn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

.libzen-pn-btn-primary {
  width: 100%;
  background: var(--libzen-accent);
  color: #fff;
  margin-bottom: 12px;
}

.libzen-pn-btn-primary:hover {
  filter: brightness(1.08);
}

.libzen-pn-btn-icon {
  min-width: 36px;
  height: 34px;
  padding: 0;
  background: var(--libzen-surface);
  border: 1px solid var(--libzen-border);
  color: var(--libzen-text);
}

.libzen-pn-btn-icon:hover {
  background: var(--libzen-surface-hover);
}

/* —— Reorderable list rows —— */
.libzen-pn-list {
  display: flex;
  flex-direction: column;
  gap: var(--libzen-pn-list-gap);
}

.libzen-pn-list-dashed {
  border: 2px dashed var(--libzen-border);
  border-radius: 8px;
  padding: 8px;
}

.libzen-pn-list-empty {
  font-size: 12px;
  color: var(--libzen-text-muted);
  margin: 0;
  text-align: center;
}

.libzen-pn-list-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--libzen-surface);
  border: 1px solid var(--libzen-border);
  border-radius: 8px;
  padding: var(--libzen-pn-list-row-pad-y) var(--libzen-pn-list-row-pad-x);
}

.libzen-pn-list-row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.libzen-pn-list-row-label {
  font-weight: 500;
  font-size: 13px;
}

.libzen-pn-list-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.libzen-pn-list-row-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  opacity: 0.85;
}

.libzen-pn-list-row-actions button:hover {
  opacity: 1;
}

.libzen-pn-list-drop-before,
.libzen-pn-list-drop-after {
  border-color: var(--libzen-accent);
}

.libzen-pn-list-drop-before::before,
.libzen-pn-list-drop-after::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--libzen-accent);
  border-radius: 1px;
  pointer-events: none;
}

.libzen-pn-list-drop-before::before {
  top: -1px;
}

.libzen-pn-list-drop-after::after {
  bottom: -1px;
}

/* === DatePicker/date-picker.css === */
/**

 * LibZen DatePicker — Exam Planner calendar pattern for <input type="date">.

 */



@import url('../shared/datetime-field.css');



:root {

  --libzen-dp-panel: var(--libzen-dt-panel);

  --libzen-dp-text: var(--libzen-dt-text);

  --libzen-dp-muted: var(--libzen-dt-muted);

  --libzen-dp-border: var(--libzen-dt-border);

  --libzen-dp-accent: var(--libzen-dt-accent);

  --libzen-dp-accent-dim: var(--libzen-dt-accent-dim);

  --libzen-dp-hover: var(--libzen-dt-hover);

  --libzen-dp-radius: var(--libzen-dt-radius);

  --libzen-dp-focus-ring: var(--libzen-dt-focus-ring);

  --libzen-dp-icon-size: var(--libzen-dt-icon-size);

  --libzen-dp-icon-lead: calc(var(--libzen-dp-icon-size) + 0.5rem);

  --libzen-dp-calendar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238b9cb3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");

}



input[type="date"]::-webkit-calendar-picker-indicator {

  cursor: pointer;

  width: var(--libzen-dp-icon-size);

  height: var(--libzen-dp-icon-size);

  margin: 0;

  padding: 0;

  opacity: 1;

  -webkit-appearance: none;

  appearance: none;

  background: transparent var(--libzen-dp-calendar-icon) center / contain no-repeat;

  pointer-events: none;

}



input[type="date"]:hover::-webkit-calendar-picker-indicator,

input[type="date"]:focus-within::-webkit-calendar-picker-indicator {

  --libzen-dp-calendar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");

}



/* LibZen month-grid calendar popup. */

.libzen-dp-cal {

  position: fixed;

  z-index: 2147483000;

  width: 17.5rem;

  padding: 0.55rem;

  background: var(--libzen-dp-panel);

  border: 1px solid var(--libzen-dp-accent);

  border-radius: var(--libzen-dp-radius);

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);

  font-size: 0.85rem;

  color: var(--libzen-dp-text);

  user-select: none;

}



.libzen-dp-cal[hidden] {

  display: none;

}



.libzen-dp-cal-head {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 0.35rem;

  margin-bottom: 0.45rem;

}



.libzen-dp-cal-title {

  flex: 1;

  text-align: center;

  font-weight: 600;

  font-size: 0.92rem;

}



.libzen-dp-cal-nav {

  width: 1.75rem;

  height: 1.75rem;

  border: none;

  border-radius: var(--libzen-dp-radius);

  background: transparent;

  color: var(--libzen-dp-text);

  font-size: 1.1rem;

  line-height: 1;

  cursor: pointer;

}



.libzen-dp-cal-nav:hover {

  background: var(--libzen-dp-hover);

}



.libzen-dp-cal-nav:focus-visible {

  outline: var(--libzen-dp-focus-ring);

  outline-offset: 1px;

}



.libzen-dp-cal-weekdays {

  display: grid;

  grid-template-columns: repeat(7, 1fr);

  gap: 0.1rem;

  margin-bottom: 0.2rem;

  color: var(--libzen-dp-muted);

  font-size: 0.72rem;

  text-align: center;

}



.libzen-dp-cal-grid {

  display: grid;

  grid-template-columns: repeat(7, 1fr);

  gap: 0.1rem;

}



.libzen-dp-cal-day {

  aspect-ratio: 1;

  /* Reset a consuming app's global `button` padding/min-width so the 7 day
     columns stay at 1fr and line up under the weekday header. */

  padding: 0;

  min-width: 0;

  border: none;

  border-radius: var(--libzen-dp-radius);

  background: transparent;

  color: var(--libzen-dp-text);

  font: inherit;

  font-variant-numeric: tabular-nums;

  cursor: pointer;

}



.libzen-dp-cal-day:hover {

  background: var(--libzen-dp-hover);

}



.libzen-dp-cal-day.is-outside {

  color: var(--libzen-dp-muted);

  opacity: 0.55;

}



.libzen-dp-cal-day.is-today {

  border: 1px solid var(--libzen-dp-accent);

}



.libzen-dp-cal-day.is-selected {

  background: var(--libzen-dp-accent);

  color: #fff;

  font-weight: 600;

}



.libzen-dp-cal-day.is-selected:hover {

  background: var(--libzen-dp-accent-dim);

}



.libzen-dp-cal-day:focus-visible {

  outline: var(--libzen-dp-focus-ring);

  outline-offset: -1px;

}


