/* Desktop constellation experience */
.desktop-network-canvas,
.desktop-network-tooltip,
.desktop-network-legend,
.desktop-detail-close{display:none}

@media (min-width:781px){
  body{
    background:#f2f0e9;
  }

  .view-nav{
    position:sticky;
    top:0;
    z-index:50;
    max-width:none;
    padding:0 max(24px,calc((100vw - 1600px)/2));
    background:rgba(244,242,236,.94);
    -webkit-backdrop-filter:blur(18px);
    backdrop-filter:blur(18px);
    border-top:1px solid rgba(23,33,43,.08);
    border-bottom:1px solid rgba(23,33,43,.14);
  }

  .view-nav button{
    min-height:56px;
    border-right:1px solid rgba(23,33,43,.08);
  }

  body[data-view="network"] .topbar,
  body[data-view="matrix"] .topbar,
  body[data-view="paths"] .topbar{
    display:none;
  }

  .layout{
    position:relative;
    max-width:1600px;
    grid-template-columns:220px minmax(0,1fr);
    border:0;
    gap:0;
    padding:22px 24px 32px;
  }

  .filters{
    position:sticky;
    top:78px;
    align-self:start;
    height:calc(100vh - 104px);
    overflow:auto;
    padding:18px 18px 28px 0;
    border:0;
    border-right:1px solid rgba(23,33,43,.12);
    background:transparent;
    scrollbar-width:thin;
  }

  .search input{
    font-size:13px;
    padding:9px 0 11px;
  }

  .kit-list button,.chips button{
    padding:8px 0;
    font-size:11px;
  }

  .distance-legend button{
    padding:9px 0;
  }

  .main-panel{
    min-height:calc(100vh - 112px);
    padding:0 0 0 24px;
    background:transparent;
  }

  #view-network .view-head{
    margin:0;
    padding:8px 0 15px;
    border:0;
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:28px;
  }

  #view-network .view-head h2{
    font-size:36px;
    letter-spacing:-.035em;
  }

  #view-network .view-head p{
    max-width:430px;
    text-align:right;
    font-size:11px;
    line-height:1.65;
  }

  #view-network .map-actions{
    margin:0 0 12px;
    min-height:36px;
    display:flex;
    gap:7px;
    align-items:center;
  }

  #view-network .map-actions button{
    min-height:34px;
    margin:0;
    padding:7px 12px;
    border:1px solid rgba(23,33,43,.12);
    border-radius:999px;
    background:rgba(255,255,255,.66);
    color:#465564;
    font-size:10px;
    cursor:pointer;
  }

  #view-network .map-actions button:hover{
    border-color:#7f8d99;
    background:#fff;
  }

  .graph-wrap{
    position:relative;
    width:100%;
    height:calc(100vh - 200px);
    min-height:620px;
    max-height:860px;
    aspect-ratio:auto;
    overflow:hidden;
    border:1px solid rgba(23,33,43,.10);
    border-radius:24px;
    background:
      radial-gradient(circle at 15% 12%,rgba(103,143,184,.09),transparent 24%),
      radial-gradient(circle at 83% 18%,rgba(139,126,153,.08),transparent 24%),
      radial-gradient(circle at 68% 80%,rgba(102,142,130,.08),transparent 25%),
      linear-gradient(180deg,#fbfaf6 0%,#f3f1ea 100%);
    box-shadow:0 22px 60px rgba(34,46,58,.08);
  }

  .graph-wrap:before{
    content:"";
    position:absolute;
    inset:0;
    z-index:0;
    pointer-events:none;
    background-image:
      linear-gradient(rgba(23,33,43,.025) 1px,transparent 1px),
      linear-gradient(90deg,rgba(23,33,43,.025) 1px,transparent 1px);
    background-size:36px 36px;
  }

  #view-network #graph{
    opacity:0;
    pointer-events:none;
  }

  .desktop-network-canvas{
    display:block;
    position:absolute;
    z-index:3;
    inset:0;
    width:100%;
    height:100%;
    cursor:grab;
    touch-action:none;
  }

  .desktop-network-canvas.is-panning{cursor:grabbing}

  .desktop-network-tooltip{
    display:none;
    position:absolute;
    z-index:20;
    width:248px;
    padding:12px 13px;
    border:1px solid rgba(23,33,43,.12);
    border-radius:14px;
    background:rgba(255,255,255,.94);
    box-shadow:0 15px 40px rgba(24,38,52,.14);
    -webkit-backdrop-filter:blur(18px);
    backdrop-filter:blur(18px);
    pointer-events:none;
  }

  .desktop-network-tooltip.is-visible{display:block}
  .desktop-network-tooltip .tip-head{
    display:flex;
    align-items:center;
    gap:10px;
  }
  .desktop-network-tooltip .mini-avatar{
    width:38px;
    height:38px;
  }
  .desktop-network-tooltip b{
    display:block;
    font-size:12px;
    color:#17283a;
  }
  .desktop-network-tooltip small{
    display:block;
    margin-top:3px;
    font-size:9px;
    color:#78838c;
  }
  .desktop-network-tooltip .tip-meta{
    margin-top:9px;
    padding-top:8px;
    border-top:1px solid #ece8df;
    display:flex;
    justify-content:space-between;
    gap:10px;
    font-size:9px;
    color:#6c7882;
  }

  .desktop-network-legend{
    display:flex;
    position:absolute;
    z-index:11;
    left:18px;
    bottom:16px;
    gap:16px;
    align-items:center;
    padding:8px 10px;
    border-radius:999px;
    background:rgba(255,255,255,.72);
    font-size:9px;
    color:#68737d;
    pointer-events:none;
    -webkit-backdrop-filter:blur(12px);
    backdrop-filter:blur(12px);
  }

  .desktop-network-legend span{
    display:inline-flex;
    align-items:center;
    gap:5px;
  }
  .desktop-network-legend i{
    width:7px;height:7px;border-radius:50%;background:#6f8fae;
  }
  .desktop-network-legend span:nth-child(2) i{background:#668e82}
  .desktop-network-legend span:nth-child(3) i{background:#a58b68}

  .detail{
    position:fixed;
    z-index:120;
    top:0;
    right:0;
    width:min(390px,36vw);
    height:100vh;
    overflow-y:auto;
    padding:26px 24px 36px;
    border:0;
    border-left:1px solid #40505d;
    background:#17232e;
    box-shadow:-20px 0 55px rgba(13,25,36,.18);
    transform:translateX(102%);
    transition:transform .26s cubic-bezier(.22,.75,.25,1);
    visibility:hidden;
  }

  body.desktop-detail-open .detail{
    transform:translateX(0);
    visibility:visible;
  }

  .detail .empty-state{display:none}

  .desktop-detail-close{
    display:flex;
    position:sticky;
    z-index:4;
    top:0;
    margin:-10px 0 14px auto;
    width:38px;
    height:38px;
    align-items:center;
    justify-content:center;
    border:1px solid #435564;
    border-radius:50%;
    background:#223441;
    color:#eef2f4;
    cursor:pointer;
  }

  .desktop-detail-close:hover{background:#2c4252}

  body.desktop-detail-open .main-panel{
    padding-right:0;
  }

  .profile-head h2{font-size:25px}
  .why{font-size:12px}
  .links a,.relation,.rec{font-size:10px}

  /* Matrix: keep avatars readable instead of giant 100x100 grid */
  #view-matrix .matrix-wrap{
    max-height:calc(100vh - 190px);
    border:1px solid rgba(23,33,43,.12);
    border-radius:18px;
    box-shadow:0 16px 40px rgba(34,46,58,.06);
  }

  /* Follow paths: lighter desktop cards */
  #view-paths .follow-path{
    gap:10px;
    border:0;
  }
  #view-paths .path-column{
    border:1px solid rgba(23,33,43,.10);
    border-radius:16px;
    overflow:hidden;
    background:rgba(255,255,255,.46);
  }
}

@media (min-width:1500px){
  .layout{grid-template-columns:230px minmax(0,1fr)}
  .graph-wrap{height:calc(100vh - 190px)}
}
