/* ============================================================
   EPW
   Azia Light Theme · Apple-grade polish · 2-bubble model
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100vw;
  min-height: 100vh;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ---- Background: silvery gradient + radar watermark ---- */
#bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(174, 180, 198, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(174, 180, 198, 0.1) 0%, transparent 60%),
    linear-gradient(180deg, #f5f5f7 0%, #e8e8ed 50%, #dcdce2 100%);
  z-index: 0;
}

/* Watermark disabled — JPG has opaque dark background; re-enable with transparent PNG */
#bg-layer::before {
  content: none;
}

/* Subtle noise texture overlay */
#bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* ---- Animated ambient gradient orbs (macOS Sonoma-style) ---- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}

@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 25px) scale(0.95); }
}

@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1.02); }
  50% { transform: translate(25px, -40px) scale(1.05); }
}

/* ---- Infrastructure Nav Header ---- */
#infra-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 250;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 2px solid #0693E3;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.epw-view-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.epw-view-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(37, 211, 102, 0.9);
  letter-spacing: -0.5px;
}

.epw-view-subtitle {
  font-size: 0.85rem;
  color: rgba(71, 85, 105, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.epw-view-header-right {
  display: flex;
  gap: 6px;
}

/* Push palette content below fixed infra header */
#palette.has-nav-header {
  padding-top: 60px;
}

/* ---- Title ---- */
#title-bar {
  position: absolute;
  top: 28px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 10;
  transition: opacity 0.4s ease;
}

#title-bar h1 {
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #86868b;
}

/* ---- Palette container ---- */
#palette {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: auto;
  z-index: 5;
  --ls: 1; /* layout scale — set by JS on init/resize */
}

/* ---- Main Bubble (ROOT / MANAGER / USERS) ---- */
.main-bubble {
  position: absolute;
  width: calc(150px * var(--ls, 1));
  height: calc(150px * var(--ls, 1));
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transform-origin: center center;
  will-change: transform, opacity;

  /* 3D sphere gradient — bright hotspot + sphere body + dark base */
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.25) 0%, transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.3) 0%, transparent 55%),
    radial-gradient(
      circle at 38% 32%,
      var(--color-highlight),
      var(--color-main) 40%,
      var(--color-deep) 85%
    );

  /* Physical button shadow — bezel ring + elevated float + deep base */
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.08),
    0 40px 80px var(--shadow-heavy),
    0 16px 40px var(--shadow-medium),
    0 6px 14px rgba(0, 0, 0, 0.12),
    inset 0 3px 8px rgba(255, 255, 255, 0.4),
    inset 0 -8px 28px rgba(0, 0, 0, 0.3),
    inset 0 0 4px rgba(0, 0, 0, 0.1);

  /* Idle floating animation — disabled for cleaner layout */
  /* animation: bubble-float var(--float-duration, 5s) ease-in-out infinite; */
  /* animation-delay: var(--float-delay, 0s); */

  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* Floating keyframes — uses translate (independent from transform) */
@keyframes bubble-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

/* Specular glare — sharp bright hotspot like light on glossy plastic */
.main-bubble::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 16%;
  width: 38%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 255, 255, 0.75),
    rgba(255, 255, 255, 0.35) 35%,
    rgba(255, 255, 255, 0.08) 60%,
    transparent 75%
  );
  pointer-events: none;
  z-index: 2;
  filter: blur(3px);
}

/* Edge definition ring — bright top lip, dark bottom base */
.main-bubble::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.05) 25%,
    transparent 45%,
    transparent 55%,
    rgba(0, 0, 0, 0.12) 80%,
    rgba(0, 0, 0, 0.18) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Pause floating during expand */
.main-bubble.no-float {
  animation-play-state: paused;
  translate: 0 0;
}

/* Hover — lifts up off the surface */
.main-bubble:hover {
  transform: scale(1.05) translateY(-4px) !important;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.06),
    0 50px 100px var(--shadow-heavy),
    0 24px 50px var(--shadow-medium),
    0 8px 20px rgba(0, 0, 0, 0.12),
    inset 0 3px 8px rgba(255, 255, 255, 0.45),
    inset 0 -8px 28px rgba(0, 0, 0, 0.3),
    inset 0 0 4px rgba(0, 0, 0, 0.1);
}

/* Press — button sinks into the surface */
.main-bubble:active {
  transform: scale(0.97) translateY(2px) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.1),
    0 10px 20px var(--shadow-heavy),
    0 4px 10px var(--shadow-medium),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -10px 32px rgba(0, 0, 0, 0.35),
    inset 0 0 6px rgba(0, 0, 0, 0.15) !important;
}

/* Avatar circle inside bubble */
.bubble-avatar {
  width: calc(80px * var(--ls, 1));
  height: calc(80px * var(--ls, 1));
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 3;
}

.bubble-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble-avatar .initials {
  font-size: 1.6rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Bubble labels */
.bubble-name {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 3;
}

.bubble-role {
  font-size: 0.45rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 3;
}

/* Floating label below bubble */
.bubble-label-below {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}

.bubble-label-below .label-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: #1d1d1f;
}

.bubble-label-below .label-subtitle {
  font-size: 0.6rem;
  font-weight: 400;
  color: #86868b;
  margin-top: 2px;
}

/* ---- Expanded title ---- */
#expanded-title {
  position: absolute;
  top: 72px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

#expanded-title h2 {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #86868b;
}

#expanded-title p {
  font-size: 0.9rem;
  font-weight: 400;
  color: #86868b;
  margin-top: 4px;
}

/* ---- Category Heading ---- */
.category-heading {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86868b;
  white-space: nowrap;
  text-align: center;
  z-index: 6;
  padding-bottom: 6px;
}

/* ---- Child Node (pill-shaped card) ---- */
.child-node {
  position: absolute;
  width: 255px;
  height: 96px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  opacity: 0;
  transform: scale(0);
  will-change: transform, opacity;

  /* Silvery metallic surface */
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.92),
    rgba(232, 234, 240, 0.85)
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  /* Beveled edges — bright top, darker bottom */
  border: 0.5px solid rgba(200, 200, 210, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid rgba(150, 150, 160, 0.2);

  /* 3D raised card — floating above surface */
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 2px rgba(255, 255, 255, 0.95),
    inset 0 -2px 6px rgba(0, 0, 0, 0.06);

  transition:
    box-shadow 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Glossy surface overlay — convex highlight */
.child-node::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.15) 30%,
    transparent 50%,
    rgba(0, 0, 0, 0.04) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Hover — card lifts up */
.child-node:hover {
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.14),
    0 8px 16px rgba(0, 0, 0, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 1),
    inset 0 -2px 8px rgba(0, 0, 0, 0.08);
}

/* Press — card sinks down */
.child-node:active {
  transform: scale(0.97) translateY(2px) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -3px 10px rgba(0, 0, 0, 0.1) !important;
}

.child-node .child-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.child-node .child-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.child-node .child-logo .emoji-fallback {
  font-size: 1.8rem;
  line-height: 1;
}

.child-node .child-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.child-node .child-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.child-node .child-desc {
  font-size: 0.7rem;
  font-weight: 400;
  color: #86868b;
  line-height: 1.3;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Project pills on child cards ---- */
.project-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.project-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  border: 0.5px solid rgba(5, 150, 105, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* ---- Project pills in detail panel ---- */
.project-detail-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.6), rgba(240,240,245,0.5));
  border: 0.5px solid rgba(255,255,255,0.6);
}

.project-detail-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #86868b;
  margin-bottom: 8px;
}

.project-detail-pill {
  display: inline-block;
  padding: 4px 12px;
  margin: 0 6px 6px 0;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #059669;
  background: rgba(5, 150, 105, 0.08);
  border: 0.5px solid rgba(5, 150, 105, 0.2);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.project-detail-pill:hover {
  background: rgba(5, 150, 105, 0.18);
  color: #047857;
}

/* ---- Task pill on child cards ---- */
.task-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  border: 0.5px solid rgba(217, 119, 6, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ---- Task detail rows in panel ---- */
.task-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.05);
  border: 0.5px solid rgba(217, 119, 6, 0.15);
}

.task-detail-status {
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.task-detail-text {
  flex: 1;
  min-width: 0;
}

.task-detail-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d1d1f;
}

.task-detail-desc {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: #86868b;
  margin-top: 2px;
  line-height: 1.4;
}

/* ---- Forum function pill on child cards ---- */
.dfda-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0891b2;
  background: rgba(8, 145, 178, 0.1);
  border: 0.5px solid rgba(8, 145, 178, 0.2);
  white-space: nowrap;
}

/* ---- Forum functions in detail panel ---- */
.dfda-detail-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.6), rgba(240,240,245,0.5));
  border: 0.5px solid rgba(255,255,255,0.6);
}

.dfda-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: rgba(8, 145, 178, 0.04);
  border: 0.5px solid rgba(8, 145, 178, 0.1);
}

.dfda-detail-id {
  font-size: 0.65rem;
  font-weight: 700;
  color: #0891b2;
  white-space: nowrap;
  min-width: 28px;
}

.dfda-detail-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: #1d1d1f;
}

/* ---- EPW function pill on child cards ---- */
.epwfn-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border: 0.5px solid rgba(37, 99, 235, 0.2);
  white-space: nowrap;
}

/* ---- EPW functions in detail panel ---- */
.epwfn-detail-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.6), rgba(240,240,245,0.5));
  border: 0.5px solid rgba(255,255,255,0.6);
}

.epwfn-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.04);
  border: 0.5px solid rgba(37, 99, 235, 0.1);
}

.epwfn-detail-id {
  font-size: 0.65rem;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
  min-width: 28px;
}

.epwfn-detail-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: #1d1d1f;
}

/* ---- Research pill on child cards ---- */
.research-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.1);
  border: 0.5px solid rgba(109, 40, 217, 0.2);
  white-space: nowrap;
}

/* ---- Project Docs pill on child cards ---- */
.project-docs-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  border: 0.5px solid rgba(217, 119, 6, 0.2);
  white-space: nowrap;
}

/* ---- LLM Tools pill on child cards ---- */
.llm-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0e7490;
  background: rgba(14, 116, 144, 0.1);
  border: 0.5px solid rgba(14, 116, 144, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ---- LLM Tools in detail panel ---- */
.llm-detail-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.6), rgba(240,240,245,0.5));
  border: 0.5px solid rgba(255,255,255,0.6);
}

.llm-summary {
  font-size: 0.68rem;
  font-weight: 500;
  color: #6e6e73;
  margin-bottom: 10px;
  line-height: 1.4;
}

.llm-specialist-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  vertical-align: middle;
  margin-left: 4px;
}

.llm-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: rgba(14, 116, 144, 0.04);
  border: 0.5px solid rgba(14, 116, 144, 0.1);
}

.llm-detail-role {
  font-size: 0.6rem;
  font-weight: 700;
  color: #0e7490;
  white-space: nowrap;
  min-width: 52px;
  flex-shrink: 0;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.llm-detail-info {
  flex: 1;
  min-width: 0;
}

.llm-detail-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d1d1f;
}

.llm-detail-meta {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: #86868b;
  margin-top: 1px;
}

.llm-lane-gpu {
  font-weight: 700;
  color: #059669;
}

.llm-lane-cpu {
  font-weight: 700;
  color: #6366f1;
}

/* ---- Document Reader (inline in detail panel) ---- */
.doc-reader {
  margin: -8px -6px;
}
.doc-reader-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  margin-bottom: 12px;
  border: 0.5px solid rgba(217, 119, 6, 0.3);
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.08);
  color: #d97706;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.doc-reader-back:hover {
  background: rgba(217, 119, 6, 0.18);
}
.doc-reader-content {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.75), rgba(245,245,250,0.6));
  border: 0.5px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  font-size: 0.72rem;
  line-height: 1.55;
  color: #1a1a2e;
  max-height: 65vh;
  overflow-y: auto;
}
.doc-reader-content h4 {
  margin: 14px 0 6px 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a1a2e;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 3px;
}
.doc-reader-content h4:first-child {
  margin-top: 0;
}
.doc-reader-content p {
  margin: 4px 0 8px 0;
}
.doc-reader-content ul {
  margin: 4px 0 10px 0;
  padding-left: 18px;
}
.doc-reader-content li {
  margin-bottom: 3px;
}
.doc-reader-content code {
  background: rgba(0,0,0,0.05);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.68rem;
}
.doc-reader-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 0.68rem;
}
.doc-reader-content th,
.doc-reader-content td {
  padding: 4px 8px;
  text-align: left;
  border: 0.5px solid rgba(0,0,0,0.1);
}
.doc-reader-content th {
  background: rgba(217, 119, 6, 0.08);
  font-weight: 600;
}
.doc-reader-content strong {
  color: #111;
}
.doc-reader-footer {
  margin-top: 10px;
  text-align: right;
}
.doc-reader-download {
  font-size: 0.65rem;
  color: #6b7280;
  text-decoration: none;
  border: 0.5px solid rgba(0,0,0,0.1);
  padding: 3px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.doc-reader-download:hover {
  background: rgba(0,0,0,0.04);
}

.project-doc-row:hover {
  background: rgba(217, 119, 6, 0.06) !important;
}
.financial-record-row:hover {
  background: rgba(52, 211, 153, 0.06) !important;
}
.financial-invoice-table th {
  background: rgba(52, 211, 153, 0.08);
  font-weight: 600;
}
.financial-invoice-table td {
  font-size: 0.65rem;
}
.financial-summary-table td {
  border: 0.5px solid rgba(0,0,0,0.06);
}

/* ---- Spreadsheet-style Financial Table ---- */
.financial-table-wrap {
  margin: -8px -6px;
}
.financial-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.financial-table-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}
.financial-actions {
  display: flex;
  gap: 6px;
}
.financial-actions button {
  padding: 4px 12px;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 6px;
  border: 0.5px solid rgba(0,0,0,0.12);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.financial-actions .btn-csv {
  background: rgba(22, 163, 100, 0.1);
  color: #16a364;
}
.financial-actions .btn-csv:hover {
  background: rgba(22, 163, 100, 0.2);
}
.financial-actions .btn-sheets {
  background: rgba(52, 168, 83, 0.1);
  color: #34a853;
}
.financial-actions .btn-sheets:hover {
  background: rgba(52, 168, 83, 0.2);
}
.financial-actions .btn-sheets:disabled,
.financial-actions .btn-csv:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.financial-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.75), rgba(245,245,250,0.6));
  border: 0.5px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  font-size: 0.7rem;
  color: #1a1a2e;
}
.financial-summary-strip .summary-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.financial-summary-strip .summary-label {
  font-weight: 600;
  color: #6b7280;
}
.financial-summary-strip .summary-value {
  font-weight: 700;
}
.financial-summary-strip .summary-divider {
  width: 1px;
  height: 16px;
  background: rgba(0,0,0,0.1);
}
.financial-table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 0.5px solid rgba(0,0,0,0.08);
}
table.financial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
  line-height: 1.4;
}
table.financial-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(22, 163, 100, 0.08);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #374151;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.financial-table thead th:hover {
  background: rgba(22, 163, 100, 0.15);
}
table.financial-table thead th .sort-indicator {
  display: inline-block;
  width: 10px;
  text-align: center;
  font-size: 0.6rem;
  color: #9ca3af;
  margin-left: 2px;
}
table.financial-table thead th .sort-indicator.active {
  color: #16a364;
}
table.financial-table tbody tr {
  transition: background 0.15s;
}
table.financial-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.015);
}
table.financial-table tbody tr:hover {
  background: rgba(22, 163, 100, 0.05);
}
table.financial-table td {
  padding: 5px 8px;
  border-bottom: 0.5px solid rgba(0,0,0,0.04);
  white-space: nowrap;
}
table.financial-table td.amount-positive {
  color: #16a364;
  font-weight: 600;
}
table.financial-table td.amount-negative {
  color: #ef4444;
  font-weight: 600;
}
table.financial-table td.text-right {
  text-align: right;
}
/* Bank table opening/closing balances */
.bank-balance-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.75), rgba(245,245,250,0.6));
  border: 0.5px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  font-size: 0.7rem;
}
.bank-balance-strip .bal-row {
  display: flex;
  justify-content: space-between;
}
.bank-balance-strip .bal-label {
  font-weight: 600;
  color: #6b7280;
}
.bank-balance-strip .bal-value {
  font-weight: 700;
  color: #1a1a2e;
}
.bank-balance-strip .bal-net {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 700;
  padding-top: 4px;
  border-top: 0.5px solid rgba(0,0,0,0.08);
}
.bank-record-row:hover {
  background: rgba(3, 105, 161, 0.06) !important;
}

/* ---- Research files in detail panel ---- */
.research-detail-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.6), rgba(240,240,245,0.5));
  border: 0.5px solid rgba(255,255,255,0.6);
}

.research-detail-row {
  display: block;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(109, 40, 217, 0.04);
  border: 0.5px solid rgba(109, 40, 217, 0.1);
  text-decoration: none;
  transition: background 0.2s;
}

.research-detail-row:hover {
  background: rgba(109, 40, 217, 0.1);
}

.research-detail-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.3;
}

.research-detail-path {
  display: block;
  font-size: 0.58rem;
  font-weight: 400;
  color: #6d28d9;
  margin-top: 2px;
  word-break: break-all;
}

/* ---- Connecting lines ---- */
.connect-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.connect-svg line {
  stroke: rgba(0, 0, 0, 0.04);
  stroke-width: 1;
}

/* ---- Detail Panel ---- */
#detail-panel {
  position: fixed;
  right: -440px;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  max-height: 80vh;
  padding: 40px 36px;
  z-index: 20;
  overflow-y: auto;

  /* Premium frosted glass — stronger blur + edge highlight */
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.88),
    rgba(245, 245, 247, 0.8)
  );
  backdrop-filter: blur(60px) saturate(1.4);
  -webkit-backdrop-filter: blur(60px) saturate(1.4);
  border: 0.5px solid rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#detail-close {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 50%;
  font-size: 1.1rem;
  color: #86868b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#detail-close:hover {
  background: rgba(0, 0, 0, 0.08);
}

#detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

#detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f0f0f3, #e4e4ea);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

#detail-icon img {
  width: 28px;
  height: 28px;
}

#detail-icon .emoji-fallback {
  font-size: 1.5rem;
}

#detail-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

#detail-category {
  font-size: 0.75rem;
  font-weight: 500;
  color: #86868b;
  margin-top: 2px;
}

#detail-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  padding: 16px 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(240,240,245,0.6));
  border: 0.5px solid rgba(255,255,255,0.7);
  text-align: center;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

#detail-description {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #6e6e73;
}

/* ---- Metrics: Detail Panel Meters ---- */
.metrics-section {
  margin-bottom: 20px;
}

.metrics-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #86868b;
  margin-bottom: 12px;
}

.metric-meter {
  margin-bottom: 14px;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.meter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1d1d1f;
}

.meter-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d1d1f;
  font-variant-numeric: tabular-nums;
}

.meter-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.meter-sub {
  font-size: 0.65rem;
  font-weight: 400;
  color: #86868b;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-status {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meter-status-healthy {
  background: rgba(52, 199, 89, 0.15);
  color: #22863a;
}

.meter-status-unhealthy {
  background: rgba(239, 68, 68, 0.15);
  color: #cf222e;
}

.meter-status-starting {
  background: rgba(245, 158, 11, 0.15);
  color: #9a6700;
}

/* Counters (Portmaster style) */
.metric-counter {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,0.5), rgba(240,240,245,0.4));
  border: 0.5px solid rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.counter-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.counter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #1d1d1f;
}

.counter-label strong {
  font-weight: 700;
}

.counter-desc {
  font-size: 0.6rem;
  font-weight: 400;
  color: #86868b;
  margin-top: 2px;
  line-height: 1.3;
}

/* ---- Metrics: Card-level mini meters ---- */
.child-node.has-metrics {
  height: 116px;
}

.card-meter {
  margin-top: 4px;
}

.card-meter-track {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.card-meter-fill {
  height: 100%;
  border-radius: 3px;
}

.card-meter-label {
  font-size: 0.5rem;
  font-weight: 500;
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* ---- Breadcrumb ---- */
#breadcrumb {
  position: fixed;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 6px;

  background: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(240,240,243,0.6));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.2s ease;
}

#breadcrumb.visible {
  opacity: 1;
  pointer-events: auto;
}

#breadcrumb.in-header {
  position: static;
  margin-left: 12px;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 0 8px;
}

.crumb {
  color: #86868b;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.crumb:hover {
  color: #1d1d1f;
}

.crumb-sep {
  color: #c7c7cc;
  font-weight: 300;
  display: none;
}

.crumb-sep.show {
  display: inline;
}

/* ---- Clickpath bar (inline breadcrumb inside detail panel) ---- */
.clickpath-bar {
  font-size: 0.65rem;
  font-weight: 500;
  color: #86868b;
  padding: 6px 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(142, 142, 147, 0.06);
  border: 0.5px solid rgba(142, 142, 147, 0.12);
  letter-spacing: 0.02em;
  user-select: all;
}
.clickpath-bar .clickpath-sep {
  color: #c7c7cc;
  margin: 0 4px;
}

#copy-path {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 50%;
  color: #86868b;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.2s, color 0.2s;
}

#copy-path.show {
  display: flex;
}

#copy-path:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1d1d1f;
}

#copy-path.copied {
  color: #34c759;
}

/* ---- Location badges on child nodes ---- */
.loc-badges {
  position: absolute;
  bottom: -8px;
  right: -6px;
  display: flex;
  gap: 2px;
  align-items: center;
}

.loc-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.loc-primary {
  background: #3a3a3c;
}

.loc-secondary {
  background: #86868b;
  width: 20px;
  height: 20px;
}

.loc-secondary svg {
  width: 11px;
  height: 11px;
}

/* ---- Location detail in panel ---- */
.loc-detail {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.6), rgba(240,240,245,0.5));
  border: 0.5px solid rgba(255,255,255,0.6);
}

.loc-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.loc-detail-row + .loc-detail-row {
  border-top: 0.5px solid rgba(0, 0, 0, 0.05);
  padding-top: 8px;
  margin-top: 4px;
}

.loc-detail-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #3a3a3c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loc-detail-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #86868b;
  width: 50px;
}

.loc-detail-value {
  font-size: 0.8rem;
  font-weight: 500;
  color: #1d1d1f;
}

/* ---- C4 Deep Dive Footer ---- */
#c4-link {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 10px 0;
  z-index: 12;
}

#c4-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #86868b;
  text-decoration: none;
  padding: 6px 18px;
  border-radius: 100px;
  background: linear-gradient(145deg, rgba(255,255,255,0.5), rgba(240,240,243,0.4));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  transition: color 0.2s, background 0.2s;
}

#c4-link a:hover {
  color: #1d1d1f;
  background: linear-gradient(145deg, rgba(255,255,255,0.75), rgba(240,240,243,0.65));
}

/* ---- Dimmed state (main bubbles) ---- */
.dimmed {
  pointer-events: none !important;
}

/* ---- Focus state (child nodes when detail open) ---- */
.child-dimmed {
  opacity: 0.15 !important;
  transform: scale(0.95) !important;
  filter: blur(1px);
  pointer-events: none !important;
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}

.child-selected {
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.4s ease;
}

/* Category headings dimmed */
.category-heading.child-dimmed {
  filter: none;
}

/* ---- Device Row ---- */
#device-row {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 6;
  pointer-events: auto;
}

.device-card {
  position: relative;
  width: calc(100px * var(--ls, 1));
  height: calc(100px * var(--ls, 1));
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;

  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.88),
    rgba(232, 234, 240, 0.8)
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  border: 0.5px solid rgba(200, 200, 210, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 3px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 2px rgba(255, 255, 255, 0.9),
    inset 0 -1px 4px rgba(0, 0, 0, 0.04);

  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

/* Glossy surface overlay */
.device-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.1) 30%,
    transparent 50%,
    rgba(0, 0, 0, 0.03) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.device-card:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.12),
    0 6px 14px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 1),
    inset 0 -1px 6px rgba(0, 0, 0, 0.06);
}

.device-card:active {
  transform: translateY(1px) scale(0.97) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}

.device-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.device-icon img {
  width: 28px;
  height: 28px;
}

.device-name {
  font-size: 0.65rem;
  font-weight: 600;
  color: #1d1d1f;
  text-align: center;
  line-height: 1.2;
  position: relative;
  z-index: 2;
}

.device-type {
  font-size: 0.55rem;
  font-weight: 400;
  color: #86868b;
  text-align: center;
  position: relative;
  z-index: 2;
}

.device-status-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  z-index: 2;
}

/* ---- Device specs in detail panel ---- */
.device-specs-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.6), rgba(240,240,245,0.5));
  border: 0.5px solid rgba(255,255,255,0.6);
}

.device-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.device-spec-row + .device-spec-row {
  border-top: 0.5px solid rgba(0, 0, 0, 0.05);
}

.device-spec-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.device-spec-value {
  font-size: 0.8rem;
  font-weight: 500;
  color: #1d1d1f;
}

.device-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ---- Virtual Assets Row ---- */
#virtual-row {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 6;
  pointer-events: auto;
}

#software-row {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 6;
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
}

.software-card {
  min-width: 90px;
  max-width: 110px;
}

/* ---- Persona Row ---- */
#persona-row {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: calc(40px * var(--ls, 1));
  z-index: 6;
  pointer-events: auto;
  align-items: center;
}

#persona-row-label {
  position: absolute;
  left: 0;
  width: 100%;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86868b;
  white-space: nowrap;
  text-align: center;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
}

.persona-bubble {
  width: calc(75px * var(--ls, 1));
  height: calc(75px * var(--ls, 1));
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform-origin: center center;
  will-change: transform, opacity;

  /* 3D sphere gradient — same as .main-bubble, scaled */
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.25) 0%, transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.3) 0%, transparent 55%),
    radial-gradient(
      circle at 38% 32%,
      var(--color-highlight),
      var(--color-main) 40%,
      var(--color-deep) 85%
    );

  /* Physical button shadow — scaled for smaller bubble */
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.08),
    0 20px 40px var(--shadow-heavy),
    0 8px 20px var(--shadow-medium),
    0 3px 7px rgba(0, 0, 0, 0.12),
    inset 0 2px 5px rgba(255, 255, 255, 0.4),
    inset 0 -5px 16px rgba(0, 0, 0, 0.3),
    inset 0 0 3px rgba(0, 0, 0, 0.1);

  /* Idle floating animation — disabled for cleaner layout */
  /* animation: bubble-float var(--float-duration, 7s) ease-in-out infinite; */
  /* animation-delay: var(--float-delay, 0s); */

  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* Specular glare — scaled */
.persona-bubble::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 16%;
  width: 38%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 255, 255, 0.75),
    rgba(255, 255, 255, 0.35) 35%,
    rgba(255, 255, 255, 0.08) 60%,
    transparent 75%
  );
  pointer-events: none;
  z-index: 2;
  filter: blur(2px);
}

/* Edge definition ring — scaled */
.persona-bubble::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.05) 25%,
    transparent 45%,
    transparent 55%,
    rgba(0, 0, 0, 0.12) 80%,
    rgba(0, 0, 0, 0.18) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.persona-bubble .bubble-avatar {
  width: calc(40px * var(--ls, 1));
  height: calc(40px * var(--ls, 1));
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 3;
}

.persona-bubble .bubble-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.persona-bubble .bubble-name {
  font-size: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 3;
}

/* Hover — lift */
.persona-bubble:hover {
  transform: scale(1.08) translateY(-4px) !important;
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.06),
    0 25px 50px var(--shadow-heavy),
    0 12px 25px var(--shadow-medium),
    0 4px 10px rgba(0, 0, 0, 0.12),
    inset 0 2px 5px rgba(255, 255, 255, 0.45),
    inset 0 -5px 16px rgba(0, 0, 0, 0.3),
    inset 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Press — sink */
.persona-bubble:active {
  transform: scale(0.95) translateY(2px) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.1),
    0 5px 10px var(--shadow-heavy),
    0 2px 5px var(--shadow-medium),
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 3px rgba(255, 255, 255, 0.2),
    inset 0 -6px 18px rgba(0, 0, 0, 0.35),
    inset 0 0 4px rgba(0, 0, 0, 0.15) !important;
}

/* Pause floating during expand */
.persona-bubble.no-float {
  animation-play-state: paused;
  translate: 0 0;
}

/* ---- Row Section Labels ---- */
.row-label {
  position: absolute;
  left: 0;
  width: 100%;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86868b;
  white-space: nowrap;
  text-align: center;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
}

/* ---- Asset Pill Row ---- */
#asset-pill-row {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: calc(14px * var(--ls, 1));
  z-index: 6;
  pointer-events: auto;
  align-items: center;
}

.asset-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(8px * var(--ls, 1));
  padding: calc(10px * var(--ls, 1)) calc(18px * var(--ls, 1));
  border-radius: 22px;
  cursor: pointer;
  opacity: 0;

  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.88),
    rgba(232, 234, 240, 0.8)
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  border: 0.5px solid rgba(200, 200, 210, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 3px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 2px rgba(255, 255, 255, 0.9),
    inset 0 -1px 4px rgba(0, 0, 0, 0.04);

  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

/* Glossy surface overlay */
.asset-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.1) 30%,
    transparent 50%,
    rgba(0, 0, 0, 0.03) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.asset-pill:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.12),
    0 6px 14px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 1),
    inset 0 -1px 6px rgba(0, 0, 0, 0.06);
}

.asset-pill:active {
  transform: translateY(1px) scale(0.97) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}

.asset-pill.active {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.15),
    0 14px 36px rgba(0, 0, 0, 0.12),
    0 6px 14px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 1),
    inset 0 -1px 6px rgba(0, 0, 0, 0.06);
}

.pill-icon {
  font-size: calc(18px * var(--ls, 1));
  line-height: 1;
  position: relative;
  z-index: 2;
}

.pill-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #1d1d1f;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.pill-count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: calc(20px * var(--ls, 1));
  height: calc(20px * var(--ls, 1));
  padding: 0 calc(5px * var(--ls, 1));
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.6rem;
  font-weight: 700;
  color: #86868b;
  position: relative;
  z-index: 2;
}

/* ---- Project Documents Row (pill-based, same as Assets) ---- */
#project-docs-row {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  gap: calc(12px * var(--ls, 1));
  padding: 0 24px;
  justify-content: center;
  align-items: center;
  z-index: 6;
  pointer-events: auto;
}

#worker-logs-row {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  gap: calc(12px * var(--ls, 1));
  padding: 0 24px;
  justify-content: center;
  align-items: center;
  z-index: 6;
  pointer-events: auto;
}

/* ---- Digital Team Row ---- */
#digital-team-row {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: calc(14px * var(--ls, 1));
  z-index: 6;
  pointer-events: auto;
  align-items: center;
}

.digital-team-pill {
  padding-bottom: calc(8px * var(--ls, 1)) !important;
}

/* ---- Management Tools Row ---- */
#mgmt-tools-row {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: calc(14px * var(--ls, 1));
  z-index: 6;
  pointer-events: auto;
  align-items: center;
}

/* ---- Animated Radar Logo (Canvas) — top-left under nav header ---- */
#radar-logo {
  position: absolute;
  top: 68px;
  left: 28px;
  width: auto;
  display: flex;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
}

#radar-logo canvas {
  display: block;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.18));
  border-radius: 50%;
}

/* Expanded grid for cards below active pill */
.asset-expanded-grid {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(14px * var(--ls, 1));
  max-width: 90vw;
  margin: 0 auto;
  right: 0;
  z-index: 6;
  pointer-events: auto;
}

/* ---- F1.1 Digital Properties — Grouped Card Layout ---- */
.dp-category {
  width: 100%;
  margin-bottom: 24px;
}

.dp-category-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 1px;
  border-bottom: 1.5px solid #E5E7EB;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.dp-hosting-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 14px;
}

.dp-property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.dp-property-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1.5px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  opacity: 0;
}

.dp-property-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}

/* Padlock — compliance indicator */
.dp-padlock {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 16px;
  cursor: help;
  z-index: 2;
}

.dp-padlock.compliant {
  color: #D4A017;
  filter: drop-shadow(0 1px 2px rgba(212, 160, 23, 0.3));
}

.dp-padlock.non-compliant {
  color: #dc2626;
}

.dp-padlock-tooltip {
  display: none;
  position: absolute;
  top: 24px;
  right: 0;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dp-padlock:hover .dp-padlock-tooltip {
  display: block;
}

/* Top row: icon + name + description */
.dp-prop-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dp-prop-icon {
  font-size: 24px;
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-prop-info {
  flex: 1;
  min-width: 0;
}

.dp-prop-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.dp-asset-id {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 10px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 6px;
  font-weight: 500;
}

.dp-prop-desc {
  font-size: 12px;
  color: #64748B;
  line-height: 1.3;
  margin-top: 2px;
}

/* URL row */
.dp-prop-url {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-prop-url a {
  color: #94a3b8;
  text-decoration: none;
}

.dp-prop-url a:hover {
  text-decoration: underline;
  color: #64748b;
}

/* Bottom row: status pill + plug icon */
.dp-prop-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* Status pills */
.dp-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.dp-status.api-connected {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.dp-status.in-progress {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.dp-status.manual {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.dp-status.not-connected {
  background: #f9fafb;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

/* Plug connection icons */
.dp-conn-live {
  color: #2563eb;
}

.dp-conn-broken {
  color: #dc2626;
}

.dp-conn-pending {
  color: #9ca3af;
}

/* ---- Icon Legend ---- */
.dp-legend {
  margin-top: 32px;
  margin-bottom: 120px;
  padding: 24px 28px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.dp-legend-title {
  font-size: 14px;
  font-weight: 700;
  color: #1d1d1f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.dp-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
}

.dp-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dp-legend-icon {
  flex-shrink: 0;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
}

.dp-legend-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dp-legend-text strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #1d1d1f;
}

.dp-legend-text span {
  font-size: 11.5px;
  color: #6e6e73;
  line-height: 1.4;
}
