/* =========================================================================
   Network Journey (/network-journey)
   The "capstone" page: one request, every stage. Uses the network-tool blue
   family so it reads as a sibling of /netpath-pro and /global-ping-test,
   with a purple accent for the stage track that is unique to this page.
   Scoped entirely under .nj-page.
   ========================================================================= */

.nj-page{
  --nj-bg:#f4f8ff;
  --nj-surface:#ffffff;
  --nj-text:#071936;
  --nj-text-soft:#415678;
  --nj-muted:#667896;
  --nj-line:rgba(217,230,245,.92);
  --nj-brand:#256fff;
  --nj-brand-2:#13b6ff;
  --nj-accent:#7a4dff;
  --nj-success:#13b57b;
  --nj-success-soft:#e8fbf3;
  --nj-warning:#d97706;
  --nj-warning-soft:#fff7ed;
  --nj-danger:#e2384f;
  --nj-danger-soft:#ffeef1;
  --nj-shadow:0 12px 40px rgba(24,67,126,.10);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--nj-text);
}
.nj-page *{box-sizing:border-box}
.nj-page a{color:inherit}
.nj-page button,.nj-page input{font:inherit}
.nj-page button{cursor:pointer}
.nj-page code{font-family:"SFMono-Regular",Consolas,monospace}
.nj-page .page-shell{width:min(1440px,calc(100% - 32px));margin:0 auto;padding:24px 0 48px}

/* ---------- hero ---------- */
.nj-page .hero{
  position:relative;overflow:hidden;padding:34px;border-radius:26px;
  border:1px solid rgba(196,216,239,.95);
  background:
    radial-gradient(circle at 10% 0%, rgba(37,111,255,.09), transparent 24%),
    radial-gradient(circle at 92% 4%, rgba(122,77,255,.09), transparent 22%),
    linear-gradient(180deg, #ffffff 0, var(--nj-bg) 420px);
  box-shadow:var(--nj-shadow);
}
.nj-page .hero-heading{display:flex;align-items:center;gap:18px;max-width:920px}
.nj-page .hero-icon{
  width:74px;height:74px;flex:0 0 74px;display:grid;place-items:center;border-radius:50%;
  color:#fff;font-size:32px;
  background:linear-gradient(145deg,var(--nj-accent),var(--nj-brand));
  border:7px solid rgba(255,255,255,.85);box-shadow:0 12px 26px rgba(122,77,255,.28);
}
.nj-page h1{margin:0;font-size:clamp(1.8rem,3.6vw,2.9rem);letter-spacing:-.04em;line-height:1.08}
.nj-page .hero-copy p{margin:9px 0 0;color:var(--nj-text-soft);font-size:1rem;line-height:1.6}

/* ---------- controls ---------- */
.nj-page .controls{margin-top:24px;display:grid;gap:14px}
.nj-page .target-row{display:grid;grid-template-columns:1fr auto;gap:12px}
.nj-page .input-wrap{position:relative}
.nj-page .input-icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:var(--nj-muted)}
.nj-page .target-input{
  width:100%;height:54px;padding:0 16px 0 44px;border-radius:14px;border:1px solid var(--nj-line);
  outline:none;background:#fff;font-size:.95rem;box-shadow:0 4px 14px rgba(16,24,40,.04);
  transition:border-color .15s,box-shadow .15s;
}
.nj-page .target-input:focus{border-color:var(--nj-brand);box-shadow:0 0 0 4px rgba(37,111,255,.12)}
.nj-page .start-btn{
  min-width:172px;height:54px;padding:0 24px;border:0;border-radius:14px;font-weight:850;color:#fff;
  background:linear-gradient(135deg,var(--nj-accent),var(--nj-brand));
  box-shadow:0 11px 22px rgba(37,111,255,.24);
}
.nj-page .start-btn:disabled{opacity:.65;cursor:not-allowed}

.nj-page .hop-toggle{display:flex;align-items:flex-start;gap:11px;cursor:pointer}
.nj-page .hop-toggle input{margin-top:3px;width:17px;height:17px;accent-color:var(--nj-brand);flex:0 0 auto}
.nj-page .hop-toggle strong{display:block;font-size:.86rem;font-weight:800}
.nj-page .hop-toggle small{display:block;margin-top:2px;color:var(--nj-muted);font-size:.79rem}

.nj-page .message{display:none;margin-top:4px;padding:11px 14px;border-radius:11px;font-size:.88rem}
.nj-page .message.show{display:block}
.nj-page .message.success{color:var(--nj-success);background:var(--nj-success-soft);border:1px solid #b9e3c8}
.nj-page .message.error{color:var(--nj-danger);background:var(--nj-danger-soft);border:1px solid #f4c6c1}
.nj-page .message.warning{color:var(--nj-warning);background:var(--nj-warning-soft);border:1px solid #fcd9a8}

.nj-page .loading-line{display:none;height:4px;margin-top:4px;border-radius:999px;overflow:hidden;background:rgba(37,111,255,.12)}
.nj-page .loading-line.show{display:block}
.nj-page .loading-line::after{content:"";display:block;width:34%;height:100%;background:var(--nj-brand);animation:njLoading 1.1s ease-in-out infinite}
@keyframes njLoading{from{transform:translateX(-110%)}to{transform:translateX(310%)}}

.nj-page .empty-state{
  margin-top:18px;padding:40px 22px;border:1px dashed #c9d8f0;border-radius:20px;
  color:var(--nj-muted);background:rgba(255,255,255,.7);text-align:center;font-size:.92rem;line-height:1.6;
}
.nj-page .hidden{display:none!important}

/* ---------- results shell ---------- */
.nj-page .results{display:none;margin-top:18px}
.nj-page .results.show{display:block}
.nj-page .card{border:1px solid var(--nj-line);border-radius:20px;background:var(--nj-surface);box-shadow:0 8px 26px rgba(16,24,40,.045)}
.nj-page .panel{padding:20px}
.nj-page .panel-title{display:flex;align-items:center;gap:10px;margin:0;font-size:1rem}
.nj-page .panel-title span:first-child{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:#eef4ff;color:var(--nj-brand)}
.nj-page .panel-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.nj-page .journey-summary{color:var(--nj-muted);font-size:.8rem;font-weight:700}
.nj-page .panel-note{margin:12px 0 0;color:var(--nj-muted);font-size:.8rem;line-height:1.6}

/* ---------- the stage track ---------- */
.nj-page .journey-card{padding:22px;margin-bottom:16px}
.nj-page .journey-track{list-style:none;margin:0;padding:0;display:grid;gap:0}

.nj-page .stage{
  position:relative;display:grid;grid-template-columns:52px 1fr;gap:16px;
  padding:0 0 22px 0;
}
.nj-page .stage:last-child{padding-bottom:0}
/* the vertical spine connecting stages */
.nj-page .stage::before{
  content:"";position:absolute;left:25px;top:52px;bottom:-4px;width:2px;
  background:linear-gradient(180deg,var(--nj-brand),rgba(37,111,255,.18));
}
.nj-page .stage:last-child::before{display:none}

.nj-page .stage-icon{
  width:52px;height:52px;border-radius:16px;display:grid;place-items:center;font-size:22px;
  background:#eef4ff;border:1px solid #d7e5ff;color:var(--nj-brand);z-index:1;
  box-shadow:0 6px 16px rgba(37,111,255,.14);
}
.nj-page .stage.is-good .stage-icon{background:var(--nj-success-soft);border-color:#b9e3c8;color:var(--nj-success)}
.nj-page .stage.is-warn .stage-icon{background:var(--nj-warning-soft);border-color:#fcd9a8;color:var(--nj-warning)}
.nj-page .stage.is-bad .stage-icon{background:var(--nj-danger-soft);border-color:#f4c6c1;color:var(--nj-danger)}
.nj-page .stage.is-skipped .stage-icon{background:#f2f5fa;border-color:#e2e8f2;color:var(--nj-muted)}

.nj-page .stage-body{min-width:0;padding-top:2px}
.nj-page .stage-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.nj-page .stage-name{font-size:.98rem;font-weight:900;letter-spacing:-.01em}
.nj-page .stage-time{
  padding:2px 9px;border-radius:999px;background:#eef4ff;color:var(--nj-brand);
  font-size:.71rem;font-weight:850;font-variant-numeric:tabular-nums;
}
.nj-page .stage-detail{margin:6px 0 0;color:var(--nj-text-soft);font-size:.86rem;line-height:1.55;overflow-wrap:anywhere}
.nj-page .stage-meta{margin-top:9px;display:flex;flex-wrap:wrap;gap:7px}
.nj-page .stage-chip{
  display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;
  border:1px solid var(--nj-line);background:#fbfdff;font-size:.75rem;font-weight:700;color:var(--nj-text-soft);
  overflow-wrap:anywhere;
}
.nj-page .stage-chip.is-accent{border-color:#d9ccff;background:#f6f1ff;color:#5b32d6}

/* staggered reveal - each stage drops in after the one above it */
.nj-page .stage{opacity:0;transform:translateY(9px);animation:njStageIn .42s cubic-bezier(.2,.8,.2,1) forwards}
@keyframes njStageIn{to{opacity:1;transform:none}}

/* ---------- map ---------- */
.nj-page .map-panel{margin-bottom:16px}
.nj-page .map-panel .qdt-map-container{height:480px}
.nj-page .fullscreen-btn{
  padding:8px 14px;border-radius:999px;border:1px solid var(--nj-line);background:#fff;
  font-size:.78rem;font-weight:800;color:var(--nj-text-soft);white-space:nowrap;
}
.nj-page .fullscreen-btn:hover{border-color:var(--nj-brand);color:var(--nj-brand)}
.nj-page .map-legend-note{
  display:flex;flex-wrap:wrap;gap:16px;align-items:center;margin:12px 0 0;
  font-size:.76rem;font-weight:750;color:var(--nj-muted);
}
.nj-page .legend-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;vertical-align:middle}
.nj-page .legend-dot-source{background:linear-gradient(145deg,#60a5fa,#1d4ed8)}
.nj-page .legend-dot-good{background:#10b981}
.nj-page .legend-dot-warn{background:#f59e0b}
.nj-page .legend-dot-bad{background:#ef4444}
.nj-page .legend-vantage{margin-left:auto;font-weight:700;color:var(--nj-text-soft)}

.nj-page .map-panel:fullscreen,
.nj-page .map-panel:-webkit-full-screen{display:flex;flex-direction:column;padding:22px;background:#0b1220}
.nj-page .map-panel:fullscreen .panel-title,
.nj-page .map-panel:-webkit-full-screen .panel-title{color:#e6ecff}
.nj-page .map-panel:fullscreen .panel-title span:first-child,
.nj-page .map-panel:-webkit-full-screen .panel-title span:first-child{color:#e6ecff;background:rgba(255,255,255,.08)}
.nj-page .map-panel:fullscreen .fullscreen-btn,
.nj-page .map-panel:-webkit-full-screen .fullscreen-btn{color:#e6ecff;background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18)}
.nj-page .map-panel:fullscreen .qdt-map-container,
.nj-page .map-panel:-webkit-full-screen .qdt-map-container{flex:1 1 auto;height:auto!important}
.nj-page .map-panel:fullscreen .map-legend-note,
.nj-page .map-panel:-webkit-full-screen .map-legend-note{color:#aab8e0}

/* ---------- detail panels ---------- */
.nj-page .detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin-bottom:16px}
.nj-page .stack-list{display:grid;gap:10px}
.nj-page .stack-row{
  display:grid;grid-template-columns:minmax(130px,.75fr) minmax(0,1.25fr);gap:14px;
  padding:11px 13px;border:1px solid var(--nj-line);border-radius:12px;background:#fbfdff;font-size:.83rem;
}
.nj-page .stack-key{color:#344054;font-weight:850}
.nj-page .stack-value{color:var(--nj-text-soft);overflow-wrap:anywhere}
.nj-page .stack-value.is-good{color:var(--nj-success);font-weight:800}
.nj-page .stack-value.is-warn{color:var(--nj-warning);font-weight:800}
.nj-page .stack-value.is-bad{color:var(--nj-danger);font-weight:800}
.nj-page .stack-empty{color:var(--nj-muted);font-size:.83rem;line-height:1.6;margin:0}

.nj-page .signal-card{
  padding:12px 14px;border:1px solid var(--nj-line);border-radius:12px;background:#fbfdff;
}
.nj-page .signal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.nj-page .signal-name{font-size:.87rem;font-weight:900}
.nj-page .signal-kind{
  padding:3px 9px;border-radius:999px;background:#f6f1ff;color:#5b32d6;
  font-size:.7rem;font-weight:850;white-space:nowrap;
}
.nj-page .signal-evidence{
  margin:7px 0 0;padding:7px 9px;border-radius:8px;background:#f2f5fa;
  color:var(--nj-muted);font-family:"SFMono-Regular",Consolas,monospace;font-size:.74rem;
  overflow-wrap:anywhere;
}

/* ---------- tables ---------- */
.nj-page .hops-table{width:100%;border-collapse:collapse;font-size:.83rem}
.nj-page .hops-table thead th{
  text-align:left;padding:11px 13px;color:var(--nj-muted);font-size:.71rem;font-weight:850;
  text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--nj-line);white-space:nowrap;
}
.nj-page .hops-table tbody td{padding:11px 13px;border-bottom:1px solid #eef2f8;overflow-wrap:anywhere}
.nj-page .hops-table tbody tr:last-child td{border-bottom:0}
.nj-page .hops-table tr.is-timeout td{color:var(--nj-muted)}
.nj-page .hop-num{
  display:inline-grid;place-items:center;width:24px;height:24px;border-radius:8px;
  background:#eef4ff;color:var(--nj-brand);font-size:.72rem;font-weight:900;
}
.nj-page .hop-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:7px;vertical-align:middle}
.nj-page .hop-dot.is-good{background:#10b981}
.nj-page .hop-dot.is-warn{background:#f59e0b}
.nj-page .hop-dot.is-bad{background:#ef4444}
.nj-page .hop-dot.is-none{background:#cbd5e1}
.nj-page .num{font-variant-numeric:tabular-nums}

#hopsPanel,#redirectPanel{margin-bottom:16px}

.nj-page .note-card{
  margin-top:16px;padding:16px 18px;border-left:4px solid var(--nj-accent);border-radius:11px;
  color:#3a2a70;background:#f6f1ff;font-size:.86rem;line-height:1.6;
}

@media (max-width:1100px){
  .nj-page .detail-grid{grid-template-columns:1fr}
}
@media (max-width:780px){
  .nj-page .page-shell{width:min(100% - 20px,1440px)}
  .nj-page .hero{padding:22px 18px}
  .nj-page .hero-heading{align-items:flex-start}
  .nj-page .hero-icon{width:56px;height:56px;flex-basis:56px;font-size:24px}
  .nj-page .target-row{grid-template-columns:1fr}
  .nj-page .stage{grid-template-columns:42px 1fr;gap:12px}
  .nj-page .stage-icon{width:42px;height:42px;font-size:18px;border-radius:13px}
  .nj-page .stage::before{left:20px;top:44px}
  .nj-page .stack-row{grid-template-columns:1fr;gap:4px}
  .nj-page .map-panel .qdt-map-container{height:320px}
  .nj-page .legend-vantage{margin-left:0;width:100%}
}

@media (prefers-reduced-motion: reduce){
  .nj-page .stage{animation:none;opacity:1;transform:none}
  .nj-page .loading-line::after{animation:none}
}
