/* Dashboard — resizable sidebar, trees, timelines, time-box */

/* Ākāśa (Space) — 5th element: deep black cosmic container */
body.qb-akasha-space,
body.qb-page-dashboard.qb-akasha-space {
  background-color: #0a0a0f;
  background-image: radial-gradient(
    circle at 25% 40%,
    rgba(45, 0, 85, 0.15) 0%,
    transparent 50%
  );
  background-attachment: fixed;
}

body.qb-page-dashboard.qb-akasha-space {
  background-image:
    radial-gradient(circle at 25% 40%, rgba(45, 0, 85, 0.15) 0%, transparent 50%),
    none;
}

/* Legacy earth background when akasha class not set */
body.qb-page-dashboard:not(.qb-akasha-space) {
  background-color: var(--qb-bg);
  background-image: url("/static/images/earth5.webp");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  margin: 0;
  overflow-x: hidden;
}

body.qb-page-dashboard.qb-akasha-space {
  margin: 0;
  overflow-x: hidden;
}

body.qb-page-dashboard .qb-main {
  background: transparent;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 0 !important;
  max-width: 100%;
  overflow-x: hidden;
}

/* Dashboard wrapper — full viewport width, no card inset. */
body.qb-page-dashboard .qb-dash-shell,
body.qb-page-dashboard .dashboard-wrapper {
  background: rgba(15, 23, 42, 0.88);
  border: none;
  border-radius: 0;
  box-shadow: none;
}

body.qb-akasha-space .qb-dash-shell,
body.qb-akasha-space .dashboard-wrapper,
body.qb-akasha-space .main-content,
body.qb-akasha-space .qb-location-page-main {
  background: transparent;
}

body.qb-akasha-space .card,
body.qb-akasha-space .varna-profile-card,
body.qb-akasha-space .leadership-section,
body.qb-akasha-space .collective-board,
body.qb-akasha-space .qb-panel,
body.qb-akasha-space .qb-hero {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(2px);
  border: 1px solid #2d2d44;
}

@media (max-width: 768px) {
  body.qb-page-dashboard {
    background-attachment: scroll;
  }
}

/* ── High-contrast text & action buttons ── */
.qb-dash-shell,
.qb-dash-shell .qb-panel,
.qb-dash-shell .qb-public-timeline,
.qb-dash-shell .qb-global-timeline {
  color: var(--qb-text);
}

.qb-dash-shell .small,
.qb-dash-shell p,
.qb-dash-shell li,
.qb-dash-shell label,
.qb-dash-shell .form-label {
  color: var(--qb-text);
}

.qb-dash-shell .text-muted,
.qb-dash-shell .qb-explorer-footer,
.qb-dash-shell .qb-post-status,
.qb-dash-shell .qb-election-manifest,
.qb-dash-shell #qb-election-next-phase,
.qb-dash-shell #qb-election-phase-window,
.qb-dash-shell #qb-election-ineligible {
  color: var(--qb-muted) !important;
}

.qb-dash-shell .text-secondary,
.qb-dash-shell h3.text-secondary,
.qb-dash-shell h4.text-secondary,
.qb-dash-shell h6.text-secondary {
  color: var(--qb-subtle) !important;
}

.qb-dash-shell .qb-election-status-line,
.qb-dash-shell .qb-election-status-line strong,
.qb-dash-shell #qb-election-king-line,
.qb-dash-shell #qb-election-council-upcoming,
.qb-dash-shell .qb-users-in-scope,
.qb-dash-shell .qb-post-history-row,
.qb-dash-shell .qb-connection-row,
.qb-dash-shell .qb-timeline-user-identity {
  color: var(--qb-text) !important;
}

.qb-dash-shell .qb-election-status-line strong {
  color: var(--qb-topbar-accent) !important;
  font-weight: 700;
}

.qb-dash-shell .table,
.qb-dash-shell .table td,
.qb-dash-shell .table th {
  color: var(--qb-text) !important;
}

.qb-dash-shell .qb-btn-danger {
  background: var(--qb-danger);
  color: #ffffff;
  border: 1px solid #dc2626;
}

.qb-dash-shell .qb-btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

body.qb-page-dashboard header.qb-navbar {
  padding: 0.45rem clamp(0.75rem, 3vw, 1.25rem);
  min-height: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.qb-dash-header-inner {
  align-items: center;
  min-height: 0;
}

.qb-dash-header-actions {
  align-items: center;
  gap: 0.35rem;
  max-width: min(100%, 42rem);
  flex-wrap: wrap;
}

.qb-dash-header-actions .qb-timebox {
  flex-shrink: 1;
  min-width: 0;
}

.qb-notification-wrap {
  position: relative;
}

.qb-cal-nav-btn,
.qb-timebox-cal-link {
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.qb-timebox-cal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--qb-topbar-accent);
  background: var(--qb-primary);
  color: #000000;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.qb-timebox-cal-link:hover {
  background: var(--qb-primary-hover);
  color: #000000;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3);
}

.qb-notification-btn {
  position: relative;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid #444444;
  border-radius: 999px;
  background: #222222;
  color: #ffffff;
  cursor: pointer;
}

.qb-notification-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.25rem;
  padding: 0.05rem 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15rem;
}

.qb-notification-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 1070;
  width: min(22rem, 90vw);
  padding: 0.75rem;
  border: 1px solid var(--qb-border);
  border-radius: 12px;
  background: var(--qb-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.qb-notification-title {
  margin-bottom: 0.5rem;
  color: var(--qb-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.qb-notification-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--qb-border);
}

.qb-notification-item:last-child {
  border-bottom: 0;
}

.qb-notification-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

/* Full-bleed dashboard wrapper — spans the full viewport width edge-to-edge. */
.qb-dash-shell,
.dashboard-wrapper {
  padding: 0 0 2rem;
  max-width: 100%;
  width: 100%;
  margin: 0;
  overflow-x: hidden;
}

.qb-dash-split {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 0.75rem;
}

.qb-dash-sidebar-rail {
  flex: 0 0 var(--qb-sidebar-width, 24%);
  min-width: 200px;
  max-width: 50vw;
  position: relative;
}

.qb-dash-sidebar {
  position: sticky;
  top: 5.5rem;
  background: var(--qb-surface-tint);
  border: 1px solid var(--qb-border);
  border-radius: 12px;
  padding: 0.65rem;
  height: 100%;
  min-height: 12rem;
}

.qb-dash-resizer {
  flex: 0 0 6px;
  margin: 0 2px;
  cursor: col-resize;
  align-self: stretch;
  border-radius: 4px;
  background: rgba(45, 58, 77, 0.35);
  transition: background 0.15s ease;
}

.qb-dash-resizer:hover,
.qb-dash-resizer.is-dragging {
  background: rgba(59, 130, 246, 0.45);
}

.qb-dash-resizer:focus-visible {
  outline: 2px solid var(--qb-accent);
  outline-offset: 2px;
}

.qb-dash-content {
  flex: 1 1 auto;
  min-width: 0;
}

.qb-dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.qb-dash-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.qb-dash-nav-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

.qb-dash-nav-btn.is-active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--qb-primary);
}

.qb-dash-panel[hidden] {
  display: none !important;
}

/* Time box — dark, matches top bar */
.qb-timebox {
  background: #000000;
  border: 1px solid #444444;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  max-width: 28rem;
  color: #ffffff;
}

.qb-timebox-main-text {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.qb-timebox-chev {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--qb-topbar-accent, #ffd700);
  border-radius: 6px;
  width: 1.65rem;
  height: 1.65rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.qb-timebox-chev:hover {
  background: rgba(255, 215, 0, 0.18);
}

.qb-timebox-extra {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--qb-border);
  overflow: hidden;
  transition:
    opacity 0.2s ease,
    max-height 0.25s ease;
}

.qb-timebox-extra[hidden] {
  display: none;
}

.qb-timebox-extra-line {
  font-family: "Noto Sans Devanagari", "DM Sans", system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0 0 0.35rem;
  color: #ffffff;
}

.qb-timebox-extra-line--vs {
  opacity: 0.92;
  font-size: 0.78rem;
}

.qb-segmented {
  display: inline-flex;
  border: 1px solid var(--qb-topbar-accent);
  border-radius: 8px;
  overflow: hidden;
}

.qb-segmented-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  cursor: pointer;
}

.qb-segmented-btn.is-active {
  background: rgba(255, 215, 0, 0.18);
  color: var(--qb-topbar-accent);
  border: 1px solid var(--qb-topbar-accent);
  font-weight: 600;
}

.qb-timebox-cal-label {
  font-size: 0.68rem !important;
}

/* Public / global timeline panels */
.qb-public-timeline,
.qb-global-timeline {
  width: 100%;
  background: var(--qb-surface);
  border: 1px solid var(--qb-border);
  border-radius: 14px;
  padding: clamp(0.8rem, 2.5vw, 1.25rem);
  margin-top: 0.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.qb-public-head {
  margin-bottom: 0.75rem;
}

.qb-public-title {
  margin: 0 0 0.25rem;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
}

.qb-public-sub {
  max-width: 42rem;
}

.qb-location-tabs,
.location-tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  margin: 0 0 0.5rem;
  background: var(--qb-bg, #0f172a);
  border-radius: 12px;
}

.location-tabs-row {
  margin-top: 0;
}

.no-gap {
  margin: 0;
  padding-top: 0;
}

.location-main-content {
  margin-top: 0;
}

.qb-location-tab,
.location-tab {
  flex: 1 1 0;
  min-width: 4.5rem;
  text-align: center;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  background: var(--qb-surface, #1e293b);
  color: var(--qb-muted, #94a3b8);
  border: 1px solid var(--qb-border, #334155);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 4.25rem;
}

/* Stacked layout: icon on top, then level, then name */
.qb-location-tab-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.5px;
  color: var(--qb-muted, #94a3b8);
  text-transform: uppercase;
}

.qb-location-tab-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--qb-text, #f1f5f9);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-word;
}

.qb-location-tab.is-active .qb-location-tab-label,
.qb-location-tab.active .qb-location-tab-label,
.location-tab.is-active .qb-location-tab-label,
.location-tab.active .qb-location-tab-label {
  color: #000000;
}

.qb-location-tab.is-active .qb-location-tab-name,
.qb-location-tab.active .qb-location-tab-name,
.location-tab.is-active .qb-location-tab-name,
.location-tab.active .qb-location-tab-name {
  color: #000000;
  font-weight: 700;
}

.qb-location-tab-scope {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--qb-muted);
}

.qb-location-tab.is-active,
.qb-location-tab.active,
.location-tab.is-active,
.location-tab.active {
  background: var(--qb-primary, #ff9933);
  color: #000000;
  border-color: var(--qb-primary, #ff9933);
  box-shadow: 0 4px 12px rgba(255, 153, 51, 0.3);
}

.qb-location-tab:hover:not(.is-active):not(.active),
.location-tab:hover:not(.is-active):not(.active) {
  background: var(--qb-border, #334155);
  color: var(--qb-text, #f1f5f9);
  transform: translateY(-2px);
}

.qb-location-tab[data-level="state"]::before,
.location-tab[data-level="state"]::before,
.qb-location-tab[data-level="district"]::before,
.location-tab[data-level="district"]::before,
.qb-location-tab[data-level="tehsil"]::before,
.location-tab[data-level="tehsil"]::before,
.qb-location-tab[data-level="village"]::before,
.location-tab[data-level="village"]::before,
.qb-location-tab[data-level="earth"]::before,
.location-tab[data-level="earth"]::before,
.qb-location-tab[data-level="continent"]::before,
.location-tab[data-level="continent"]::before,
.qb-location-tab[data-level="country"]::before,
.location-tab[data-level="country"]::before,
.qb-location-tab[data-level="zone"]::before,
.location-tab[data-level="zone"]::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.qb-location-tab[data-level="state"]::before,
.location-tab[data-level="state"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'/%3E%3C/svg%3E");
}

.qb-location-tab[data-level="district"]::before,
.location-tab[data-level="district"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4'/%3E%3C/svg%3E");
}

.qb-location-tab[data-level="tehsil"]::before,
.location-tab[data-level="tehsil"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 11a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3C/svg%3E");
}

.qb-location-tab[data-level="village"]::before,
.location-tab[data-level="village"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'/%3E%3C/svg%3E");
}

.qb-location-tab[data-level="earth"]::before,
.location-tab[data-level="earth"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.qb-location-tab[data-level="continent"]::before,
.location-tab[data-level="continent"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4'/%3E%3C/svg%3E");
}

.qb-location-tab[data-level="country"]::before,
.location-tab[data-level="country"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 21h18M5 21V7a2 2 0 012-2h10a2 2 0 012 2v14m-9-9h.01M9 15h.01M12 12h.01M12 15h.01M15 12h.01M15 15h.01'/%3E%3C/svg%3E");
}

.qb-location-tab[data-level="zone"]::before,
.location-tab[data-level="zone"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7'/%3E%3C/svg%3E");
}

.qb-no-planets {
  opacity: 0.5;
  font-size: 10px;
}

.qb-location-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.qb-dash-inline-stats {
  margin-bottom: 0.85rem;
}

.qb-users-in-scope {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.qb-mini-table-wrap {
  font-size: 0.88rem;
}

.qb-public-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.qb-public-main-stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 30%);
  gap: 0.9rem;
  align-items: start;
}

.qb-new-post-btn[hidden] {
  display: none !important;
}

.qb-personal-board {
  min-height: 28rem;
}

.qb-personal-main-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  margin-bottom: 0.75rem;
}

.qb-personal-main-tab {
  width: 100%;
  border: 1px solid var(--qb-border);
  border-radius: 8px;
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
  padding: 0.45rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  white-space: normal;
  hyphens: auto;
}

.qb-personal-main-tab.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.18);
  color: var(--qb-accent);
}

@media (min-width: 520px) {
  .qb-personal-main-tab {
    font-size: 0.78rem;
    padding: 0.5rem 0.4rem;
  }
}

.qb-personal-tab-panel[hidden] {
  display: none !important;
}

.qb-personal-board-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.qb-personal-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.qb-personal-board-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.qb-personal-back-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.qb-personal-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  min-width: 9.5rem;
}

.qb-personal-actions .qb-btn {
  justify-content: center;
  text-align: center;
}

.qb-personal-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.qb-personal-section {
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--qb-surface);
  color: var(--qb-text);
}

.qb-personal-section--wide {
  grid-column: 1 / -1;
}

.qb-personal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.qb-connection-row,
.qb-post-history-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.qb-connection-row:last-child,
.qb-post-history-row:last-child {
  border-bottom: 0;
}

.qb-request-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.qb-connection-search-row {
  display: flex;
  gap: 0.5rem;
}

.qb-connection-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qb-connection-suggestion {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  padding: 0.65rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.06);
  color: var(--qb-text);
  text-align: left;
  cursor: pointer;
}

.qb-connection-suggestion:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.qb-connection-selected {
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 10px;
  padding: 0.6rem;
  background: rgba(59, 130, 246, 0.06);
}

.qb-family-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.qb-family-tab-head .qb-btn {
  flex-shrink: 0;
}

.qb-family-tree-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.family-tree-container {
  position: relative;
  max-height: min(70vh, 640px);
  overflow: auto;
}

.family-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-start;
  padding: 0.35rem 0;
}

.family-buttons.qb-family-actions-row {
  justify-content: flex-start;
}

.qb-family-id-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.qb-family-id-search-row .form-control {
  flex: 1 1 12rem;
  min-width: 8rem;
}

.qb-family-tree-popover {
  position: absolute;
  z-index: 40;
  min-width: 200px;
  max-width: 280px;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.qb-family-tree-popover-actions .qb-btn {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.qb-family-graph-node-box.is-placeholder {
  stroke-dasharray: 4 3;
  fill: rgba(30, 41, 59, 0.55);
}

.qb-family-tree-toolbar {
  display: flex;
  align-items: center;
}

.qb-family-graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.qb-family-graph-wrap {
  border: 1px solid rgba(141, 156, 179, 0.22);
  border-radius: 12px;
  background: var(--qb-surface-elevated);
  overflow: auto;
}

.qb-family-graph {
  min-height: 420px;
}

.qb-family-graph-svg {
  display: block;
  width: 100%;
  height: auto;
}

.qb-family-graph-link {
  stroke: rgba(148, 163, 184, 0.55);
  stroke-width: 1.5;
}

.qb-family-graph-node-box {
  fill: rgba(30, 41, 59, 0.95);
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 1;
}

.qb-family-graph-node-box.is-self {
  stroke: rgba(59, 130, 246, 0.75);
}

.qb-family-graph-node-box.is-dead {
  opacity: 0.55;
  fill: rgba(71, 85, 105, 0.85);
}

.qb-family-graph-node-name {
  fill: var(--qb-text);
  font-size: 12px;
  font-weight: 600;
}

.qb-family-graph-node-sub {
  fill: var(--qb-muted);
  font-size: 10px;
}

.qb-family-graph-action {
  fill: rgba(59, 130, 246, 0.95);
  font-size: 11px;
}

.qb-family-graph-dead-icon {
  fill: var(--qb-muted);
  font-size: 11px;
}

.qb-family-options-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--qb-border);
  border-radius: 8px;
  background: var(--qb-surface-elevated);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--qb-text);
}

.qb-family-options-details > summary::-webkit-details-marker {
  display: none;
}

.qb-family-options-details[open] > summary {
  border-color: rgba(59, 130, 246, 0.45);
}

.qb-family-options-menu {
  margin-top: 0.35rem;
  padding: 0.45rem;
  border: 1px solid rgba(141, 156, 179, 0.25);
  border-radius: 10px;
  background: rgba(12, 16, 20, 0.96);
}

.qb-family-all-members-scroll {
  max-height: min(60vh, 28rem);
  overflow: auto;
  padding-right: 0.25rem;
  margin-bottom: 0.35rem;
}

.qb-family-tree {
  display: grid;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.85rem;
  border: 1px solid rgba(141, 156, 179, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.12)) center 45% / 80% 1px no-repeat,
    var(--qb-surface-elevated);
}

.qb-family-tree-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  min-width: 620px;
  flex-wrap: wrap;
}

.qb-family-tree-row--center {
  align-items: center;
}

.qb-family-node {
  position: relative;
  min-width: 9rem;
  max-width: 12.5rem;
  padding: 0.55rem;
  border: 1px dashed rgba(141, 156, 179, 0.45);
  border-radius: 10px;
  background: var(--qb-surface);
  color: var(--qb-text);
  text-align: center;
  font-size: 0.76rem;
}

.qb-family-node .qb-family-name-wrap {
  display: block;
  margin-top: 0.25rem;
  color: var(--qb-text);
}

.qb-family-name {
  display: inline-block;
  font-weight: 600;
  color: var(--qb-text);
}

.qb-family-empty-slot {
  color: var(--qb-muted);
  font-style: italic;
}

.qb-family-node--empty-action {
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(59, 130, 246, 0.35);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.qb-family-node--empty-action:hover,
.qb-family-node--empty-action:focus {
  outline: 0;
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.1);
  color: var(--qb-accent);
}

.qb-family-node--empty-action .qb-family-empty-slot {
  color: var(--qb-accent);
  font-style: normal;
}

.qb-family-node.is-filled {
  border-style: solid;
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.08);
  padding-right: 0.65rem;
}

.qb-family-node--self {
  border-style: solid;
  border-color: rgba(59, 130, 246, 0.7);
  color: var(--qb-accent);
}

.qb-family-node.is-deceased {
  opacity: 0.7;
}

.qb-family-node.is-deceased .qb-family-name {
  text-decoration: none;
  color: var(--qb-muted);
  font-style: italic;
}

.qb-family-dead-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.32);
  color: #e0d6d6;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qb-family-linked-parents {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  line-height: 1.25;
}

.qb-family-name-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  max-width: 100%;
}

.qb-family-node-edit {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid rgba(141, 156, 179, 0.35);
  border-radius: 6px;
  background: var(--qb-surface);
  color: var(--qb-text);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.qb-family-node-edit:hover {
  border-color: rgba(59, 130, 246, 0.55);
  color: var(--qb-accent);
}

.qb-family-empty-slot-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.qb-family-slot-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0;
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 6px;
  background: var(--qb-surface);
  color: var(--qb-accent);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.qb-family-slot-add:hover {
  border-color: rgba(59, 130, 246, 0.85);
  background: rgba(59, 130, 246, 0.12);
}

.qb-family-natural-edit-form .qb-family-natural-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  line-height: 1.5;
}

.qb-family-natural-select {
  min-width: 8.5rem;
  max-width: 14rem;
  vertical-align: middle;
}

.qb-family-natural-quote {
  color: var(--qb-muted);
}

.qb-family-node-kebab {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid rgba(141, 156, 179, 0.35);
  border-radius: 6px;
  background: var(--qb-surface);
  color: var(--qb-text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.qb-family-node-kebab:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.qb-family-node-menu {
  position: absolute;
  right: 0.25rem;
  top: 2rem;
  z-index: 15;
  min-width: 6.5rem;
  padding: 0.25rem;
  border: 1px solid var(--qb-border);
  border-radius: 8px;
  background: rgba(12, 16, 20, 0.98);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  text-align: left;
}

.qb-family-node-menu-item {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--qb-text);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.qb-family-node-menu-item:hover {
  background: rgba(59, 130, 246, 0.12);
}

.qb-family-node-actions {
  margin-top: 0.45rem;
}

.qb-family-node-actions .qb-btn {
  font-size: 0.7rem;
  padding: 0.18rem 0.45rem;
}

/* Family form */
.qb-family-form-wrap {
  margin-top: 0.5rem;
  padding: 0.85rem;
  border: 1px solid rgba(141, 156, 179, 0.22);
  border-radius: 12px;
  background: var(--qb-surface-elevated);
}

.qb-family-form-wrap[hidden] {
  display: none !important;
}

.qb-family-content[hidden] {
  display: none !important;
}

.qb-family-actions {
  align-items: center;
}

.qb-family-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.35rem;
  color: var(--qb-text);
}

.qb-family-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
}

.qb-family-fieldset {
  border: 1px solid rgba(141, 156, 179, 0.18);
  border-radius: 10px;
  padding: 0.65rem;
  background: var(--qb-surface-elevated);
}

.qb-family-fieldset legend {
  width: 100%;
  margin: 0 0 0.35rem;
  padding: 0;
  color: var(--qb-accent);
}

.qb-family-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.qb-family-grid-three {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 0.5rem;
}

.qb-family-dynamic-row {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.7fr 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.qb-family-dynamic-row:first-child {
  border-top: 0;
}

.qb-family-dynamic-block {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.65rem;
  background: rgba(255, 255, 255, 0.02);
}

.qb-family-dynamic-block .qb-family-dynamic-row {
  border-top: 0;
  padding: 0;
}

.qb-family-subrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.4rem;
}

.qb-family-subrow .form-control,
.qb-family-subrow .form-select {
  flex: 1 1 8rem;
  min-width: 7rem;
}

.qb-family-subgroup {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.qb-family-grandchildren {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.qb-family-grandchild-row {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.7fr 1fr auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.3rem 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.qb-family-grandchild-row:first-child {
  border-top: 0;
}

.qb-family-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--qb-text);
}

.qb-family-form-actions {
  margin-top: 0.4rem;
}

/* All-family-members panel */
.qb-family-all-panel {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  background: var(--qb-surface-elevated);
}

.qb-family-all-panel[hidden] {
  display: none !important;
}

.qb-family-all-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--qb-text);
}

.qb-family-all-row:last-child {
  border-bottom: 0;
}

.qb-family-all-row.is-deceased .qb-family-all-main strong {
  text-decoration: none;
  color: var(--qb-muted);
  font-style: italic;
}

.qb-family-all-row.is-deceased {
  opacity: 0.75;
}

.qb-family-all-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.qb-rel-tag {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--qb-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.qb-rel-tag--muted {
  background: rgba(148, 163, 184, 0.18);
  color: var(--qb-muted);
}

.qb-rel-tag--pending {
  background: rgba(234, 179, 8, 0.18);
  color: #f7b955;
}

/* Per-post delete affordance (author within 24h, admin anytime). */
.qb-post-delete-btn {
  margin-left: 0.5rem;
  padding: 0.05rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: transparent;
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.qb-post-delete-btn:hover {
  background: rgba(248, 113, 113, 0.16);
}

.qb-post-delete-btn--admin {
  border-color: rgba(248, 113, 113, 0.7);
  background: rgba(248, 113, 113, 0.08);
}

.qb-btn-danger {
  background: #b91c1c;
  color: #fafafa;
  border: 1px solid #b91c1c;
}

.qb-btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Admin-only chrome (the family removal queue button, etc.) */
.qb-admin-only-btn {
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

.qb-admin-only-btn:hover {
  background: rgba(248, 113, 113, 0.12);
}

/* Notifications dropdown — message items differ slightly from request items. */
.qb-notification-item--message {
  border-left: 3px solid rgba(59, 130, 246, 0.5);
}

.qb-notification-item--system {
  border-left-color: rgba(234, 179, 8, 0.65);
}

.qb-notification-msg-preview {
  margin-top: 0.25rem;
  color: var(--qb-muted);
  line-height: 1.3;
  white-space: pre-wrap;
}

/* Admin removal queue */
.qb-modal-dialog--wide {
  width: min(100%, 48rem);
}

.qb-admin-removal-list {
  max-height: 28rem;
  overflow-y: auto;
}

.qb-admin-removal-item {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.qb-admin-removal-item:last-child {
  border-bottom: 0;
}

.qb-admin-removal-main {
  flex: 1 1 auto;
}

.qb-admin-removal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 12rem;
}

.qb-connection-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 12rem;
  overflow-y: auto;
}

.qb-connection-row-actions {
  display: flex;
  gap: 0.4rem;
}

/* Bulk mark-deceased modal list */
.qb-mark-deceased-list {
  max-height: 22rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
}

.qb-mark-deceased-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.qb-mark-deceased-item:last-child {
  border-bottom: 0;
}

.qb-mark-deceased-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.25rem;
  cursor: pointer;
  color: var(--qb-text);
}

.qb-mark-deceased-row:hover {
  background: rgba(59, 130, 246, 0.06);
  border-radius: 6px;
}

.qb-mark-deceased-name {
  flex: 1 1 auto;
  font-size: 0.85rem;
}

/* Connection send button disabled state (when status is pending / accepted) */
#qb-connection-send-btn.is-disabled,
#qb-connection-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* Suggestion items that should look unavailable (used when status check
   resolves to pending/accepted and we disable the Send button). */
.qb-connection-suggestion.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.qb-public-feed-col {
  min-width: 0;
}

.qb-public-stats-col {
  min-width: 0;
}

.qb-public-stats-panel {
  background: var(--qb-surface) !important;
  border: 1px solid var(--qb-border) !important;
  opacity: 1;
}

.qb-public-stats-panel .qb-users-in-scope {
  color: var(--qb-text) !important;
}

.qb-public-stats-panel h4 {
  font-size: 0.68rem !important;
  letter-spacing: 0.04em;
  color: var(--qb-subtle) !important;
  opacity: 1;
}

.qb-public-stats-panel .qb-mini-table-wrap {
  font-size: 0.78rem;
  opacity: 1;
  color: var(--qb-text);
}

.qb-public-stats-panel .table {
  color: var(--qb-text) !important;
}

.qb-public-feed-panel .qb-panel-title {
  font-size: 0.95rem;
}

.qb-collective-board {
  overflow: hidden;
}

.qb-board-head {
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Full collective board names — centered, no short forms */
.qb-board-title,
.collective-board-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--qb-topbar-accent, #ffd700);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--qb-border, #334155);
}

.qb-board-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 999px;
  background: rgba(10, 15, 22, 0.42);
}

.qb-board-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: transparent;
  color: var(--qb-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.qb-board-tab.is-active {
  background: var(--qb-primary-dim);
  color: var(--qb-topbar-accent);
}

.qb-post-panel {
  padding: 0.75rem;
  margin-bottom: 0.9rem;
  color: var(--qb-text);
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  background: var(--qb-surface-elevated);
}

.qb-post-panel[hidden] {
  display: none !important;
}

.qb-post-form-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.qb-board-post {
  margin-bottom: 0.8rem;
}

.qb-board-post-card {
  padding: 0.8rem;
  border: 1px solid rgba(141, 156, 179, 0.25);
  border-radius: 12px;
  background: var(--qb-surface-elevated);
}

.qb-board-post-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
}

.qb-board-author {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--qb-text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.45);
  text-underline-offset: 0.18rem;
  cursor: pointer;
}

.qb-board-author:hover {
  color: var(--qb-accent);
}

.qb-board-post-time {
  color: var(--qb-muted);
  font-size: 0.78rem;
  text-align: right;
}

.qb-board-post-content {
  margin: 0 0 0.75rem;
  white-space: pre-wrap;
  line-height: 1.45;
}

.qb-board-progress {
  margin: 0.7rem 0;
}

.qb-board-progress-meta,
.qb-board-progress-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  color: var(--qb-muted);
  font-size: 0.74rem;
}

.qb-board-progress-track {
  position: relative;
  height: 0.55rem;
  margin: 0.35rem 0;
  overflow: visible;
  border-radius: 999px;
  background: rgba(141, 156, 179, 0.22);
}

.qb-board-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.45), rgba(14, 165, 233, 0.85));
}

.qb-board-progress-needle {
  position: absolute;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--qb-accent);
  border-radius: 999px;
  background: #5eead4;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.qb-board-vote-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.qb-board-vote-row .btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.qb-board-vote-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: var(--qb-muted);
  font-size: 0.78rem;
}

.qb-board-vote-note {
  color: var(--qb-muted);
  font-size: 0.78rem;
}

.qb-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.68);
}

.qb-modal-backdrop[hidden] {
  display: none !important;
}

.qb-modal-dialog {
  width: min(100%, 34rem);
  max-height: min(90vh, 44rem);
  overflow: auto;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 14px;
  background: var(--qb-surface);
  color: var(--qb-text);
  padding: 1rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.qb-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.qb-modal-close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--qb-border);
  border-radius: 999px;
  background: var(--qb-surface);
  color: var(--qb-text);
  line-height: 1;
  cursor: pointer;
}

.qb-modal-dialog textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--qb-border);
  background: var(--qb-surface);
  color: var(--qb-text);
  resize: vertical;
  padding: 0.7rem;
}

.qb-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.qb-author-modal-details {
  border: 1px solid rgba(141, 156, 179, 0.18);
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.qb-panel {
  background: var(--qb-surface-elevated);
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  padding: 0.8rem;
}

.qb-panel-title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.qb-post-form textarea {
  width: 100%;
  min-height: 8rem;
  border-radius: 8px;
  border: 1px solid var(--qb-border);
  background: rgba(10, 15, 22, 0.6);
  color: var(--qb-text);
  resize: vertical;
  padding: 0.7rem;
}

.qb-post-actions {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.qb-post-status {
  color: var(--qb-muted);
  font-size: 0.82rem;
}

.qb-view-stats-link {
  font-size: 0.9rem;
}

/* Location explorer */
.qb-loc-explorer {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--qb-border);
}

.qb-loc-explorer-head {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--qb-muted);
  margin-bottom: 0.45rem;
}

.qb-tree-scroll {
  max-height: min(55vh, 28rem);
  overflow: auto;
  padding-right: 0.15rem;
}

/* Tree with connector lines */
.qb-tree {
  --tree-line: rgba(141, 156, 179, 0.35);
  --tree-indent: 1rem;
  font-size: 0.84rem;
}

.qb-tree-node {
  position: relative;
  margin: 0;
  padding-left: 0.15rem;
}

.qb-tree-children {
  margin: 0;
  padding-left: var(--tree-indent);
  border-left: 1px solid var(--tree-line);
}

.qb-tree-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  min-height: 1.75rem;
}

.qb-tree-row::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--tree-indent));
  top: 50%;
  width: calc(var(--tree-indent) - 0.35rem);
  height: 1px;
  background: var(--tree-line);
  pointer-events: none;
}

.qb-tree-root > .qb-tree-node > .qb-tree-row::before {
  display: none;
}

.qb-tree-chev {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--qb-accent);
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
}

.qb-tree-label {
  flex: 1 1 auto;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--qb-text);
  font-size: 0.82rem;
  padding: 0.22rem 0.4rem;
  cursor: pointer;
}

.qb-tree-label:hover {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.06);
}

.qb-tree-label.is-selected {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.12);
}

.qb-explorer-stats-link[hidden] {
  display: none !important;
}

/* Messaging */
.qb-msg-tabs .qb-msg-tab {
  border: 1px solid var(--qb-border);
  border-radius: 8px;
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
}

.qb-msg-tabs .qb-msg-tab.is-active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--qb-primary);
}

.qb-msg-view-body {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .qb-dash-split {
    flex-direction: column;
  }

  .qb-dash-sidebar-rail {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
  }

  .qb-dash-resizer {
    display: none;
  }

  .qb-dash-sidebar {
    position: relative;
    top: auto;
  }

  .qb-dash-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .qb-dash-nav-btn {
    flex: 1 1 calc(50% - 0.35rem);
  }
}

@media (max-width: 820px) {
  .qb-location-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qb-public-grid {
    grid-template-columns: 1fr;
  }

  .qb-public-main-stats-grid {
    grid-template-columns: 1fr;
  }
}

.qb-family-edit-tree-body {
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--qb-border);
  border-radius: 6px;
  padding: 0.5rem;
}

.qb-family-edit-tree-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1.1fr) repeat(4, minmax(5.5rem, 1fr));
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.qb-family-tree-row--manual-extra {
  margin-top: 0.35rem;
}

.qb-family-initial-setup-wrap {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  background: var(--qb-surface-elevated);
}

.qb-family-radio-row--wrap {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.qb-family-all-actions--icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.qb-family-icon-btn {
  min-width: 2rem;
  padding: 0.15rem 0.45rem;
  line-height: 1.2;
}

.qb-private-collapse > summary {
  cursor: pointer;
  list-style: none;
}

.qb-private-collapse > summary::-webkit-details-marker {
  display: none;
}

.qb-private-collapse-summary {
  user-select: none;
}

.qb-private-extra-form .form-label {
  margin-bottom: 0.15rem;
}

.qb-notification-item--link {
  border-left: 3px solid rgba(56, 189, 248, 0.55);
  padding-left: 0.45rem;
}

/* Quantum Punch leadership council */
.qb-leadership-council {
  border-color: rgba(56, 189, 248, 0.35);
  background: var(--qb-surface);
}

.qb-leadership-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qb-leadership-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--qb-border);
  border-radius: 8px;
  background: var(--qb-surface-elevated);
}

.qb-leadership-slot-title {
  flex: 1 1 100%;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--qb-subtle);
}

.qb-leadership-slot-holder {
  font-weight: 600;
  color: var(--qb-text);
}

.qb-leadership-slot-holder.is-admin {
  color: var(--qb-topbar-accent);
}

.qb-leadership-slot--loading .qb-leadership-slot-holder {
  font-weight: 400;
  color: var(--qb-muted);
}

.qb-public-action-btns .qb-btn {
  width: 100%;
}

.qb-language-dropdown-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  min-width: 0;
}

.qb-language-dropdown {
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
  border-color: var(--qb-border);
  font-size: 0.72rem;
  padding: 0.12rem 0.35rem;
  height: 1.75rem;
  line-height: 1.15;
  max-width: 7.25rem;
  min-height: 0;
}

.qb-mother-tongue-section .form-select {
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
  border-color: var(--qb-border);
}

/* Quantum Punch elections */
.qb-election-panel {
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--qb-surface);
  color: var(--qb-text);
}

.qb-election-status-line {
  color: var(--qb-text);
}

.qb-election-status-line strong {
  color: var(--qb-topbar-accent);
  font-weight: 700;
}

.qb-election-candidate-list {
  margin: 0;
  padding: 0;
}

.qb-election-cand {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
}

.qb-election-cand-label {
  display: block;
  margin: 0;
  cursor: pointer;
  color: var(--qb-text);
}

.qb-election-cand-name {
  display: inline-block;
  margin-left: 0.35rem;
  font-weight: 600;
  color: var(--qb-text);
}

.qb-election-manifest {
  margin-top: 0.45rem;
  margin-left: 1.35rem;
  line-height: 1.4;
  white-space: pre-wrap;
  color: var(--qb-muted);
}

.qb-election-council-card {
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--qb-surface);
  color: var(--qb-text);
}

.qb-election-council-card h4 {
  color: var(--qb-subtle) !important;
}

.qb-election-council-zodiac {
  max-height: min(36vh, 14rem);
  overflow: auto;
  padding-right: 0.25rem;
}

.qb-election-council-zodiac-item + .qb-election-council-zodiac-item {
  margin-top: 0.35rem;
}

.qb-election-council-row {
  display: grid;
  grid-template-columns: minmax(5rem, 0.9fr) 1fr 1fr;
  gap: 0.35rem 0.5rem;
  align-items: start;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(12, 16, 20, 0.45);
  font-size: 0.82rem;
}

.qb-election-council-row.is-active-zodiac {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.08);
}

.qb-election-candidate-profiles {
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
}

.qb-private-election-village {
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  background: var(--qb-surface-elevated) !important;
  color: var(--qb-text);
}

.qb-private-manage-elections .qb-btn + .qb-btn {
  margin-left: 0;
}

.qb-election-council-pair {
  display: block;
  line-height: 1.35;
}

.qb-timeline-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.qb-timeline-head-main {
  flex: 1 1 14rem;
  min-width: 0;
}

.qb-timeline-user-identity {
  flex: 0 1 auto;
  white-space: nowrap;
  color: var(--qb-text);
}

.qb-private-msg-wrap {
  position: relative;
}

.qb-karma-wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--qb-border);
  border-radius: 999px;
  background: var(--qb-surface);
  color: var(--qb-text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.qb-karma-wallet-btn:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
}

.qb-karma-wallet-symbol {
  font-size: 1.05rem;
  line-height: 1;
  color: #fbbf24;
}

.qb-karma-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.qb-karma-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.qb-stmt-week-list .qb-btn {
  font-size: 0.72rem;
}

.qb-stmt-iframe {
  width: 100%;
  min-height: 22rem;
  border: 1px solid var(--qb-border);
  border-radius: 8px;
  background: var(--qb-surface);
}

.qb-stmt-detail-panel {
  min-height: 22rem;
}

.qb-statement-report {
  font-family: system-ui, sans-serif;
  padding: 1.5rem;
  color: #e2e8f0;
  background: #0f172a;
}

.qb-statement-report .qb-stmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.qb-statement-report .qb-stmt-table th,
.qb-statement-report .qb-stmt-table td {
  border: 1px solid #334155;
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.qb-stmt-warn {
  color: #f87171;
  font-weight: 600;
}

.qb-stmt-muted {
  color: var(--qb-muted);
  font-size: 0.8rem;
}

.qb-commerce-tab.is-active {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.12);
}

#qb-village-commerce-panel[hidden] {
  display: none !important;
}

.qb-birth-chart-btn {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--qb-border);
  border-radius: 999px;
  background: var(--qb-surface);
  color: #fbbf24;
  cursor: pointer;
}

.qb-birth-chart-btn:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
}

.qb-birth-chart-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.qb-account-badge {
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: middle;
}

.qb-upi-qr-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  border: 2px dashed rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  background: var(--qb-surface-elevated);
}

.qb-chart-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qb-muted);
  text-align: center;
  margin-bottom: 0.5rem;
}

.qb-vedic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
  border: 2px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  overflow: hidden;
  background: var(--qb-surface);
}

.qb-vedic-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 4.25rem;
  padding: 0.35rem 0.25rem;
  border: 1px solid rgba(59, 130, 246, 0.15);
  background: var(--qb-surface);
  text-align: center;
}

.qb-vedic-cell-house {
  font-size: 0.58rem;
  color: rgba(148, 163, 184, 0.75);
  line-height: 1.1;
}

.qb-vedic-cell-sign {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #e2e8f0;
  line-height: 1.2;
  margin: 0.1rem 0;
}

.qb-vedic-cell-planets {
  font-size: 0.62rem;
  font-weight: 600;
  color: #fbbf24;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.qb-birth-chart-table-wrap {
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  background: var(--qb-surface);
}

.qb-birth-chart-table thead th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.45rem 0.5rem;
}

.qb-birth-chart-table tbody td {
  font-size: 0.78rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.qb-birth-chart-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 767px) {
  .qb-birth-chart-grids .col-md-6 + .col-md-6 {
    margin-top: 1rem;
  }
}

.qb-profile-readonly {
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 8px;
  background: var(--qb-surface-elevated);
  line-height: 1.5;
}

#qb-admin-village-suggest .qb-btn {
  font-size: 0.75rem;
}

.qb-private-msg-btn {
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--qb-border);
  border-radius: 999px;
  background: var(--qb-surface);
  color: var(--qb-text);
  cursor: pointer;
}

.qb-private-msg-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.2rem;
  padding: 0.05rem 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15rem;
}

.qb-private-msg-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 1080;
  min-width: 9rem;
  padding: 0.35rem;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 10px;
  background: var(--qb-surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.qb-private-msg-menu-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--qb-text);
  text-align: left;
  cursor: pointer;
}

.qb-private-msg-menu-item:hover {
  background: rgba(59, 130, 246, 0.12);
}

.qb-modal-dialog--wide {
  width: min(42rem, 96vw);
}

.qb-messaging--modal {
  max-height: min(70vh, 32rem);
  overflow: auto;
}

.qb-global-main-stats-grid {
  margin-top: 0.75rem;
}

.qb-admin-nom-item {
  line-height: 1.45;
}

.qb-nom-status-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.qb-nom-status--pending {
  background: rgba(255, 215, 0, 0.28);
  color: #996600;
}

.qb-nom-status--approved {
  background: rgba(19, 136, 8, 0.14);
  color: var(--qb-success, #138808);
}

.qb-nom-status--rejected {
  background: rgba(192, 57, 43, 0.12);
  color: var(--qb-danger, #c0392b);
}

.qb-modal-dialog--scroll {
  max-height: min(88vh, 40rem);
  overflow: auto;
}

.qb-admin-members-table-wrap {
  max-height: min(60vh, 28rem);
  overflow: auto;
  border: 1px solid var(--qb-border);
  border-radius: 10px;
  background: var(--qb-surface-elevated);
}

.qb-admin-members-table-wrap th,
.qb-admin-members-table-wrap td {
  white-space: nowrap;
}

.qb-admin-private-details-body p {
  margin-bottom: 0.35rem;
}

@media (max-width: 820px) {
  .qb-timeline-user-identity {
    white-space: normal;
    text-align: left;
    width: 100%;
  }
}

/* Dark-theme dashboard overrides */
.qb-modal-head h2,
.qb-modal-head h3,
.qb-modal-head .h5 {
  color: var(--qb-text);
}

.qb-modal-dialog {
  color: var(--qb-text);
}

.qb-author-modal-details {
  border: 1px solid var(--qb-border);
  background: var(--qb-surface-elevated);
  color: var(--qb-text);
}

.qb-table thead th {
  background: var(--qb-primary);
  color: #000000;
  border-color: var(--qb-primary-hover);
  font-weight: 700;
}

.qb-table td,
.qb-table th {
  border-color: var(--qb-border);
  color: var(--qb-text);
}

.qb-post-card,
.qb-timeline-post {
  background: var(--qb-surface);
  border-color: var(--qb-border);
}

.qb-post-score-positive {
  color: var(--qb-success);
}

.qb-post-score-negative {
  color: var(--qb-danger);
}

.qb-loc-explorer {
  background: var(--qb-surface-elevated);
  border-color: var(--qb-border);
}

.qb-loc-explorer-head {
  color: var(--qb-subtle);
  font-weight: 700;
}

.qb-tree-row:hover {
  background: var(--qb-primary-dim);
}

.qb-tree-row.is-selected {
  background: var(--qb-warning-dim);
  border-color: var(--qb-warning);
}

.form-control,
.form-select {
  background-color: var(--qb-surface-elevated);
  border-color: var(--qb-border);
  color: var(--qb-text);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--qb-primary);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.text-muted {
  color: var(--qb-muted) !important;
}

#qb-my-post-btn {
  white-space: nowrap;
}

.qb-my-post-tabs {
  margin-top: 0.5rem;
}

.qb-board-frozen-meta {
  margin: 0.75rem 0 0.5rem;
}

.qb-board-frozen-dates {
  margin-top: 0.35rem;
}

.qb-my-post-previous .qb-board-post-card {
  border-left: 3px solid var(--qb-border);
  padding-left: 0.75rem;
}

/* Registration / ID copy modal */
.qb-id-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}

.qb-id-modal-backdrop[hidden] {
  display: none !important;
}

.qb-id-modal {
  width: min(100%, 28rem);
  padding: 1.25rem 1.35rem;
  border-radius: 0.75rem;
  border: 1px solid var(--qb-border);
  background: var(--qb-surface-elevated);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.qb-id-modal-warning {
  color: var(--qb-warning, #f59e0b);
}

.qb-id-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--qb-border);
  border-radius: 0.5rem;
  background: var(--qb-surface, rgba(255, 255, 255, 0.02));
}

.qb-copy-feedback {
  flex: 0 0 100%;
  margin-left: 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   Dashboard row layout (Row 2 nav · Row 3 location · Row 4 elements)
   ────────────────────────────────────────────────────────────────────────── */

/* Full-width content — no sidebar reserved. Inner padding keeps body text off
   the extreme edges while Row 2 / Row 4 bars remain full-bleed. */
.qb-dash-content {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0 clamp(0.75rem, 2vw, 1.25rem);
}

/* ROW 2 — main navigation (full viewport width, mirrors element row layout).
   Uses 100vw breakout so tabs reach extreme left/right even inside
   container-fluid. */
.main-nav-row,
.qb-dash-nav.qb-dash-topnav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  gap: 0;
  background: var(--qb-bg, #0f172a);
  border: none;
  border-bottom: 1px solid var(--qb-border, #1e293b);
  border-radius: 0;
  overflow: hidden;
}

.main-nav-button,
.qb-dash-topnav .qb-dash-nav-btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 14px 0;
  font-size: 16px;
  background: var(--qb-bg, #0f172a);
  border: none;
  border-radius: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.main-nav-button + .main-nav-button,
.qb-dash-topnav .qb-dash-nav-btn + .qb-dash-nav-btn {
  margin-left: 0;
}

/* Global — gold */
.qb-dash-nav-btn--global,
.main-nav-button.global {
  color: #ffd700;
  border-bottom-color: #ffd700;
}
.qb-dash-nav-btn--global.is-active,
.main-nav-button.global.active {
  border-bottom-width: 3px;
  background: rgba(255, 215, 0, 0.1);
}

/* Public — saffron */
.qb-dash-nav-btn--public,
.main-nav-button.public {
  color: #ff9933;
  border-bottom-color: #ff9933;
}
.qb-dash-nav-btn--public.is-active,
.main-nav-button.public.active {
  border-bottom-width: 3px;
  background: rgba(255, 153, 51, 0.1);
}

/* Personal — green */
.qb-dash-nav-btn--personal,
.main-nav-button.personal {
  color: #10b981;
  border-bottom-color: #10b981;
}
.qb-dash-nav-btn--personal.is-active,
.main-nav-button.personal.active {
  border-bottom-width: 3px;
  background: rgba(16, 185, 129, 0.1);
}

/* Private — white */
.qb-dash-nav-btn--private,
.main-nav-button.private {
  color: #ffffff;
  border-bottom-color: #ffffff;
}
.qb-dash-nav-btn--private.is-active,
.main-nav-button.private.active {
  border-bottom-width: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.main-nav-button:hover,
.qb-dash-topnav .qb-dash-nav-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.qb-dash-nav-btn--global:hover {
  background: rgba(255, 215, 0, 0.1);
}
.qb-dash-nav-btn--public:hover {
  background: rgba(255, 153, 51, 0.1);
}
.qb-dash-nav-btn--personal:hover {
  background: rgba(16, 185, 129, 0.1);
}
.qb-dash-nav-btn--private:hover {
  background: rgba(255, 255, 255, 0.05);
}

.main-nav-button.is-active,
.main-nav-button.active,
.qb-dash-topnav .qb-dash-nav-btn.is-active {
  font-weight: 700;
}

@media (max-width: 768px) {
  .main-nav-button,
  .qb-dash-topnav .qb-dash-nav-btn {
    font-size: 12px;
    padding: 10px 0;
    letter-spacing: 0;
  }
}

/* ROW 3 — conditional location navigation. Collapses when no explorer shown. */
.qb-subnav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.qb-subnav-row:not(:has(.qb-loc-explorer:not([hidden]))) {
  display: none;
}

.qb-subnav-row .qb-loc-explorer {
  flex: 1 1 100%;
  margin-top: 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--qb-border, #334155);
  border-radius: 10px;
  background: var(--qb-surface-elevated, rgba(15, 23, 42, 0.6));
  max-height: 220px;
  overflow: auto;
}

/* ROW 4 — element selector, fixed full-width bar directly above the marquee.
   Four equal-width buttons (25% each) that touch edge-to-edge, no gaps. */
.qb-element-row,
.element-row {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 50px;
  z-index: 990;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 4px 0;
  min-height: 40px;
  gap: 0;
  overflow: visible;
  background: var(--qb-surface, #1e293b);
  border-top: 1px solid var(--qb-border, #334155);
  border-bottom: 1px solid var(--qb-border, #334155);
}

.qb-element-btn,
.element-button {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.qb-element-btn + .qb-element-btn {
  margin-left: 0;
}

.qb-element-btn--fire {
  background: #ff9933;
  color: #000;
}
.qb-element-btn--earth {
  background: #138808;
  color: #fff;
}
.qb-element-btn--air {
  background: #94a3b8;
  color: #000;
}
.qb-element-btn--water {
  background: #3b82f6;
  color: #fff;
}

.qb-element-btn.is-active {
  box-shadow: inset 0 0 0 2px #ffd700;
  filter: brightness(1.05);
}

/* Element tab hover popup — member counts by zodiac sign */
.qb-element-popup,
.element-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  background: var(--qb-surface, #1e293b);
  border: 1px solid var(--qb-warning, #fbbf24);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 260px;
  max-width: 320px;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  text-align: left;
}

.qb-element-popup[hidden] {
  display: none !important;
}

.qb-element-popup::after,
.element-popup::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: var(--qb-warning, #fbbf24) transparent transparent transparent;
}

.qb-element-popup h4,
.element-popup h4 {
  color: var(--qb-warning, #fbbf24);
  margin: 0 0 8px 0;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
}

.qb-element-popup .qb-element-popup-total,
.element-popup .total {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin: 8px 0;
  color: var(--qb-text, #f1f5f9);
}

.qb-element-popup .qb-element-popup-signs,
.element-popup .sign-list {
  margin-top: 8px;
  border-top: 1px solid var(--qb-border, #334155);
  padding-top: 8px;
}

.qb-element-popup .qb-element-popup-sign-row,
.element-popup .sign-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  gap: 8px;
}

.qb-element-popup .qb-element-popup-sign-name,
.element-popup .sign-name {
  color: var(--qb-text-muted, #94a3b8);
}

.qb-element-popup .qb-element-popup-sign-count,
.element-popup .sign-count,
.popup-sign-count {
  color: var(--qb-warning, #fbbf24);
  font-weight: 700;
  font-size: 12px;
}

.qb-element-popup-header,
.popup-header {
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--qb-border, #334155);
  margin-bottom: 8px;
}

.popup-element-icon {
  font-size: 20px;
  margin-right: 8px;
}

.popup-element-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--qb-warning, #fbbf24);
}

.popup-total {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--qb-text, #f1f5f9);
  margin-bottom: 12px;
}

.popup-signs-list,
.qb-element-popup-signs {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.popup-sign,
.qb-element-popup-sign {
  padding: 8px 0;
  border-bottom: 1px solid var(--qb-border, #334155);
}

.popup-sign:last-child,
.qb-element-popup-sign:last-child {
  border-bottom: none;
}

.popup-sign-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}

.popup-planets,
.qb-element-popup-planets {
  font-size: 12px;
  color: var(--qb-text-muted, #cbd5e1);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.popup-planet,
.qb-popup-planet {
  display: inline-block;
  padding: 1px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  white-space: nowrap;
}

.popup-loading,
.popup-error {
  text-align: center;
  padding: 20px;
  color: var(--qb-text-muted, #94a3b8);
}

.popup-close-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--qb-text-muted, #94a3b8);
  transition: color 0.2s ease;
  z-index: 1;
}

.popup-close-btn:hover,
.popup-close-btn:focus-visible {
  color: var(--qb-danger, #ef4444);
}

.qb-element-popup.show,
.element-popup.show {
  display: block;
}

/* Sanskrit planet names inside element buttons */
.qb-planet-symbols,
.planet-symbols {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-top: 2px;
  min-height: 0.85rem;
  font-size: 10px;
  line-height: 1.1;
}

.qb-planet-name,
.planet-name {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0.95;
}

.qb-planet-name.is-retrograde,
.planet-name.is-retrograde,
.qb-planet-symbol.is-retrograde {
  opacity: 0.75;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.qb-location-element-row {
  position: relative;
  bottom: auto;
  margin-top: 1.5rem;
}

.qb-hamburger-space {
  border-top: 1px solid var(--qb-border, #475569);
  padding-top: 0.35rem;
  margin-top: 0.35rem;
}

.qb-hamburger-space a {
  display: block;
  padding: 0.35rem 0.75rem;
  color: inherit;
  text-decoration: none;
}

.qb-hamburger-space a:hover {
  background: rgba(245, 158, 11, 0.12);
}

/* Keep dashboard content clear of the fixed element row + marquee. */
body.qb-page-dashboard {
  padding-bottom: 108px;
}

@media (max-width: 768px) {
  .qb-element-btn,
  .element-button {
    font-size: 12px;
    padding: 10px 0;
  }
}

/* ── Referral panel (Private Account) ── */
.qb-referral-panel {
  border: 1px solid var(--qb-border, #334155);
}

.qb-referral-code {
  font-size: 1.05rem;
  padding: 0.25rem 0.5rem;
  background: var(--qb-surface-elevated, rgba(15, 23, 42, 0.6));
  border-radius: 6px;
  color: var(--qb-primary, #f59e0b);
}

.qb-referral-qr {
  display: block;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.qb-referral-leaderboard-details summary {
  cursor: pointer;
  color: var(--qb-subtle, #94a3b8);
}

.qb-referral-leaderboard-details summary:hover {
  color: var(--qb-text, #f1f5f9);
}

/* ── Varna / Dharma Profile (equal categories) ── */
.varna-profile-card {
  background: var(--qb-surface);
  border-radius: 16px;
  border: 1px solid var(--qb-border);
}

.varna-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--qb-border);
}

.varna-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.category-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
}

.category-badge.vidya { background: var(--qb-varna-vidya); color: #000; }
.category-badge.raksha { background: var(--qb-varna-raksha); color: #fff; }
.category-badge.artha { background: var(--qb-varna-artha); color: #000; }
.category-badge.seva { background: var(--qb-varna-seva); color: #fff; }
.category-badge.sarvanga {
  background: linear-gradient(
    90deg,
    var(--qb-varna-vidya),
    var(--qb-varna-raksha),
    var(--qb-varna-artha),
    var(--qb-varna-seva)
  );
  color: #000;
}
.category-badge.secondary { opacity: 0.85; }

.category-type {
  font-size: 0.75rem;
  color: var(--qb-muted);
  font-style: italic;
}

.score-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.score-label {
  width: 7.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  flex-shrink: 0;
}

.score-label.vidya { color: var(--qb-varna-vidya); }
.score-label.raksha { color: var(--qb-varna-raksha); }
.score-label.artha { color: var(--qb-varna-artha); }
.score-label.seva { color: var(--qb-varna-seva); }

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--qb-bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress.vidya { background: var(--qb-varna-vidya); }
.progress.raksha { background: var(--qb-varna-raksha); }
.progress.artha { background: var(--qb-varna-artha); }
.progress.seva { background: var(--qb-varna-seva); }

.score-value {
  width: 2.5rem;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--qb-text);
}

.varna-insight ul {
  margin: 0.5rem 0 0 1.25rem;
  color: var(--qb-muted);
  font-size: 0.8125rem;
}

.varna-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.qb-varna-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Private account profile header */
.qb-profile-header .private-id .hidden-digits {
  letter-spacing: 2px;
}

.qb-profile-header .private-id .visible-digits {
  font-weight: 700;
}

/* Uniform icon-only action buttons (wallet, chart, messages) */
.qb-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--qb-border);
  background: var(--qb-surface);
  color: var(--qb-text);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  padding: 0;
}

.qb-icon-btn:hover {
  background: var(--qb-surface-elevated);
  border-color: rgba(59, 130, 246, 0.45);
  transform: scale(1.05);
}

.qb-icon-btn:focus-visible {
  outline: 2px solid var(--qb-secondary);
  outline-offset: 2px;
}

.qb-icon-btn[data-tooltip]:hover::after,
.qb-icon-btn[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--qb-topbar-bg);
  color: var(--qb-text);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
  z-index: 1200;
  pointer-events: none;
  border: 1px solid var(--qb-border);
}

.qb-private-msg-wrap .qb-icon-btn .qb-private-msg-badge {
  top: -0.2rem;
  right: -0.2rem;
}

.qb-admin-panel-page {
  max-width: 56rem;
}

.qb-admin-panel-page .qb-panel {
  scroll-margin-top: 5rem;
}
