/* Deep Dive: focused graph | Connected Nodes rail | (existing) inspector panel. Same tokens as the Atlas; teal = direct, violet = 2 hops / guesses. */
.dive-page { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; --teal: #33e1d2; --teal-soft: rgba(51,225,210,.12); --teal-line: rgba(51,225,210,.55); }
.dive-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 20px 4px; }
.dive-titles { min-width: 0; }
.dive-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dive-head h1:focus, .dive-head h1:focus-visible { outline: none; } /* focused by script for screen readers, not by the user */
.dive-lead { margin-top: 3px; font-size: 13.5px; } .dive-lead .linkbtn { font-size: 13.5px; }
.dive-tools { display: flex; gap: 6px; flex: none; }
.dive-tools .icon-only { width: 34px; padding: 0; }
.dive-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 8px 20px 10px; border-bottom: 1px solid var(--line); }
.crumbs ol { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.crumbs .sep { color: var(--faint); display: grid; place-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; background: none; color: #c3cbe2; font-size: 13px; }
button.crumb:hover { background: rgba(255,255,255,.05); color: #fff; }
.crumb.home { padding: 0 7px; color: #9ec3ff; }
.crumb.here { color: #fff; border-color: rgba(166,139,255,.5); background: rgba(166,139,255,.14); border-radius: 999px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 28px; }
.dive-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255,255,255,.025); }
.seg button { min-height: 30px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; background: none; color: #b7c1da; font-size: 13px; }
.seg button:hover { color: #fff; }
.seg button[aria-pressed="true"] { color: #fff; border-color: var(--teal-line); background: var(--teal-soft); box-shadow: 0 0 14px rgba(51,225,210,.18); }
.vsep { width: 1px; height: 22px; background: var(--line-2); }
.vswitch { display: inline-flex; align-items: center; gap: 9px; min-height: 32px; padding: 0 4px; border: 0; background: none; color: #c3cbe2; font-size: 13px; }
.vswitch i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid var(--line-2); transition: background .2s; }
.vswitch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #c3cbe2; transition: transform .2s var(--ease); }
.vswitch[aria-checked="true"] i { background: var(--teal-soft); border-color: var(--teal-line); }
.vswitch[aria-checked="true"] i::after { transform: translateX(14px); background: var(--teal); }

.dive-body { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 14px; padding: 12px 14px 14px 16px; min-height: 0; }
.dive-stage { position: relative; min-height: 0; min-width: 0; border-radius: 16px; overflow: hidden; background: radial-gradient(55% 55% at 50% 50%, rgba(51,225,210,.07), transparent 70%), radial-gradient(70% 70% at 50% 50%, rgba(90,70,190,.10), transparent 75%); }
.dive-canvas { position: absolute; inset: 0; }
.dive-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.dive-svg.grabbing { cursor: grabbing; }
.dg-orbit-line { fill: none; stroke: rgba(150,170,225,.08); stroke-width: 1; stroke-dasharray: 2 6; }
.dg-e { fill: none; stroke: rgba(51,225,210,.42); stroke-width: 1.4; transition: stroke .2s, stroke-width .2s, opacity .2s; }
.dg-e.confirmed { stroke: rgba(69,217,160,.55); }
.dg-e.inferred { stroke: rgba(166,139,255,.5); stroke-dasharray: 5 4; }
.dg-e.unresolved { stroke: rgba(240,181,96,.5); stroke-dasharray: 1.5 4; }
.dg-e.rejected { stroke: rgba(255,122,147,.45); stroke-dasharray: 1.5 4; }
.dg-e.hop2 { stroke: rgba(166,139,255,.32); stroke-width: 1; }
.has-focus .dg-e:not(.sel):not(.hl) { opacity: .35; }
.dg-e.sel, .dg-e.hl { stroke-width: 2.4; opacity: 1; }
.dg-e.sel:not(.inferred):not(.hop2), .dg-e.hl:not(.inferred):not(.hop2) { stroke: var(--teal); filter: drop-shadow(0 0 4px rgba(51,225,210,.8)); }
.dg-n { cursor: pointer; outline: none; }
.dg-n:focus-visible .dg-pill, .dg-n:focus-visible .dg-core { stroke: var(--focus); stroke-width: 2.5; }
.dg-n:focus-visible .dg-dot2 { stroke: var(--focus); stroke-width: 2; }
.dg-pill { fill: rgba(9,14,26,.92); stroke: color-mix(in srgb, var(--nc) 55%, transparent); stroke-width: 1.2; transition: stroke .2s, fill .2s; }
.dg-dot { fill: var(--nc); filter: drop-shadow(0 0 5px var(--nc)); }
.dg-name { fill: #eef2fd; font: 600 12.5px var(--font); pointer-events: none; }
.dg-sub { fill: var(--muted); font: 500 11px var(--font); pointer-events: none; }
.dg-n1:hover .dg-pill, .dg-n1.hl .dg-pill { fill: rgba(16,24,44,.96); stroke: var(--nc); }
.dg-n1.sel .dg-pill { stroke: var(--teal); stroke-width: 2; fill: rgba(14,40,46,.95); filter: drop-shadow(0 0 10px rgba(51,225,210,.35)); }
.has-focus .dg-n1:not(.sel):not(.hl) { opacity: .62; }
.dg-dot2 { fill: var(--nc); stroke: rgba(9,14,26,.9); stroke-width: 1.5; filter: drop-shadow(0 0 4px var(--nc)); }
.dg-l2 { fill: #c3cbe2; font: 500 11px var(--font); opacity: 0; pointer-events: none; transition: opacity .2s; paint-order: stroke; stroke: rgba(7,10,19,.9); stroke-width: 3px; }
.dg-n2.few .dg-l2, .dg-n2.open .dg-l2, .dg-n2:hover .dg-l2, .dg-n2:focus-visible .dg-l2, .dg-n2.sel .dg-l2 { opacity: 1; }
.dg-n2.sel .dg-dot2, .dg-n2.hl .dg-dot2 { stroke: var(--violet); stroke-width: 2.5; }
.dg-halo { fill: none; stroke: color-mix(in srgb, var(--nc) 40%, transparent); stroke-width: 1; filter: drop-shadow(0 0 16px var(--nc)); }
.dg-core { fill: rgba(10,22,34,.96); stroke: var(--teal); stroke-width: 2.4; filter: drop-shadow(0 0 14px rgba(51,225,210,.55)) drop-shadow(0 0 34px rgba(110,90,255,.35)); }
.dg-root.sel .dg-core { stroke-width: 3; }
.dg-hex { fill: none; stroke: var(--nc); stroke-width: .13; filter: drop-shadow(0 0 4px var(--nc)); }
.dg-rname { fill: #fff; font: 600 var(--fs, 19px) var(--font); pointer-events: none; }
.dg-rtype { fill: rgba(255,255,255,.05); stroke: var(--line-3); stroke-width: 1; }
.dg-rtype.warn { stroke: rgba(240,181,96,.6); fill: rgba(240,181,96,.1); }
.dg-rtype-t { fill: #b7c1da; font: 700 9px var(--font); letter-spacing: .16em; pointer-events: none; }
.dg-enter { animation: dg-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.dg-root.dg-enter { animation: fadein .35s var(--ease) both; }
@keyframes dg-in { from { opacity: 0; } to { opacity: 1; } }
.is-loading .dive-svg { opacity: .6; }

.dive-overlay { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: min(520px, 92%); padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(9,13,24,.94); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.dive-overlay b { display: block; font-weight: 600; } .dive-overlay .ico { flex: none; color: #9ec3ff; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(150,170,225,.25); border-top-color: var(--teal, #33e1d2); animation: spin 0.9s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.dive-zoom { left: 14px; bottom: 12px; }
.ring-pager { position: absolute; top: 10px; right: 12px; display: flex; align-items: center; gap: 8px; padding: 3px 4px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(8,11,20,.82); }
.ring-pager .btn.icon.sm { width: 30px; min-height: 30px; border-radius: 999px; border: 0; background: none; }
.ring-pager .btn:first-child .ico { transform: scaleX(-1); }
.dive-legend { position: absolute; left: 16px; top: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #b7c1da; pointer-events: none; flex-wrap: wrap; justify-content: flex-end; }
.dive-legend li { display: flex; align-items: center; gap: 7px; }
.dive-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 7px var(--teal); }
.dive-legend .lg2 i { background: var(--violet); box-shadow: 0 0 7px var(--violet); }
.dive-legend .lgi i { width: 16px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--violet); background: none; box-shadow: none; }

.dive-rail { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); overflow: hidden; }
.rail-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 16px 10px; }
.rail-ico { color: #c3cbe2; margin-top: 2px; }
.rail-head h2 { font-size: 16px; font-weight: 600; }
.rail-note { padding: 0 16px; display: grid; gap: 4px; }
.rail-note p { display: flex; gap: 6px; align-items: flex-start; } .rail-note .ico { margin-top: 2px; }
.rail-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 8px; padding: 8px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(150,170,225,.25) transparent; }
.dcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255,255,255,.025); transition: border-color .18s, background .18s, box-shadow .18s; }
.dcard.hl { border-color: var(--line-3); background: rgba(255,255,255,.045); }
.dcard.sel { border-color: var(--teal-line); background: rgba(51,225,210,.07); box-shadow: inset 0 0 0 1px rgba(51,225,210,.35), 0 0 18px rgba(51,225,210,.1); }
.dcard.skel { height: 62px; background: linear-gradient(90deg, rgba(255,255,255,.02), rgba(255,255,255,.06), rgba(255,255,255,.02)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.dc-main { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 6px 10px 12px; border: 0; background: none; text-align: left; border-radius: 12px 0 0 12px; min-width: 0; }
.dc-ico { grid-row: 1 / 3; color: var(--nc); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--nc) 12%, transparent); }
.dc-text { min-width: 0; display: grid; }
.dc-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-text small { color: var(--muted); font-size: 12px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dc-links { grid-column: 2; color: var(--faint); font-size: 11.5px; }
.dc-go { display: grid; place-items: center; width: 40px; border: 0; border-left: 1px solid var(--line); background: none; color: #b7c1da; border-radius: 0 12px 12px 0; }
.dc-go:hover { color: #fff; background: rgba(51,225,210,.1); }
.dc-kids { grid-column: 1 / -1; display: grid; gap: 2px; padding: 0 10px 10px 58px; }
.dc-kids button { display: flex; align-items: center; gap: 7px; width: 100%; padding: 3px 6px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 12.5px; color: #c3cbe2; min-width: 0; }
.dc-kids button:hover { background: rgba(166,139,255,.1); }
.dc-kids i { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); flex: none; align-self: center; }
.dc-kids span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dc-kids small { display: none; }
.dc-kids li.muted { padding: 2px 6px; }
.rail-more { margin: 0 12px 12px; justify-content: center; gap: 8px; border: 1px solid var(--line-2) !important; }

/* inspector sections (in the existing right panel) */
.dive-ihead h2 { overflow-wrap: anywhere; }
.dive-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.dsec { padding: 0; margin-bottom: 10px; border-radius: 12px; }
.dsec > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; }
.dsec > summary::-webkit-details-marker { display: none; }
.dsec > summary > .ico:first-child { color: #c3cbe2; }
.dsec > summary > .ico:last-child { margin-left: auto; color: var(--muted); transition: transform .2s; transform: rotate(180deg); }
.dsec:not([open]) > summary > .ico:last-child { transform: none; }
.dsec .dsec-t { flex: 0 1 auto; }
.dsec summary .chip.count { margin-left: 4px; color: #8fecc6; border-color: rgba(51,225,210,.35); background: rgba(51,225,210,.07); }
.dsec-b { padding: 0 14px 14px; display: grid; gap: 8px; font-size: 13px; color: #d3daef; }
.dsec-b q { quotes: "“" "”"; }
.dsec-b .none { font-style: italic; }
.dive-names .nchip { cursor: pointer; } .dive-names .nchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--nc); box-shadow: 0 0 6px var(--nc); }
.dive-names .nchip:hover { border-color: var(--line-3); color: #fff; }
.dive-ev .ev .linkbtn { margin-top: 4px; }
.dive-bars { width: 100%; height: 40px; display: block; }
.dive-bars rect { fill: var(--violet); opacity: .85; } .dive-bars rect.inf { opacity: .4; }
.dive-range { color: #c3cbe2; font-size: 12.5px; text-align: right; }
.dive-qs { display: grid; gap: 6px; } .dive-qs li { position: relative; padding-left: 16px; } .dive-qs li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.cands { display: grid; gap: 8px; margin-top: 8px; }
.dive-cta { gap: 7px; }
.card-actions.dive-row { margin: -2px 0 12px; }
.dive-fab { position: absolute; right: 16px; bottom: 14px; gap: 8px; border-color: rgba(51,225,210,.55); background: rgba(10,30,36,.88); color: #e8fbf9; box-shadow: 0 0 22px rgba(51,225,210,.18); }
.dive-fab:hover { background: rgba(14,44,52,.95); border-color: #33e1d2; }

/* ---------- responsive: never three unreadably narrow columns ---------- */
@media (max-width: 1279px) {
  .dive-page { overflow-y: auto; grid-template-rows: auto auto auto; }
  .dive-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(380px, 62vh) auto; }
  .dive-rail { max-height: none; } .rail-list { overflow: visible; flex: none; }
  .dive-controls { margin-left: 0; }
}
@media (max-width: 1000px) {
  .dive-fab { right: auto; left: 50%; transform: translateX(-50%); bottom: 14px; }
  .inspect-fab ~ .dive-fab { bottom: 64px; }
}
@media (max-width: 700px) {
  .dive-head { padding: 10px 14px 2px; } .dive-head h1 { font-size: 18px; } .dive-lead { display: none; }
  .dive-tools .btn span { display: none; } .dive-tools .btn { width: 36px; padding: 0; }
  .dive-bar { padding: 6px 14px 8px; } .crumb { font-size: 12px; padding: 0 6px; } .crumb.here { max-width: 160px; }
  .dive-controls { width: 100%; justify-content: space-between; } .dive-controls > .muted { display: none; } .vsep { display: none; }
  .dive-body { padding: 8px 10px 12px; grid-template-rows: minmax(340px, 56vh) auto; }
  .dive-legend { display: none; } .dive-zoom { bottom: 10px; left: 10px; }
  .dive-fab { bottom: 56px; }
}
.stage:has(.dive-fab:not([hidden])) .hint { display: none; } /* the Deep Dive button takes the hint's place */
.rail-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 28px 12px; font-size: 13px; }
