/* Chart marks: horizontal bar rows (demand, geo split), funnel, SVG line and map charts, the sortable competitor table and the competitor card. */

/* ---------- horizontal bar rows ---------- */
.nb-bars { --label-w: 12.5rem; --pad: 4.25rem; display: grid; gap: 0; }
.nb-bars-row {
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  gap: var(--s4);
  align-items: center;
  padding: 7px 6px;
  border-radius: var(--r-sm);
}
.nb-bars-row:hover, .nb-bars-row:focus-visible { background: var(--hover); }
.nb-bars-row:focus-visible { outline-offset: 0; }
.nb-bars-label { color: var(--ink); font-size: var(--t-sm); line-height: 1.3; }
.nb-bars-label small { display: block; color: var(--ink-3); font-size: var(--t-xs); }
.nb-bars-track { position: relative; display: grid; gap: 2px; min-width: 0; padding-right: var(--pad); }
.nb-bars-grid { position: absolute; z-index: 0; inset: -7px var(--pad) -7px 0; pointer-events: none; }
.nb-bars-grid i { position: absolute; top: 0; bottom: 0; left: calc(var(--p) * 100%); width: 1px; background: var(--grid); }
.nb-bars-grid i.zero { background: var(--axis); }
.nb-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; height: var(--h, 11px); }
.nb-bar > i {
  display: block;
  flex: 0 0 auto;
  width: calc(var(--w) * 100%);
  min-width: 2px;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--sw);
}
.nb-bar > .v { flex-shrink: 0; color: var(--ink-2); font-size: var(--t-xs); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb-bars-row.is-single .nb-bar { --h: 16px; }
.nb-bars-ticks { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); gap: var(--s4); padding: 6px 6px 0; }
.nb-bars-ticks .tk { position: relative; height: 1.2em; margin-right: var(--pad); color: var(--tick); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.nb-bars-ticks .tk span { position: absolute; left: calc(var(--p) * 100%); transform: translateX(-50%); white-space: nowrap; }
.nb-bars-ticks .tk span:first-child { transform: none; }
.nb-bars-group {
  margin: var(--s4) 0 var(--s1);
  padding: var(--s3) 6px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font: 600 var(--t-xs) / 1.3 var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nb-bars-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.nb-bars-group span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.nb-bars-group.is-second ~ .nb-bars-row .nb-bars-label { color: var(--ink-2); }

/* stacked share bar: city part + rest of the region */
.nb-split { display: flex; gap: 2px; height: 16px; width: calc(var(--w) * 100%); min-width: 4px; }
.nb-split > i { display: flex; align-items: center; justify-content: center; min-width: 2px; background: var(--sw); overflow: visible; }
.nb-split > i:first-child { border-radius: 0; }
.nb-split > i:last-child { border-radius: 0 4px 4px 0; }
.nb-split > i b { color: #fff; font: 650 0.6875rem / 1 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb-split-wrap { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.nb-split-wrap .v { color: var(--ink-2); font-size: var(--t-xs); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

.nb-split > i b { padding: 0 4px; }
@container (max-width: 40px) { .nb-split > i b { display: none; } }
.nb-tablewrap.is-sticky :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--rule); }
.nb-tablewrap.is-sticky thead th:first-child { background: var(--sunken); }
.nb-tablewrap.is-sticky tfoot td:first-child { background: var(--sunken); }

/* ---------- funnel ---------- */
.nb-funnel { display: grid; gap: 0; }
.nb-fn-stage { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s4); align-items: center; padding: 8px 0; }
.nb-fn-name { color: var(--ink-2); font-size: var(--t-sm); }
.nb-fn-val { font: 600 1.5rem / 1.1 var(--font-ui); letter-spacing: -0.02em; }
.nb-fn-val .u { margin-left: 4px; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; letter-spacing: 0; }
.nb-fn-track { height: 22px; }
.nb-fn-track i { display: block; height: 100%; width: calc(var(--w) * 100%); min-width: 3px; border-radius: 0 4px 4px 0; background: var(--sw); }
.nb-fn-step { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s4); align-items: center; padding: 2px 0; color: var(--ink-3); font-size: var(--t-xs); }
.nb-fn-step .chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-pill);
  background: var(--sunken);
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nb-fn-step .chip::before { content: "↓"; color: var(--ink-3); font-weight: 500; }
.nb-fn-result {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--s4);
  align-items: baseline;
  margin-top: var(--s2);
  padding: var(--s3) 0 0;
  border-top: 1px solid var(--rule);
}
.nb-fn-result .formula { color: var(--ink-3); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.nb-fn-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s3); margin-top: var(--s2); color: var(--ink-2); font-size: var(--t-sm); }

/* ---------- SVG charts (line, map) ---------- */
.nb-svg { width: 100%; height: auto; overflow: visible; font-family: var(--font-ui); }
.nb-svg text { fill: var(--tick); font-size: 12px; font-variant-numeric: tabular-nums; }
.nb-svg .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.nb-svg .axis line, .nb-svg line.axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.nb-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nb-svg .area { stroke: none; opacity: 0.1; }
.nb-svg .dot { stroke: var(--surface); stroke-width: 2; }
.nb-svg .end text, .nb-svg text.end { fill: var(--ink-2); font-weight: 600; }
.nb-svg text.year { fill: var(--ink-4); font-size: 11px; }
.nb-svg .cross { stroke: var(--rule-2); stroke-width: 1; shape-rendering: crispEdges; }
.nb-svg .hit { fill: transparent; cursor: crosshair; }
.nb-svg .quad text { fill: var(--ink-4); font-size: 11.5px; font-weight: 500; letter-spacing: 0.02em; }
.nb-svg .mid { stroke: var(--rule-2); stroke-width: 1; shape-rendering: crispEdges; }
.nb-svg .pt circle.mark { fill: var(--c-other); stroke: var(--surface); stroke-width: 2; }
.nb-svg .pt text { fill: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.nb-svg .pt.is-self circle.mark { fill: var(--c1); }
.nb-svg .pt.is-self text { fill: var(--ink); font-weight: 700; }
.nb-svg .pt .halo { fill: var(--c1-wash); }
.nb-svg .pt:focus-visible circle.mark, .nb-svg .pt:hover circle.mark { stroke: var(--ink); }
.nb-svg .pt { outline: none; cursor: default; }
.nb-svg .axis-title { fill: var(--ink-2); font-size: 12px; font-weight: 600; }

/* ---------- sortable comparison table ---------- */
.nb-cmp-wrap { position: relative; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.nb-cmp th.sortable { padding: 0; }
.nb-cmp th button {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: inherit;
  cursor: pointer;
}
.nb-cmp th.num button { justify-content: flex-end; text-align: right; }
.nb-cmp th button:hover { color: var(--ink); background: var(--hover); }
.nb-cmp th .arr { width: 8px; height: 10px; flex-shrink: 0; opacity: 0.35; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 0 7.5 4h-7zM4 10 .5 6h7z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 0 7.5 4h-7zM4 10 .5 6h7z'/%3E%3C/svg%3E") center / contain no-repeat; }
.nb-cmp th[aria-sort="ascending"] .arr { opacity: 1; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 1 7.5 6h-7z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 1 7.5 6h-7z'/%3E%3C/svg%3E"); }
.nb-cmp th[aria-sort="descending"] .arr { opacity: 1; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 9 .5 4h7z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M4 9 .5 4h7z'/%3E%3C/svg%3E"); }
.nb-cmp :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--rule); }
.nb-cmp thead th:first-child { background: var(--sunken); }
.nb-cmp tr.is-self td { background: color-mix(in srgb, var(--surface) 86%, var(--c1)); }
.nb-cmp tr.is-self td:first-child { font-weight: 650; }
.nb-cmp td a { color: var(--ink); font-weight: 550; }
.nb-yes, .nb-no-mark { position: relative; display: inline-block; width: 15px; height: 15px; vertical-align: -2px; background: currentColor; }
.nb-yes { color: var(--ok-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.6 4.8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.6 4.8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.nb-no-mark { width: 10px; height: 2px; vertical-align: 4px; color: var(--ink-4); }
.nb-star { color: var(--ink); font-weight: 600; white-space: nowrap; }
.nb-star::after { content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 3px; vertical-align: -1px; background: var(--c4); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2l2 4.4 4.8.5-3.6 3.2 1 4.8L8 11.7l-4.2 2.4 1-4.8L1.2 6.1 6 5.6z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2l2 4.4 4.8.5-3.6 3.2 1 4.8L8 11.7l-4.2 2.4 1-4.8L1.2 6.1 6 5.6z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- competitor card ---------- */
.nb-comp { display: grid; gap: var(--s4); padding: var(--s5); border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.nb-comp-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: center; }
.nb-comp-mono { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--sunken); color: var(--ink); font: 500 1.5rem / 1 var(--font-read); }
.nb-comp-name { font: 600 1.25rem / 1.25 var(--font-ui); letter-spacing: -0.01em; }
.nb-comp-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); margin-top: 2px; color: var(--ink-3); font-size: var(--t-sm); }
.nb-comp-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px var(--s4); font-size: var(--t-sm); }
.nb-comp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.nb-comp-stats > div { display: grid; gap: 2px; padding: var(--s3) var(--s3) var(--s3) 0; }
.nb-comp-stats dt { color: var(--ink-3); font-size: var(--t-xs); }
.nb-comp-stats dd { margin: 0; font: 600 1.0625rem / 1.3 var(--font-ui); }
.nb-comp-stats dd small { display: block; color: var(--ink-3); font-size: var(--t-xs); font-weight: 400; }
.nb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nb-tags li { padding: 3px 10px; border-radius: var(--r-pill); background: var(--sunken); color: var(--ink-2); font-size: var(--t-sm); }
.nb-tags li.is-second { color: var(--ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.nb-comp-sec { display: grid; gap: var(--s2); }
.nb-comp-sec h5 { margin: 0; color: var(--ink-3); font: 600 var(--t-xs) / 1.3 var(--font-ui); letter-spacing: 0.07em; text-transform: uppercase; }
.nb-comp-facts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: var(--t-sm); }
.nb-comp-facts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s2); line-height: 1.45; }
.nb-comp-facts .k { color: var(--ink-2); }
.nb-comp-facts .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.nb-comp-facts .m { color: var(--ink-3); font-size: var(--t-xs); }
.nb-comp-facts .m a { color: var(--ink-3); text-decoration: underline; text-decoration-color: var(--rule-2); }
.nb-comp-quote { margin: 0; padding-left: var(--s3); border-left: 2px solid var(--rule-2); font: 400 1rem / 1.5 var(--font-read); color: var(--ink); }
.nb-comp-pm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); margin-top: 6px; padding-left: var(--s3); color: var(--ink-3); font-size: var(--t-xs); }
.nb-comp-pm .m a { color: var(--ink-3); }
.nb-comp-pros { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.nb-comp-pros ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: var(--t-sm); line-height: 1.45; }
.nb-comp-pros li { position: relative; padding-left: 18px; }
.nb-comp-pros li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.nb-comp-pros .plus li::before { content: "+"; color: var(--good-ink); }
.nb-comp-pros .minus li::before { content: "−"; color: var(--bad-ink); }
.nb-comp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: var(--s3); border-top: 1px solid var(--rule); color: var(--ink-3); font-size: var(--t-xs); }

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .nb-bars { --pad: 3.75rem; }
  .nb-bars-row, .nb-bars-ticks { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nb-bars-ticks > :first-child { display: none; }
  .nb-fn-stage, .nb-fn-step, .nb-fn-result { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nb-fn-step { padding: 4px 0; }
  .nb-comp { padding: var(--s4); }
  .nb-comp-pros { grid-template-columns: 1fr; }
}
