/* ==========================================================================
   Basheer K. K. — portfolio stylesheet
   Tokens: ink / navy / spruce on a cool paper ground, contour-line motif.
   ========================================================================== */
:root {
    --paper: #F7F8F6;
    --card-bg: #FFFFFF;
    --ink: #18261F;
    --text-main: #2E3A35;
    --text-muted: #5E6B65;
    --accent: #1F5240;
    --accent-hover: #163C2F;
    --spruce: #2F6B4F;
    --spruce-soft: #E8F1EC;
    --border-light: #DCE3DE;
    --focus: #C98B1E;
    --radius-lg: 14px;
    --radius-md: 10px;
    --font-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html { font-size: 15px; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
@media (min-width: 1024px) { html { font-size: 16px; } }

body {
    font-family: var(--font-sans);
    background-color: var(--paper);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > main { flex: 1 0 auto; }
body.overflow-hidden { overflow: hidden; }

/* Contour-line background: a quiet cartographic texture, fixed behind content */
.contour-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url('contours.svg');
    background-size: cover;
    background-position: center top;
    opacity: 0.075;
}
main, footer, header { position: relative; }

h1, h2, h3, h4, h5, h6 { color: var(--ink); }
h1, .section-heading, .font-serif { font-family: var(--font-serif); }
h1 { letter-spacing: -0.015em; }

a { font-weight: 600; text-decoration: none; color: var(--accent); transition: color .2s; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; color: #fff; }

.font-mono { font-family: var(--font-mono); }

/* Sections */
.page-section { padding: 2.75rem 0; position: relative; z-index: 10; }
@media (min-width: 768px) { .page-section { padding: 4.25rem 0; } }
@media (min-width: 1024px) { .page-section { padding: 5rem 0; } }
@media (prefers-reduced-motion: no-preference) {
    .page-section { animation: fadeIn .45s cubic-bezier(.2,.8,.2,1) both; }
}
/* ends at transform:none so fixed-position children are never trapped */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Header */
.glass-header {
    background: rgba(246, 248, 250, .9);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s, box-shadow .25s;
}
.glass-header.is-scrolled { border-bottom-color: var(--border-light); box-shadow: 0 6px 18px -14px rgba(24, 38, 31, .35); }
.brand-mark { font-family: var(--font-serif); font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.brand-mark small { font-family: var(--font-sans); font-weight: 500; color: var(--text-muted); letter-spacing: 0; }

.text-accent { color: var(--accent); }
.bg-accent { background-color: var(--accent); color: #fff; }
.border-accent { border-color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-spruce { color: var(--spruce); }

/* Headings */
.section-heading, .subsection-heading { position: relative; display: inline-block; color: var(--ink); }
.section-heading { font-size: clamp(1.75rem, 4.2vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.subsection-heading { font-size: clamp(1.2rem, 2.4vw, 1.45rem); font-weight: 700; letter-spacing: -.01em; }
.section-heading::after, .subsection-heading::after {
    content: ''; position: absolute; bottom: -9px; left: 0; width: 40px; height: 3px;
    background: var(--accent); border-radius: 2px;
}
.lede { font-size: 1.05rem; color: var(--text-muted); max-width: 46rem; line-height: 1.7; }

/* Cards */
.dashboard-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    position: relative;
    z-index: 20;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(24, 38, 31, .04);
    transition: border-color .2s, box-shadow .2s;
}
a.dashboard-card:hover, button.dashboard-card:hover, .dashboard-card.is-interactive:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 24px -14px rgba(31, 82, 64, .35);
}

/* Navigation */
.nav-link { position: relative; cursor: pointer; color: var(--text-main); font-weight: 500; text-decoration: none; }
.nav-link:hover { color: var(--accent); }
.nav-link::after {
    content: ''; position: absolute; height: 2px; bottom: 2px; left: .75rem; right: .75rem;
    background-color: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--accent); font-weight: 650; }
.nav-cta { background: var(--spruce); color: #fff !important; border-radius: 999px; }
.nav-cta::after { display: none; }
.nav-cta:hover, .nav-cta.active { background: #245640; }

/* Research posts */
.research-post {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(24, 38, 31, .04);
}

/* Portrait */
.profile-pic-container img { border: 4px solid var(--card-bg); box-shadow: 0 14px 30px -12px rgba(24, 38, 31, .35); }

/* Contact send button */
.get-in-touch-btn {
    position: relative; background: var(--card-bg); border: 2px solid var(--accent); color: var(--accent);
    overflow: hidden; z-index: 1; width: 76px; height: 76px; transition: background .25s, transform .25s;
}
.get-in-touch-btn:hover { background: rgba(31, 82, 64, .06); transform: translateY(-2px); }
.get-in-touch-btn .rocket-icon { transition: transform .5s cubic-bezier(.68,-.55,.27,1.55); }
.get-in-touch-btn:hover .rocket-icon { transform: translate(40px, -40px); }

/* Skills */
.bento-card { background: var(--card-bg); border-radius: var(--radius-lg); padding: 22px; border: 1px solid var(--border-light); }
.tagcloud { font-family: var(--font-mono); font-size: clamp(11px, 2vw, 13px); font-weight: 600; color: var(--accent); margin: 0 auto; }
.tagcloud--item { padding: 3px 9px; background: rgba(255,255,255,.9); border: 1px solid rgba(31,82,64,.18); border-radius: 6px; cursor: default; }
.tagcloud--item:hover { color: #fff; background: var(--accent); z-index: 50; }

/* Timeline (experience / education) */
.timeline { position: relative; margin-left: .5rem; padding-left: 1.75rem; border-left: 2px solid var(--border-light); }
.timeline-item { position: relative; padding-bottom: 2.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: calc(-1.75rem - 8px); top: .35rem; width: 14px; height: 14px; border-radius: 50%; background: var(--card-bg); border: 3px solid var(--accent); }
.timeline-item h2, .timeline-item h3 { font-family: var(--font-serif); }

/* Publications */
.journal-author-link { display: inline-block; color: #1e293b; font-weight: 600; cursor: pointer; border-bottom: 1px dotted #94a3b8; padding-bottom: 1px; }
.journal-author-link:hover, .journal-author-link.active-author { color: var(--accent); border-bottom: 1.5px solid var(--accent); }
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.leaflet-container { font-family: var(--font-sans) !important; z-index: 10; }
mark.search-highlight { background-color: #fef08a; color: #0f172a; padding: 0 2px; border-radius: 2px; font-weight: 700; }
.pub-action-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
    border-radius: .5rem; border: 1px solid #e2e8f0; background-color: #fff; color: #475569; font-size: .85rem;
    transition: all .2s cubic-bezier(.2,.8,.2,1); cursor: pointer; text-decoration: none;
}
.pub-action-icon:hover { border-color: var(--accent); color: var(--accent); background-color: #EEF4F0; }
.pub-action-icon.pdf-download:hover { border-color: #0d9488; color: #0d9488; background-color: #f0fdfa; }
.leaflet-popup-content-wrapper { border-radius: 12px !important; box-shadow: 0 10px 25px -5px rgba(31,82,64,.18) !important; border: 1px solid #e2e8f0 !important; padding: 2px !important; }
.leaflet-popup-content { margin: 10px 12px !important; line-height: 1.45 !important; }

/* Filter bar: sticky only on large screens (on phones it covered ~40% of the viewport) */
.filter-bar { position: relative; }
@media (min-width: 1024px) { .filter-bar { position: sticky; top: 5.5rem; } }

/* ---------- COST Action cards ---------- */
.cost-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem 1.25rem 1.1rem; height: 100%; color: inherit; font-weight: 400; }
.cost-code { font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--accent); }
.cost-card h3 { font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.3; font-weight: 700; }
.cost-card p { font-size: .9rem; color: var(--text-muted); line-height: 1.55; }
.cost-card .cost-link { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Consultancy ---------- */
.service-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 480px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .service-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
.service-card {
    position: relative; display: flex; flex-direction: column; text-align: left;
    aspect-ratio: 1 / 1; padding: 1.4rem; border-radius: var(--radius-lg);
    background: var(--card-bg); border: 1px solid var(--border-light); color: var(--text-main); font-weight: 400;
    transition: border-color .2s, box-shadow .2s, transform .2s; cursor: pointer; overflow: hidden;
}
.service-card:hover, .service-card:focus-visible { border-color: var(--spruce); box-shadow: 0 16px 30px -18px rgba(47, 107, 79, .55); transform: translateY(-2px); }
.service-card .svc-icon { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; background: var(--spruce-soft); color: var(--spruce); font-size: 1.15rem; }
.service-card h3 { font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.25; margin-top: 1rem; font-weight: 700; }
.service-card p { font-size: .9rem; color: var(--text-muted); margin-top: .5rem; line-height: 1.5; }
.service-card .svc-cta { margin-top: auto; padding-top: .75rem; font-size: .88rem; font-weight: 600; color: var(--spruce); display: inline-flex; align-items: center; gap: .45rem; }
.service-card .svc-cta i { transition: transform .2s; }
.service-card:hover .svc-cta i { transform: translateX(3px); }
@media (max-width: 479px) { .service-card { aspect-ratio: auto; min-height: 13rem; } }
@media (min-width: 1024px) { .service-card { padding: 1.75rem; } .service-card h3 { font-size: 1.35rem; } .service-card p { font-size: .95rem; } }

.step-num { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--font-mono); font-size: .85rem; font-weight: 600; flex-shrink: 0; }

/* Booking dialog */
.consult-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 768px) { .consult-modal { align-items: center; padding: 1.5rem; } }
.consult-modal[hidden] { display: none; }
.consult-backdrop { position: absolute; inset: 0; background: rgba(24, 38, 31, .55); backdrop-filter: blur(3px); }
.consult-panel {
    position: relative; width: 100%; max-width: 46rem; max-height: 94vh; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 30px 60px -20px rgba(24, 38, 31, .45);
}
@media (min-width: 768px) { .consult-panel { border-radius: 18px; } }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: .35rem; }
.form-label .req { color: #B42318; }
.form-input {
    width: 100%; padding: .7rem .85rem; border: 1px solid #CBD5CE; border-radius: var(--radius-md); background: #fff;
    font-size: 16px; /* 16px stops iOS from zooming into fields */ color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 82, 64, .15); }
.form-input[aria-invalid="true"] { border-color: #B42318; }
.field-error { font-size: .8rem; color: #B42318; margin-top: .3rem; }
.date-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.date-chip {
    flex: 0 0 auto; scroll-snap-align: start; min-width: 4.6rem; padding: .55rem .5rem; border-radius: var(--radius-md);
    border: 1px solid #CBD5CE; background: #fff; text-align: center; cursor: pointer; line-height: 1.2; color: var(--ink);
}
.date-chip .dow { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 600; }
.date-chip .dnum { display: block; font-size: 1.15rem; font-weight: 700; font-family: var(--font-serif); }
.date-chip .mon { display: block; font-size: .72rem; color: var(--text-muted); }
.date-chip .avail { display: block; font-size: .68rem; margin-top: .2rem; color: var(--spruce); font-weight: 600; }
.date-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.date-chip[aria-pressed="true"] .dow, .date-chip[aria-pressed="true"] .mon, .date-chip[aria-pressed="true"] .avail { color: #DCE6DF; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .5rem; }
.slot-btn { padding: .6rem .5rem; border-radius: var(--radius-md); border: 1px solid #CBD5CE; background: #fff; font-weight: 600; color: var(--ink); cursor: pointer; text-align: center; }
.slot-btn small { display: block; font-weight: 500; font-size: .72rem; color: var(--text-muted); }
.slot-btn:hover { border-color: var(--spruce); }
.slot-btn[aria-pressed="true"] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.slot-btn[aria-pressed="true"] small { color: #E3F0E9; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; transition: background .2s; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-spruce { background: var(--spruce); }
.btn-spruce:hover { background: #245640; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid #CBD5CE; background: #fff; color: var(--ink); font-weight: 600; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Social icons row */
.social-btn { width: 2.6rem; height: 2.6rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border-light); color: var(--ink); transition: border-color .2s, color .2s, transform .2s; }
.social-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Page transitions
   - Chrome/Edge 126+ and Safari 18.2+: native cross-document View Transitions,
     direction-aware (forward/backward in menu order), header and footer stay put.
   - Other browsers: short fade handled in app.js.
   ========================================================================== */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

.glass-header { view-transition-name: site-header; }
footer { view-transition-name: site-footer; }
.contour-bg { view-transition-name: contours; }

::view-transition-group(site-header),
::view-transition-group(site-footer),
::view-transition-group(contours) { animation-duration: .25s; }
::view-transition-old(contours), ::view-transition-new(contours) { animation: none; }

::view-transition-old(root) { animation: vt-fade-out .22s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-rise-in .45s cubic-bezier(.16, 1, .3, 1) both; }

html:active-view-transition-type(forward)::view-transition-old(root) { animation: vt-slide-out-left .26s cubic-bezier(.4, 0, 1, 1) both; }
html:active-view-transition-type(forward)::view-transition-new(root) { animation: vt-slide-in-right .5s cubic-bezier(.16, 1, .3, 1) both; }
html:active-view-transition-type(backward)::view-transition-old(root) { animation: vt-slide-out-right .26s cubic-bezier(.4, 0, 1, 1) both; }
html:active-view-transition-type(backward)::view-transition-new(root) { animation: vt-slide-in-left .5s cubic-bezier(.16, 1, .3, 1) both; }

@keyframes vt-fade-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-rise-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes vt-slide-out-left { to { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-slide-in-right { from { opacity: 0; transform: translateX(36px); } }
@keyframes vt-slide-out-right { to { opacity: 0; transform: translateX(28px); } }
@keyframes vt-slide-in-left { from { opacity: 0; transform: translateX(-36px); } }

/* when the page arrives through a view transition, skip the separate section fade */
html.vt-nav .page-section { animation: none; }

/* fallback (no View Transitions): fade the main content out before leaving */
main { transition: opacity .18s ease, transform .18s ease; }
body.is-leaving main { opacity: 0; transform: translateY(-6px); }

/* ==========================================================================
   Co-authorship network explorer
   ========================================================================== */
.net-modal { position: fixed; inset: 0; z-index: 260; display: flex; align-items: stretch; justify-content: center; }
.net-modal[hidden] { display: none; }
.net-backdrop { position: absolute; inset: 0; background: rgba(24, 38, 31, .55); backdrop-filter: blur(3px); }
.net-shell {
    position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; height: 100dvh;
    background: #fff; overflow: hidden;
}
@media (min-width: 1024px) {
    .net-modal { padding: 2.5vh 2.5vw; }
    .net-shell { border-radius: 18px; height: 95vh; max-width: 1500px; box-shadow: 0 40px 80px -30px rgba(24, 38, 31, .6); }
}
@media (prefers-reduced-motion: no-preference) {
    .net-modal:not([hidden]) .net-shell { animation: net-in .35s cubic-bezier(.16, 1, .3, 1) both; }
    .net-modal:not([hidden]) .net-backdrop { animation: net-fade .3s ease both; }
}
@keyframes net-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes net-fade { from { opacity: 0; } }

.net-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem .6rem; border-bottom: 1px solid var(--border-light); }
@media (min-width: 768px) { .net-top { padding: 1rem 1.5rem .75rem; } }
.net-toolbar {
    display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border-light);
    background: #F8FAFC; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) { .net-toolbar { padding: .65rem 1.5rem; flex-wrap: wrap; overflow: visible; } }
.net-toolbar > * { flex-shrink: 0; }
.net-search { position: relative; }
.net-search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .8rem; }
.net-search input { width: 13rem; padding: .45rem .7rem .45rem 2rem; border: 1px solid #CBD5CE; border-radius: 999px; font-size: 16px; background: #fff; }
@media (min-width: 768px) { .net-search input { font-size: .85rem; } }
.net-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 82, 64, .15); }
.net-field { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.net-field select { padding: .38rem .5rem; border: 1px solid #CBD5CE; border-radius: 8px; background: #fff; font-size: .82rem; color: var(--ink); font-weight: 500; }
.net-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--ink); font-weight: 500; }
.net-check input { width: 1rem; height: 1rem; accent-color: var(--accent); }
.net-sep { width: 1px; height: 1.4rem; background: var(--border-light); margin: 0 .15rem; }
.net-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .75rem; border-radius: 999px; border: 1px solid #CBD5CE; background: #fff; color: var(--ink); font-size: .82rem; font-weight: 600; }
.net-btn:hover { border-color: var(--accent); color: var(--accent); }
.net-btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.net-btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.net-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
@media (min-width: 1024px) { .net-body { flex-direction: row; } }
.net-stage { position: relative; flex: 1 1 58%; min-height: 46vh; background: radial-gradient(circle at 50% 45%, #FFFFFF 0%, #F3F6F9 70%); }
.net-canvas { position: absolute; inset: 0; }
.net-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); font-size: .9rem; }
.net-side { flex: 1 1 42%; min-height: 0; overflow-y: auto; border-top: 1px solid var(--border-light); padding: 1rem 1rem 1.5rem; background: #fff; }
@media (min-width: 1024px) { .net-side { flex: 0 0 380px; border-top: 0; border-left: 1px solid var(--border-light); padding: 1.25rem 1.4rem 2rem; } }
.net-year-badge {
    position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); padding: .2rem 1rem; border-radius: 999px;
    background: rgba(24, 38, 31, .9); color: #fff; font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700; letter-spacing: .02em;
}
.net-year-badge[hidden] { display: none; }
.net-legend { position: absolute; left: .75rem; bottom: 2.2rem; max-width: min(60%, 22rem); display: flex; flex-wrap: wrap; gap: .3rem .75rem; font-size: .72rem; color: var(--text-main); background: rgba(255,255,255,.88); padding: .45rem .65rem; border-radius: 10px; border: 1px solid var(--border-light); }
.net-legend:empty { display: none; }
.net-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.net-legend i { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.net-hint { position: absolute; left: .75rem; bottom: .55rem; font-size: .7rem; color: var(--text-muted); }

/* side panel content */
.net-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.net-kpi { border: 1px solid var(--border-light); border-radius: 12px; padding: .65rem .8rem; }
.net-kpi b { display: block; font-family: var(--font-serif); font-size: 1.55rem; color: var(--ink); line-height: 1.1; }
.net-kpi span { font-size: .75rem; color: var(--text-muted); }
.net-h { font-family: var(--font-serif); font-weight: 700; color: var(--ink); font-size: 1.05rem; margin: 1.4rem 0 .6rem; }
.net-row { display: flex; width: 100%; align-items: center; gap: .65rem; padding: .55rem .6rem; border-radius: 10px; text-align: left; color: var(--text-main); }
.net-row:hover, .net-row:focus-visible { background: #F1F5F9; }
.net-dot { width: .7rem; height: .7rem; border-radius: 50%; flex-shrink: 0; }
.net-row small { display: block; color: var(--text-muted); font-size: .75rem; line-height: 1.35; }
.net-bar { height: 6px; border-radius: 3px; background: var(--accent); opacity: .85; }
.net-person-head { display: flex; gap: .9rem; align-items: center; }
.net-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--group, var(--accent)); background: #E2E8F0; }
.net-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; background: #F1F5F9; color: var(--text-main); }
.net-paper { display: block; width: 100%; text-align: left; padding: .65rem .7rem; border: 1px solid var(--border-light); border-left: 3px solid var(--group, var(--accent)); border-radius: 10px; color: var(--ink); font-weight: 600; font-size: .86rem; line-height: 1.35; }
.net-paper:hover { border-color: var(--accent); background: #F8FAF8; }
.net-paper small { display: block; color: var(--text-muted); font-weight: 400; margin-top: .25rem; }
.net-back { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--accent); margin-bottom: .9rem; }
.net-tip { max-width: 240px; font-family: var(--font-sans); font-size: 12px; line-height: 1.4; color: var(--ink); }
.net-tip b { display: block; font-size: 13px; }
div.vis-tooltip { background: #fff !important; border: 1px solid var(--border-light) !important; border-radius: 10px !important; box-shadow: 0 10px 25px -10px rgba(24, 38, 31, .35) !important; padding: 8px 10px !important; font-family: var(--font-sans) !important; }
@media (max-width: 767px) { .net-legend, .net-hint { display: none; } }
