/* The NavGPT-3 post's switchable charts and route explorer (assets/navgpt3/explorer.js). */

/* ---------- charts with switches ---------- */
.sw-ctl { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 2px 0 14px; }
.sw-group { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--line-soft, #ecebe6); }
.sw-group button { padding: 5px 14px; border: 0; border-radius: 999px; background: none; font: 500 13px/1.4 var(--sans); color: var(--ink-2); cursor: pointer; }
.sw-group button[aria-pressed="true"] { background: var(--card, #fff); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 20, 19, .12); }
.sw-group button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
html[data-theme="dark"] .sw-group { background: #2d2c29; }
html[data-theme="dark"] .sw-group button[aria-pressed="true"] { background: #45433e; }

/* ---------- the route explorer ---------- */
.blog-body .nx { margin: 30px 0 46px; padding: clamp(16px, 2.4vw, 26px); border-radius: 16px; background: var(--card, #fff); font-family: var(--sans); }
.nx-wait { margin: 0; padding: 40px 0; text-align: center; color: var(--ink-3); font-size: 15px; }
.nx-cap { margin: 0 0 8px; font: 400 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.nx-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.nx-tab { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: none; font: 500 13.5px/1.4 var(--sans); color: var(--ink-2); cursor: pointer; }
.nx-tab[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.blog-body .nx-stats { margin: 12px 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
.nx-runs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.nx-run { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border: 1px solid var(--line-soft); border-radius: 8px; background: none; font: 500 13px/1.5 var(--sans); color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.nx-run i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.nx-run.no i { background: none; box-shadow: inset 0 0 0 1.6px var(--ink-3); }
.nx-run[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.nx-tab:focus-visible, .nx-run:focus-visible, .nx-frame:focus-visible, .nx-log button:focus-visible, .nx-tm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nx-head { padding: 18px 0 4px; }
.blog-body .nx-head blockquote { margin: 0 0 16px; padding: 0 0 0 14px; border-left: 3px solid var(--accent); font-size: 17px; line-height: 1.55; color: var(--ink); }
.nx-metrics { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 18px; }
.nx-metrics div { display: grid; gap: 1px; }
.nx-metrics dt { font-size: 11.5px; color: var(--ink-3); }
.nx-metrics dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.nx-metrics .ok dd { color: var(--accent); }
.nx-metrics .no dd { color: var(--ink-2); }

.nx-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 20px; }
/* the map fills the height of the camera column beside it (on narrow screens it stacks and is square) */
.nx-grid { align-items: stretch; }
.nx-map { display: flex; flex-direction: column; min-width: 0; }
.nx-mapbox { position: relative; flex: 1; min-height: 300px; overflow: hidden; border-radius: 12px; background: #f6f5f0; }
html[data-theme="dark"] .nx-mapbox { background: #1d1c1a; }
.nx-mapbox svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.nx-grid1 path { stroke: rgba(20, 20, 19, .06); stroke-width: 1; }
html[data-theme="dark"] .nx-grid1 path { stroke: rgba(255, 255, 255, .06); }
.nx-goalr { fill: rgba(248, 107, 68, .1); stroke: rgba(248, 107, 68, .45); stroke-width: 1; stroke-dasharray: 3 3; }
.nx-ref { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 5 5; stroke-linecap: round; stroke-linejoin: round; }
.nx-walk { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.nx-start { fill: var(--ink); }
.nx-goal { fill: var(--accent); }
.nx-end { fill: var(--card, #fff); stroke: var(--ink); stroke-width: 2; }
.nx-tm { cursor: pointer; }
.nx-tm circle { fill: var(--card, #fff); stroke: var(--ink); stroke-width: 1.6; }
.nx-tm text { font: 700 11px/1 var(--sans); fill: var(--ink); text-anchor: middle; }
.nx-tm.on circle { fill: var(--ink); } .nx-tm.on text { fill: var(--paper); }
.blog-body .nx-legend { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0; padding: 5px 10px;
  border-radius: 8px; background: rgba(246, 245, 240, .88); font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
html[data-theme="dark"] .blog-body .nx-legend { background: rgba(29, 28, 26, .88); }
.nx-legend span { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; white-space: nowrap; }
.nx-legend .k { display: inline-block; width: 16px; height: 0; border-top: 3px solid var(--accent); }
.nx-legend .k.ref { border-top: 2px dashed var(--ink-3); }
.nx-legend .k.start { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--ink); }
.nx-legend .k.goal { width: 9px; height: 9px; border: 0; background: var(--accent); transform: rotate(45deg); }
.nx-legend .k.end { width: 9px; height: 9px; border: 2px solid var(--ink); border-radius: 2px; }
.nx-legend .k.tm { width: 12px; height: 12px; border: 1.6px solid var(--ink); border-radius: 50%; }

.nx-view { display: flex; flex-direction: column; min-width: 0; }
.nx-video { overflow: hidden; border-radius: 12px; background: #000; }
.nx-video video { display: block; width: 100%; height: auto; }
.blog-body .nx-now { min-height: 1.5em; margin: 8px 0 8px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
/* the frames scroll sideways with no visible bar; the strip follows the playing frame by itself, and fades at its edges */
.nx-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
.nx-strip::-webkit-scrollbar { display: none; }
.nx-frame { position: relative; flex: 0 0 auto; width: 74px; padding: 0; border: 2px solid transparent; border-radius: 7px; background: none; cursor: pointer; }
.nx-frame img { display: block; width: 100%; height: 48px; object-fit: cover; border-radius: 5px; background: var(--line-soft); }
.nx-frame span { position: absolute; left: 4px; top: 3px; padding: 0 5px; border-radius: 6px; background: rgba(20, 20, 19, .72); font: 700 10px/1.5 var(--sans); color: #fff; }
.nx-frame.on { border-color: var(--accent); }

.nx-logwrap { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* folded: the tool calls in order, as chips */
.blog-body .nx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; margin: 0 0 12px; padding: 0; list-style: none; }
.blog-body .nx-chips li { display: flex; align-items: center; margin: 0; padding: 0; }
.blog-body .nx-chips li + li::before { content: ""; width: 14px; height: 1.5px; margin: 0 4px; background: var(--line); }
.nx-chips button { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; border: 1px solid var(--line-soft); border-radius: 999px; background: none; font: 500 13px/1.4 var(--sans); color: var(--ink-2); cursor: pointer; }
.nx-chips li.on button { border-color: var(--accent); color: var(--ink); background: rgba(248, 107, 68, .07); }
.nx .n { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 20px; min-width: 20px; height: 20px; padding: 0; border: 1.6px solid var(--ink); border-radius: 50%; font: 700 10.5px/1 var(--sans); color: var(--ink); background: var(--card, #fff); }
.nx li.on .n { border-color: var(--accent); background: var(--accent); color: #fff; }

.nx-fold { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 4px; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: none; font: 500 14px/1.4 var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.nx-fold:hover { border-color: var(--line); }
.nx-fold .ct { margin-left: auto; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.nx-fold i { width: 8px; height: 8px; border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.nx-fold[aria-expanded="true"] i { transform: translateY(2px) rotate(-135deg); }
.nx-fold:focus-visible, .nx-chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* unfolded: the exchange on a rail, numbered at each tool call */
.blog-body .nx-log { position: relative; margin: 4px 0 14px; padding: 6px 0 0; list-style: none; }
.blog-body .nx-log::before { content: ""; position: absolute; left: 10px; top: 14px; bottom: 14px; width: 1.5px; background: var(--line-soft); }
.blog-body .nx-log li { position: relative; margin: 0 0 14px; padding: 0 0 0 34px; }
.blog-body .nx-log .say p { margin: 0; padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: #f6f5f0; font-size: 15px; line-height: 1.55; color: var(--ink); }
html[data-theme="dark"] .blog-body .nx-log .say p { background: #2a2926; }
.nx-log .say b { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.nx-log .call .hd { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 4px -34px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.nx-log .call .nm { font: 600 14.5px/1.4 var(--sans); color: var(--ink); }
.nx-log .call .du { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nx-log .call .hd:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.blog-body .nx-log .args { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0; background: none; font: 400 12.5px/1.55 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.nx-log .res { margin-top: 6px; }
.nx-log .res summary { display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px/1.5 var(--sans); color: var(--ink-2); cursor: pointer; list-style: none; }
.nx-log .res summary::-webkit-details-marker { display: none; }
.nx-log .res summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
.nx-log .res[open] summary::before { transform: rotate(45deg); }
.blog-body .nx-log .res pre { margin: 8px 0 0; padding: 10px 12px; max-height: 260px; overflow: auto; scrollbar-width: none; border: 1px solid var(--line-soft); border-radius: 10px; background: #fbfaf7; font: 400 12px/1.6 var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
html[data-theme="dark"] .blog-body .nx-log .res pre { background: #1d1c1a; }
.nx-log li.call.on .nm { color: var(--accent); }
.blog-body .nx-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }

@media (max-width: 760px) { .nx-grid { grid-template-columns: minmax(0, 1fr); } .nx-mapbox { flex: none; aspect-ratio: 1; min-height: 0; } }
.nx .nx-log .call .n { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 22px; min-width: 22px; height: 22px; padding: 0; line-height: 1; }

/* the site's accordion style (site.css: details, summary) is not wanted inside the conversation */
.nx-log details.res { margin: 6px 0 0; border: 0; }
.nx-log .res summary { justify-content: flex-start; padding: 2px 0; }
.nx-log .res summary::after { content: none; }
/* chips: order is in the numbers, so no connectors (they were stranded at line starts) */
.blog-body .nx-chips { gap: 8px; }
.blog-body .nx-chips li + li::before { content: none; }
