/* ==========================================================================
   Nexidia line page (catalogue/nexidia.html only)
   The page is built from the site's own pieces: the .mock window, the .mn
   workflow canvas, .kpi tiles and the .showcase tabs (all in styles.css, all
   driven by site.js). This file adds only the charts and dashboard parts
   inside those windows. Charts use the emphasis form: orange for the series
   that matters, a warm grey (#948f86, 3:1 on white) for context, ink for an
   actual line, hairline grids and thin marks.
   ========================================================================== */
@property --grow {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
:root {
  --nc-o: var(--orange);
  --nc-g: #948f86;
  --nc-grid: #efeeea;
  --nc-base: #d8d5ce;
}

/* ---------- Hero: the workflow, with hours saved beside it ---------- */
/* The hero ends on a short note and some air, then hands over to a light section */
.nxd-lhero {
  padding-bottom: clamp(40px, 6vw, 72px);
}
.nxd-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}
.nxd-note i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 9px 1px 0;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.16);
}
.nxd-hero .mn {
  grid-template-columns: minmax(0, 1fr) 272px;
}
.nxd-hero .mn__side {
  gap: 12px;
}
/* The chart takes the room the workflow leaves */
.nxd-hero .nc--hero {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nxd-hero .nc--hero .nc__plot {
  flex: 1;
  height: auto;
  min-height: 96px;
}
.nxd-fig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  margin-top: -4px;
}
.nxd-fig b {
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}
.nxd-fig span {
  font-size: 16px;
  font-weight: 600;
  color: var(--m-muted);
}
.nxd-fig em {
  margin-left: 4px;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  color: #1a8f4a;
}
.nxd-fig em::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.05em;
}

/* ---------- Charts ---------- */
.nc {
  position: relative;
}
.nc__plot {
  position: relative;
  height: 150px;
  margin: 12px 0 0 30px;
}
.nc--hero .nc__plot {
  height: 96px;
  margin-top: 6px;
  margin-left: 22px;
}
.nc__grid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--y) * 100%);
  height: 0;
  border-top: 1px solid var(--nc-grid);
}
.nc__grid--base {
  border-top-color: var(--nc-base);
}
.nc__grid em {
  position: absolute;
  right: calc(100% + 7px);
  top: -7px;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  color: var(--m-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nc__x {
  display: flex;
  justify-content: space-between;
  margin: 7px 0 0 30px;
  font-size: 10px;
  color: var(--m-muted);
}
.nc--hero .nc__x {
  margin-left: 22px;
}
.nc__x--all span {
  flex: 1;
  text-align: center;
}
/* Columns: thin marks with a rounded data end, square at the baseline */
.nc__cols {
  position: absolute;
  inset: 0;
  display: flex;
}
.nc__c {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  height: 100%;
  cursor: default;
  transition: opacity 0.25s var(--ease), --grow 0.9s var(--ease-out);
  transition-delay: 0s, calc(0.35s + var(--k, 0) * 0.055s);
}
.nc__c i {
  flex: none;
  display: block;
  width: min(20px, 56%);
  height: calc(var(--v) * var(--grow) * 100%);
  background: var(--nc-g);
}
.nc__c i:last-child {
  border-radius: 4px 4px 0 0;
}
.nc__c.is-key i,
.nc__c--stack i:first-child {
  background: var(--nc-o);
}
.nc__c--stack i.nc__g {
  background: var(--nc-g);
}
.nc--spark .nc__c i {
  width: min(12px, 56%);
}
/* Hover: the other columns step back and the value shows on top */
.nc__cols:hover .nc__c:not(:hover) {
  opacity: 0.4;
}
.nc__c::after,
.nc__h::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(var(--v, var(--y)) * 100% + 8px);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease-out);
}
.nc__c:nth-child(-n + 2)::after,
.nc__h:nth-child(-n + 2)::after {
  left: 0;
  transform: translate(0, 4px);
}
.nc__c:nth-last-child(-n + 2)::after,
.nc__h:nth-last-child(-n + 2)::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}
.nc__c:hover::after,
.nc__h:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.nc__c:nth-child(-n + 2):hover::after,
.nc__c:nth-last-child(-n + 2):hover::after,
.nc__h:nth-child(-n + 2):hover::after,
.nc__h:nth-last-child(-n + 2):hover::after {
  transform: none;
}
/* Legend */
.nc__key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--m-muted);
}
.nc__key li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nc__sw {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--nc-g);
}
.nc__sw--o {
  background: var(--nc-o);
}
.nc__sw--ink {
  background: var(--ink);
}
.nc__sw--line {
  width: 14px;
  height: 2px;
  border-radius: 2px;
}
.nc__sw--dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
/* Horizontal bars */
.nc--hbars {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.nc__hb {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.nc__hb > i {
  display: block;
  height: 12px;
  border-left: 1px solid var(--nc-base);
}
.nc__hb > i b {
  display: block;
  width: calc(var(--v) * 100%);
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--nc-g);
  transform-origin: left;
  transition: transform 0.9s var(--ease-out) calc(0.35s + var(--k, 0) * 0.08s);
}
.nc__hb.is-key > i b {
  background: var(--nc-o);
}
.nc__hb em {
  font-style: normal;
  font-weight: 600;
  text-align: right;
}
/* The line chart: actual in ink, forecast in orange with a light band */
.nc--line .nc__plot {
  height: 168px;
  margin-left: 40px;
}
.nc--line .nc__x {
  margin-left: 40px;
}
.nc__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: clip-path 1.6s var(--ease-out) 0.35s;
  clip-path: inset(-10% 0 -10% 0);
}
.nc__band {
  fill: rgba(255, 90, 31, 0.1);
}
.nc__ln {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.nc__ln--act {
  stroke: var(--ink);
}
.nc__ln--fc {
  stroke: var(--nc-o);
}
.nc__dot,
.nc__h i {
  position: absolute;
  left: calc(var(--x) * 100%);
  bottom: calc(var(--y) * 100%);
  width: 9px;
  height: 9px;
  margin: 0 0 -4.5px -4.5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px #fff;
}
.nc__dot--fc {
  background: var(--nc-o);
}
.nc__dot,
.nc__end {
  transition: opacity 0.5s var(--ease) 1.6s;
}
.nc__end {
  position: absolute;
  right: 0;
  bottom: calc(var(--y) * 100% + 10px);
  font-size: 11px;
  font-weight: 600;
}
.nc__hits {
  position: absolute;
  inset: 0;
}
.nc__h {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--x) * 100%);
  width: calc(100% / 12);
  transform: translateX(-50%);
}
.nc__h::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(10, 10, 10, 0.16);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.nc__h i {
  left: 50%;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.nc__h[data-tip*="forecast"] i {
  background: var(--nc-o);
}
.nc__h:hover::before,
.nc__h:hover i {
  opacity: 1;
}
/* Charts in a card grow to fill it */
.nxd__card > .nc--stack,
.nxd__card > .nc--line {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nxd__card > .nc--stack .nc__plot,
.nxd__card > .nc--line .nc__plot {
  flex: 1;
  height: auto;
  min-height: 150px;
}
.nxd__mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}
.nxd__mini p {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--m-soft);
}
.nxd__mini span,
.nxd__mini small {
  display: block;
  font-size: 11px;
  color: var(--m-muted);
}
.nxd__mini b {
  display: block;
  margin: 2px 0 1px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.nxd__mini + .nxd__note {
  margin-top: 0;
  padding-top: 12px;
}
/* The site's .kpi gives every span display:block; the chart's columns stay flex */
.kpi .nc__c {
  display: flex;
}
/* Sparkline columns inside a tile */
.nc--spark .nc__plot {
  height: 44px;
  margin: 12px 0 0;
}
.nc--spark .nc__x {
  margin-left: 0;
}

/* ---------- Dashboards inside the windows ---------- */
.mock__body.nxd {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #fbfbfa;
}
.nxd .kpi {
  background: #fff;
}
.nxd .kpi small {
  font-size: 13px;
  font-weight: 500;
  color: var(--m-muted);
  letter-spacing: 0;
}
.nxd__kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.nxd__row {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 12px;
}
.nxd__row--docs {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}
.nxd__row--wide {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
}
.nxd__row--ask {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
.nxd__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--m-line);
}
.nxd__h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.nxd__h b {
  font-size: 12.5px;
  font-weight: 600;
}
.nxd__h span {
  font-size: 11px;
  color: var(--m-muted);
}
.nxd__note {
  margin-top: auto;
  padding-top: 16px;
  font-size: 12px;
  color: var(--m-muted);
}
.nxd__note b {
  color: var(--ink);
  font-weight: 600;
}
.nxd__side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
/* Conversations */
.nxd-list {
  margin-top: 6px;
}
.nxd-cv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--m-line);
}
.nxd-cv:first-child {
  border-top: 0;
}
.nxd-av {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--av);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
}
.nxd-cv b,
.nxd-tr b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.nxd-cv small,
.nxd-tr small {
  display: block;
  font-size: 11px;
  color: var(--m-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nxd-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--m-soft);
  border: 1px solid var(--m-line);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}
.nxd-tag--o {
  background: var(--orange-soft);
  border-color: #ffd3c0;
  color: var(--orange-deep);
}
/* The documents table */
.nxd-table {
  margin-top: 8px;
}
.nxd-tr {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr) 72px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--m-line);
  font-size: 12px;
}
.nxd-tr > span {
  min-width: 0;
}
.nxd-tr--h {
  padding: 4px 0 7px;
  border-top: 0;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--m-muted);
}
.nxd-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.nxd-st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
}
.nxd-st svg {
  width: 13px;
  height: 13px;
  flex: none;
}
.nxd-st--ok {
  color: #1a8f4a;
}
.nxd-st--warn {
  color: #b4530b;
}
/* The AI summary */
.nxd-ai p:not(.nxd__h) {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #3a3a3a;
}
.nxd-ai p b {
  color: var(--ink);
  font-weight: 600;
}
.nxd-btn {
  align-self: flex-start;
  margin-top: auto;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
}
/* The knowledge assistant */
.nxd-chat {
  gap: 12px;
}
.nxd-q {
  align-self: flex-end;
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
}
.nxd-a {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid var(--m-line);
  background: #fcfcfb;
  font-size: 12.5px;
  line-height: 1.5;
}
.nxd-a__who {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--m-muted);
}
.nxd-a__who i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}
.nxd-a__src {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.nxd-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 7px 7px 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--m-line);
  font-size: 12px;
  color: var(--m-muted);
}
.nxd-input i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
}
.nxd-input svg {
  width: 13px;
  height: 13px;
}
.nxd-src {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--m-line);
  font-size: 12px;
}
.nxd-src:first-of-type {
  margin-top: 6px;
  border-top: 0;
}
.nxd-src i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a8f4a;
}
.nxd-src em {
  font-size: 11px;
  font-style: normal;
  color: var(--m-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Before and after: one enquiry, task by task ---------- */
.db__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px 20px;
}
.db__head p b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.db__head p span {
  font-size: 12.5px;
  color: var(--muted-2);
}
.db__head .nc__key {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.db__plot {
  position: relative;
  margin-top: 22px;
  padding-bottom: 24px;
}
.db__grid {
  position: absolute;
  top: 0;
  bottom: 24px;
  left: calc(150px + (100% - 238px) * var(--x));
  width: 1px;
  background: var(--nc-grid);
}
.db__grid:first-child {
  background: var(--nc-base);
}
.db__grid em {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  font-size: 11px;
  font-style: normal;
  color: var(--muted-2);
  white-space: nowrap;
  transform: translateX(-50%);
}
.db__row {
  position: relative;
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 12px;
  height: 46px;
}
.db__task {
  font-size: 13.5px;
}
.db__track {
  position: relative;
  height: 100%;
}
.db__line {
  position: absolute;
  top: 50%;
  left: calc(var(--a) * 100%);
  width: calc((var(--b) - var(--a)) * 100%);
  height: 2px;
  margin-top: -1px;
  background: var(--nc-base);
  transform-origin: right;
  transition: transform 1.2s var(--ease-out) calc(0.45s + var(--k, 0) * 0.12s);
}
.db__dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}
.db__dot--b {
  left: calc(var(--b) * 100%);
  background: var(--nc-g);
}
.db__dot--a {
  left: calc(var(--a) * 100%);
  background: var(--nc-o);
  transition: left 1.2s var(--ease-out) calc(0.45s + var(--k, 0) * 0.12s);
}
.db__bv {
  position: absolute;
  bottom: calc(50% + 10px);
  left: calc(var(--b) * 100%);
  font-size: 11px;
  font-style: normal;
  color: var(--muted-2);
  white-space: nowrap;
  transform: translateX(-50%);
}
.db__after {
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.5s var(--ease) calc(1.3s + var(--k, 0) * 0.12s);
}
.db__total {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.db__total span {
  margin-right: auto;
  font-size: 13.5px;
  color: var(--muted);
}
.db__total b {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.db__total > b:first-of-type {
  color: var(--muted-2);
}
.db__total i {
  color: var(--muted-2);
}
.db__total svg {
  width: 16px;
  height: 16px;
}

/* ---------- Motion: charts draw themselves as their window opens ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* The hero chart grows when the window rises into view */
  .js .nxd-hero:not(.is-in) .nc__c,
  .showcase .panel:not(.is-built) .nc__c {
    --grow: 0;
    transition: none;
  }
  .showcase .panel:not(.is-built) .nc__hb > i b {
    transform: scaleX(0);
    transition: none;
  }
  .showcase .panel:not(.is-built) .nc__svg {
    clip-path: inset(-10% 100% -10% 0);
    transition: none;
  }
  .showcase .panel:not(.is-built) .nc__dot,
  .showcase .panel:not(.is-built) .nc__end {
    opacity: 0;
    transition: none;
  }
  /* The before-and-after chart: each orange dot slides from the old time to the new */
  .js [data-reveal]:not(.is-in) .db__dot--a {
    left: calc(var(--b) * 100%);
    transition: none;
  }
  .js [data-reveal]:not(.is-in) .db__line {
    transform: scaleX(0);
    transition: none;
  }
  .js [data-reveal]:not(.is-in) .db__after {
    opacity: 0;
    transition: none;
  }
}

/* Reduced motion: the workflow and its notice hold still */
@media (prefers-reduced-motion: reduce) {
  .nxd-hero .mn__svg .pulse {
    display: none;
  }
  .nxd-hero .mn__svg .wire,
  .nxd-hero .toast,
  .nxd-hero .mock__live i {
    animation: none;
  }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  .nxd-hero .mn {
    grid-template-columns: minmax(0, 1fr) 236px;
  }
}
@media (max-width: 860px) {
  .nxd-hero .mn {
    grid-template-columns: 1fr;
  }
  .nxd-hero .mn__side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: start;
    column-gap: 20px;
  }
  .nxd-hero .mn__side > .mono,
  .nxd-hero .nxd-fig,
  .nxd-hero .nc--hero {
    grid-column: 1;
  }
  .nxd-hero .toast {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: start;
  }
  .nxd-hero .mn__stat {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .nxd__row,
  .nxd__row--docs,
  .nxd__row--wide,
  .nxd__row--ask {
    grid-template-columns: minmax(0, 1fr);
  }
  .nxd__kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nxd__kpis .kpi:nth-child(3) {
    display: none;
  }
}
@media (max-width: 600px) {
  .nxd-hero .mn__side {
    grid-template-columns: minmax(0, 1fr);
  }
  .nxd-hero .toast {
    grid-column: 1;
    grid-row: auto;
  }
  .mock__body.nxd {
    padding: 12px;
  }
  .nxd__card {
    padding: 12px 13px 14px;
  }
  .nc__hb {
    grid-template-columns: 104px minmax(0, 1fr) 30px;
  }
  .db__row {
    grid-template-columns: 104px minmax(0, 1fr) 64px;
    gap: 10px;
  }
  .db__grid {
    left: calc(114px + (100% - 188px) * var(--x));
  }
  .db__task {
    font-size: 12.5px;
  }
  .db__after {
    font-size: 12px;
  }
}
