/* SemAI — expert network map */

.em-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 28px 14px; }
.em-head h1 { margin: 0; display: flex; align-items: center; gap: 14px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.em-head h1 .badge { font-size: 12px; height: 26px; padding: 0 12px; border-radius: 999px; font-weight: 500; }
.em-head p { margin: 4px 0 0; color: #475569; font-size: 14.5px; }
.em-toggles { display: flex; align-items: center; gap: 22px; }
.tg { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: #334155; cursor: pointer; }
.icon-btn.boxed { border: 1px solid var(--line); border-radius: 10px; }
.icon-btn.boxed svg { width: 18px; height: 18px; }

.em-layout { grid-template-columns: 300px minmax(0, 1fr) 370px; min-height: calc(100vh - 160px); }
.em-layout .filters { border-right: 0; padding-top: 0; gap: 0; }
.tabs { display: flex; gap: 16px; white-space: nowrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 10px 0 12px; font-size: 13.5px; color: #475569; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.is-on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.f-block { padding: 12px 0 14px; }
.f-block h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
.f-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.f-row h3 { margin: 0; }
.mini-tag { font-size: 12px; color: #64748b; background: #f1f4f9; padding: 3px 9px; border-radius: 6px; }
.field-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.fc { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #475569; font-size: 13.5px; font-weight: 500; transition: .15s; }
.fc img { width: 24px; height: 24px; object-fit: contain; filter: grayscale(1) brightness(.6); transition: .15s; }
.fc.is-on { background: var(--bg); color: var(--c); border-color: transparent; }
.fc.is-on img { filter: none; }
.check-row .ri { width: 18px; height: 18px; color: #475569; }
.toggles { display: grid; gap: 14px; }
.tg-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #334155; cursor: pointer; }

/* graph */
.graph-wrap {
  position: relative; border-radius: 6px; overflow: hidden; min-height: 640px;
  background: #050a1c url(../img/bg-trails.webp) center / cover no-repeat;
}
.graph-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(5,10,28,.35), rgba(5,10,28,.85)); pointer-events: none; }
.graph-wrap:fullscreen { border-radius: 0; }
#graph { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; user-select: none; touch-action: none; }
#graph.dragging { cursor: grabbing; }

.spark { fill: #8fd3ff; animation: twinkle 3.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }
.edge { fill: none; stroke-width: 1; opacity: .35; transition: opacity .3s, stroke .3s; }
.spec-edge { stroke-width: 1.4; opacity: .45; }
.spec-edge.cross { stroke-dasharray: 3 5; opacity: .3; }
.mem-edge { stroke-dasharray: 2 4; }
.proj-edge { opacity: .4; stroke-dasharray: 1 4; }
.edge.hot { opacity: .95; stroke-width: 2.2; filter: url(#glow); stroke-dasharray: none; }
.edge.dim { opacity: .05; }
.flow-dot { fill: #b6fff0; filter: url(#glow); }

.title text { font-size: 26px; font-weight: 700; letter-spacing: -.01em; filter: url(#glow); }
.title, .proj, .spec, .mem { transition: opacity .3s; }
.title.dim, .proj.dim, .spec.dim, .mem.dim { opacity: .12; }

.spec { cursor: pointer; outline: none; }
.spec .halo { opacity: .28; transition: .3s; }
.spec .core { fill: #0a1434; fill-opacity: .92; stroke-width: 2.5; transition: .3s; }
.spec .ring { fill: none; stroke: transparent; stroke-width: 2; }
.spec text { fill: #fff; font-size: 13px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.spec:hover .halo, .spec:focus-visible .halo { opacity: .55; }
.spec:focus-visible .ring { stroke: #fff; stroke-dasharray: 4 4; }
.spec.is-sel .core { stroke: #34f5c5; fill: #0b2f3a; }
.spec.is-sel .halo { fill: #34f5c5; opacity: .55; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: .7; } }

.mem { cursor: pointer; outline: none; }
.mem circle { fill: #101b3f; stroke-width: 1.5; stroke-opacity: .7; transition: .2s; }
.mem text { fill: #dbe4ff; font-size: 11.5px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.mem:hover circle, .mem:focus-visible circle { fill: #1c2c63; stroke-opacity: 1; }
.mem.is-sel circle { stroke: #34f5c5; stroke-opacity: 1; }
.mem.is-me circle { fill: #10b981; stroke: #b6fff0; }
.mem.is-me text { fill: #fff; }
.proj { cursor: pointer; filter: url(#glow); outline: none; }
.proj:hover rect, .proj:focus-visible rect { stroke: #fff; stroke-width: 2; }

#graph.no-members .g-members, #graph.no-members .mem-edge { display: none; }
#graph.no-projects .g-proj { display: none; }
#graph.no-links .g-links .edge, #graph.no-links .g-flow { display: none; }
#graph.no-fx .spark, #graph.no-fx .spec.is-sel .halo { animation: none; }
#graph.no-fx .edge.hot, #graph.no-fx .proj, #graph.no-fx .title text { filter: none; }

.sim-path { fill: none; stroke: #fff; stroke-width: 3.5; filter: url(#glow); stroke-linecap: round; }
.sim-ring { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 6 6; opacity: .8; }
.sim-dot { fill: #fff; filter: url(#glow); }

.tip { position: absolute; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .15s; background: rgba(10,18,42,.95); border: 1px solid rgba(148,163,230,.3); color: #b9c5e6; font-size: 12px; padding: 8px 12px; border-radius: 10px; max-width: 220px; }
.tip b { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }
.tip.show { opacity: 1; }

.g-bottom { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 4; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.now b { color: #34f5c5; font-size: 14px; }
.live { width: 10px; height: 10px; border-radius: 50%; background: #34f5c5; box-shadow: 0 0 0 4px rgba(52,245,197,.2); display: inline-block; }
.legend2 { gap: 20px; font-size: 12px; }
.legend2 span { display: inline-flex; align-items: center; gap: 8px; }
.l-spec, .l-mem { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #4f8dff; display: inline-block; }
.l-mem { border-color: #8899c6; background: #3a4a7a; }
.l-proj { width: 10px; height: 10px; background: #a78bfa; transform: rotate(45deg); display: inline-block; }
.l-link { width: 24px; height: 2px; background: #6aa9ff; display: inline-block; }
.g-ctrl { display: flex; gap: 10px; margin-left: auto; }
.g-ctrl button.dark-pill { cursor: pointer; }
.g-ctrl svg { width: 17px; height: 17px; }
.zoom { padding: 0; gap: 0; overflow: hidden; }
.zoom button { height: 100%; width: 42px; border: 0; background: none; color: #dbe4ff; display: grid; place-items: center; }
.zoom button:hover, .g-ctrl button.dark-pill:hover { background: rgba(255,255,255,.08); }
.zoom span { min-width: 64px; text-align: center; border-inline: 1px solid rgba(148,163,230,.2); line-height: 40px; }

/* panel */
.em-panel { gap: 0; padding: 0 22px 20px; }
.em-panel section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.em-panel section:last-child { border-bottom: 0; }
.ep-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ep-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.ep-head span { font-size: 11.5px; color: #64748b; white-space: nowrap; }
.ep-desc { margin: 10px 0 16px; font-size: 13px; line-height: 1.6; color: #475569; }
.ep-h { margin: 0 0 12px; font-size: 14.5px; font-weight: 600; color: #334155; }
.ep-h.big { font-size: 16px; color: var(--ink); }
.ep-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-skills span { height: 30px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 12.5px; background: #f1f4f9; color: #334155; }
.ep-skills span.on { background: #ddf8ef; color: #0f9d84; font-weight: 600; }

.member-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.mc-top { display: flex; gap: 12px; align-items: center; position: relative; }
.mc-av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; flex: none; }
.mc-top b { display: block; font-size: 16px; color: var(--ink); }
.mc-top small { font-size: 12.5px; color: #64748b; }
.mc-demo { position: absolute; top: 0; right: 0; font-size: 11px; color: var(--blue); background: #eef3ff; padding: 3px 8px; border-radius: 6px; }
.mc-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: #475569; }
.mc-row b { color: var(--ink); font-weight: 500; }
.mc-row svg { width: 16px; height: 16px; }
.mc-row.ok { color: #0f9d84; }
.mc-row .live { width: 8px; height: 8px; box-shadow: 0 0 0 3px rgba(52,245,197,.25); background: #10b981; }
.mc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.mc-actions .btn { height: 40px; border-radius: 10px; font-size: 13.5px; padding: 0 10px; }

.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.related button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--ink); padding: 0 8px; }
.related button:hover { border-color: var(--c); }
.related svg { width: 18px; height: 18px; color: var(--c); flex: none; }

.field-select.sm { height: 42px; margin-bottom: 10px; font-size: 13.5px; }
.field-select .lbl { color: #64748b; white-space: nowrap; }
.btn.sim { width: 100%; height: 46px; border-radius: 10px; background: #1641b8; color: #fff; margin: 4px 0 16px; }
.btn.sim:hover { background: #1236a0; }
.player { display: flex; align-items: center; gap: 14px; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #1d5cff; color: #fff; display: grid; place-items: center; flex: none; }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.speed { width: 44px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: #334155; flex: none; }
.player input[type=range] { flex: 1; accent-color: #1d5cff; }
.ep-foot { margin: 12px 0 0; font-size: 12.5px; color: #64748b; line-height: 1.5; }
.ep-foot b { color: var(--ink); font-weight: 600; }

@media (max-width: 1280px) {
  .em-layout { grid-template-columns: 260px minmax(0, 1fr) 330px; }
    .legend2 { display: none; }
}
@media (max-width: 1080px) {
  .em-layout { grid-template-columns: 1fr; }
  .em-layout .filters { padding-top: 0; }
  .graph-wrap { min-height: 0; aspect-ratio: 970 / 780; }
}
@media (max-width: 640px) {
  .em-head { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .em-head h1 { font-size: 22px; }
  .em-toggles { gap: 14px; flex-wrap: wrap; }
  .graph-wrap { aspect-ratio: auto; height: 560px; }
  .g-bottom { left: 8px; right: 8px; bottom: 8px; }
  .now { display: none; }
  .related { grid-template-columns: 1fr; }
}

/* compact rhythm so the explorer fits a laptop screen */
@media (min-width: 1081px) {
  .em-head { padding: 10px 28px 10px; }
  .em-head h1 { font-size: 24px; }
  .em-head p { margin-top: 2px; font-size: 13.5px; }
  .em-layout { min-height: 0; }
  .em-panel section { padding: 12px 0; }
  .ep-desc { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.5; }
  .ep-h { margin-bottom: 8px; }
  .ep-skills { gap: 6px; }
  .ep-skills span { height: 26px; padding: 0 11px; }
  .member-card { padding: 12px 14px; }
  .mc-av { width: 44px; height: 44px; font-size: 16px; }
  .mc-row { margin-top: 8px; }
  .mc-actions { margin-top: 10px; }
  .mc-actions .btn { height: 36px; }
  .related button { height: 38px; }
  .field-select.sm { height: 38px; margin-bottom: 8px; }
  .btn.sim { height: 40px; margin: 2px 0 10px; }
  .play { width: 36px; height: 36px; }
  .speed { height: 32px; }
  .ep-foot { margin-top: 8px; }
  .f-block { padding: 8px 0 10px; }
  .tabs { margin-bottom: 12px; }
  .toggles { gap: 10px; }
}
@media (min-width: 1081px) and (max-height: 800px) {
  .em-head p { display: none; }
  .em-panel .ep-desc { display: none; }
}
@media (min-width: 1081px) {
  .tabs { gap: 12px; }
  .tabs button { font-size: 13px; }
  .g-bottom { flex-wrap: nowrap; }
}
@media (min-width: 1081px) and (max-width: 1560px) { .legend2 { display: none; } }
@media (min-width: 1081px) and (max-height: 860px) {
  .em-panel section { padding: 8px 0; }
  .ep-head span { display: none; }
  .ep-skills span { height: 24px; font-size: 12px; }
  .mc-row:not(.ok) { display: none; }
  .mc-actions .btn { height: 32px; font-size: 13px; }
  .related button { height: 34px; font-size: 12px; }
  .field-select.sm { height: 34px; }
  .btn.sim { height: 36px; }
  .em-panel .ep-foot { display: none; }
  .f-block { padding: 6px 0 8px; }
  .fc { height: 34px; }
  .field-select { height: 38px; }
}
