/* Career Hub (dashboard.html) — theme-aligned overrides */

:root,
[data-theme="dark"] {
  --hub-canvas-bg: rgb(8 7 6);
  --hub-topbar-bg: rgb(13 11 10 / 0.92);
  --hub-panel-bg: rgb(24 21 19);
  --hub-control-bg: rgb(38 34 30);
  --hub-border: rgb(72 64 58);
  --hub-text: rgb(245 238 233);
  --hub-text-muted: rgb(148 137 129);
  --hub-accent: rgb(255 178 153);
  --hub-accent-hover: rgb(255 203 184);
  --hub-accent-fg: rgb(20 12 9);
}

[data-theme="light"] {
  --hub-canvas-bg: rgb(252 252 252);
  --hub-topbar-bg: rgb(255 255 255 / 0.94);
  --hub-panel-bg: rgb(255 255 255);
  --hub-control-bg: rgb(248 248 248);
  --hub-border: rgb(220 210 200);
  --hub-text: rgb(15 15 15);
  --hub-text-muted: rgb(100 100 100);
  --hub-accent: rgb(210 85 40);
  --hub-accent-hover: rgb(235 115 65);
  --hub-accent-fg: rgb(255 255 255);
}

body.hub-page {
  background: var(--hub-canvas-bg) !important;
  color: var(--hub-text) !important;
}

body.hub-page #topbar {
  background: var(--hub-topbar-bg) !important;
  border-bottom: 1px solid var(--hub-border) !important;
  color: var(--hub-text) !important;
}

.hub-app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: min(520px, 42vw);
}

.hub-app-nav::-webkit-scrollbar {
  display: none;
}

@media (max-width: 900px) {
  .hub-app-nav {
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
  }

  #topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
    row-gap: 8px;
  }

  #search-wrap {
    order: 4;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
  }

  .topbar-right .legend {
    display: none;
  }
}

body.hub-page .hub-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.hub-page .hub-brand,
body.hub-page .hub-brand .fw-brand-text {
  color: var(--hub-text) !important;
  text-decoration: none;
}

body.hub-page .hub-brand:hover .fw-brand-text {
  color: var(--hub-accent) !important;
}

body.hub-page .hub-brand .fw-brand-icon {
  background: var(--hub-accent) !important;
  color: var(--hub-accent-fg) !important;
}

.hub-loading {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hub-canvas-bg);
  color: var(--hub-text);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
}

.hub-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hub-loading-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hub-loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgb(var(--primary) / 0.2);
  border-top-color: rgb(var(--primary));
  border-radius: 50%;
  animation: hub-spin 0.75s linear infinite;
}

@keyframes hub-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-loading-spinner { animation: none; border-top-color: rgb(var(--primary) / 0.5); }
}

body.hub-page .logo {
  color: var(--hub-text) !important;
}

body.hub-page .logo span {
  color: var(--hub-text-muted) !important;
}

body.hub-page #search {
  background: var(--hub-control-bg) !important;
  border: 1px solid var(--hub-border) !important;
  color: var(--hub-text) !important;
}

body.hub-page #search::placeholder {
  color: var(--hub-text-muted) !important;
}

body.hub-page #search:focus-visible {
  outline: 2px solid rgb(var(--primary) / 0.5);
  outline-offset: 2px;
}

body.hub-page #search:focus {
  border-color: rgb(var(--primary) / 0.45) !important;
}

body.hub-page .user-chip {
  background: var(--hub-control-bg) !important;
  border: 1px solid var(--hub-border) !important;
  color: var(--hub-text) !important;
}

body.hub-page .user-avatar {
  background: linear-gradient(135deg, var(--hub-accent), var(--hub-accent-hover)) !important;
  color: var(--hub-accent-fg) !important;
}

body.hub-page #search-wrap svg {
  color: var(--hub-text-muted);
  opacity: 1;
}

body.hub-page .legend-label {
  color: var(--hub-text-muted) !important;
}

body.hub-page #tooltip {
  background: var(--hub-panel-bg) !important;
  border: 1px solid var(--hub-border) !important;
  color: var(--hub-text) !important;
}

body.hub-page #tooltip .tt-industry {
  color: var(--hub-text-muted) !important;
}

body.hub-page #detail-panel {
  background: var(--hub-panel-bg) !important;
  border-left: 1px solid var(--hub-border);
  box-shadow: -8px 0 40px rgb(0 0 0 / 0.12) !important;
}

[data-theme="dark"] body.hub-page #detail-panel {
  box-shadow: -8px 0 40px rgb(0 0 0 / 0.35) !important;
}

body.hub-page .panel-header,
body.hub-page .panel-footer {
  border-color: var(--hub-border) !important;
}

body.hub-page .panel-close {
  background: var(--hub-control-bg) !important;
  border: 1px solid var(--hub-border) !important;
  color: var(--hub-text-muted) !important;
}

body.hub-page .panel-close:hover {
  color: var(--hub-text) !important;
  border-color: rgb(var(--primary) / 0.4) !important;
}

body.hub-page .panel-career-name {
  color: var(--hub-text) !important;
}

body.hub-page .panel-industry-badge,
body.hub-page .skill-pill {
  background: var(--hub-control-bg) !important;
  border: 1px solid var(--hub-border) !important;
  color: var(--hub-text) !important;
}

body.hub-page .panel-fit-label,
body.hub-page .panel-section-label {
  color: var(--hub-text-muted) !important;
}

body.hub-page .panel-fit-pct {
  color: var(--hub-text) !important;
}

body.hub-page .panel-fit-bar-bg {
  background: var(--hub-control-bg) !important;
  border: 1px solid var(--hub-border);
}

body.hub-page .panel-description {
  color: var(--hub-text-muted) !important;
}

body.hub-page .btn-daylife {
  background: var(--hub-control-bg) !important;
  border: 1px solid var(--hub-border) !important;
  color: var(--hub-text-muted) !important;
  opacity: 1 !important;
}

/* Career advisor trigger — removed; use top nav AI Career Advisor tab */
/* From dashboard.html layout */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--hub-canvas-bg, #080706);
    color: var(--hub-text, #fff);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
  }

  /* ── TOP BAR ── */
  #topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 100;
  }

  .logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--hub-text, #fff);
    white-space: nowrap;
    letter-spacing: -0.01em;
    flex-shrink: 0;
  }
  .logo span { color: rgba(255,255,255,0.45); font-weight: 400; }

  #search-wrap {
    flex: 1;
    max-width: 360px;
    margin: 0 auto;
    position: relative;
  }
  #search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hub-text-muted, rgba(255,255,255,0.45));
    pointer-events: none;
  }
  #search-wrap svg circle,
  #search-wrap svg path {
    stroke: currentColor;
  }
  #search {
    width: 100%;
    background: var(--hub-control-bg, rgba(255,255,255,0.07));
    border: 1px solid var(--hub-border, rgba(255,255,255,0.1));
    border-radius: 10px;
    padding: 8px 12px 8px 36px;
    color: var(--hub-text, #fff);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
  }
  #search::placeholder { color: var(--hub-text-muted, rgba(255,255,255,0.45)); opacity: 0.75; }
  #search:focus {
    border-color: rgb(var(--primary) / 0.45);
  }

  .topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    margin-left: auto;
  }

  .legend {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .legend-label {
    font-size: 0.7rem;
    color: var(--hub-text-muted, rgba(255,255,255,0.45));
    white-space: nowrap;
  }
  .legend-bar {
    width: 96px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #9AA0AD, #5ED152, #3FAEF0, #BD4AE8, #F2A82E, #FFD24A);
    box-shadow: 0 0 8px rgba(255,210,74,0.35);
  }

  .user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hub-control-bg, rgba(255,255,255,0.07));
    border: 1px solid var(--hub-border, rgba(255,255,255,0.1));
    border-radius: 20px;
    padding: 4px 12px 4px 6px;
    font-size: 0.8rem;
    color: var(--hub-text, rgba(255,255,255,0.9));
  }
  .user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hub-accent, rgb(var(--primary))), var(--hub-accent-hover, rgb(var(--primary-hover))));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--hub-accent-fg);
  }

  /* ── CANVAS ── */
  #map-canvas {
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
  }

  /* ── TOOLTIP ── */
  #tooltip {
    position: fixed;
    pointer-events: none;
    background: var(--hub-panel-bg);
    border: 1px solid var(--hub-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--hub-text);
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 150;
    max-width: 180px;
    backdrop-filter: blur(12px);
  }
  #tooltip.visible { opacity: 1; }
  #tooltip .tt-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; }
  #tooltip .tt-score { font-size: 0.78rem; margin-bottom: 2px; }
  #tooltip .tt-industry { font-size: 0.72rem; color: var(--hub-text-muted); }

  /* ── DETAIL PANEL ── */
  #detail-panel {
    position: fixed;
    top: 0; right: 0;
    width: min(340px, 100vw);
    height: 100%;
    background: var(--hub-panel-bg);
    border-left: 1px solid var(--hub-border);
    box-shadow: -8px 0 40px rgb(0 0 0 / 0.12);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 110;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #detail-panel.open { transform: translateX(0); }

  .panel-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--hub-border);
    flex-shrink: 0;
  }
  .panel-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--hub-control-bg);
    border: 1px solid var(--hub-border);
    cursor: pointer;
    color: var(--hub-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
  }
  .panel-close:hover { background: var(--hub-control-bg); color: var(--hub-text); border-color: rgb(var(--primary) / 0.4); }

  .panel-industry-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    background: var(--hub-control-bg);
    border: 1px solid var(--hub-border);
    color: var(--hub-text-muted);
  }

  .panel-career-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hub-text);
    margin-bottom: 16px;
    padding-right: 36px;
  }

  .panel-fit-wrap {
    margin-bottom: 4px;
  }
  .panel-fit-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: var(--hub-text-muted);
  }
  .panel-fit-pct {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--hub-text);
  }
  .panel-fit-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
  }
  .panel-fit-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  }

  .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
  }
  .panel-body::-webkit-scrollbar { width: 4px; }
  .panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

  .panel-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hub-text-muted);
    margin-bottom: 10px;
  }

  .skills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
  }
  .skill-pill {
    background: var(--hub-control-bg);
    border: 1px solid var(--hub-border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--hub-text);
  }

  .panel-description {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--hub-text-muted);
    margin-bottom: 24px;
  }

  .panel-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--hub-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .btn-deep-dive {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: rgb(var(--primary));
    color: rgb(var(--primary-fg));
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
  }
  .btn-deep-dive:hover {
    opacity: 0.92;
    transform: translateY(-1px);
  }

  .btn-daylife {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.3);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: not-allowed;
    opacity: 0.5;
    position: relative;
  }
  .btn-daylife .coming-soon-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18,18,42,0.98);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    pointer-events: none;
  }
  .btn-daylife:hover .coming-soon-tip { display: block; }
