/* ==========================================================================
   analytics.css — the Recettes › Analyse dashboard.

   Everything here is drawn from the design tokens and hand-rolled SVG: no
   chart library, no web font, no image, nothing off this machine (inventory
   G5). The whole sheet uses logical properties, so `dir="rtl"` mirrors it with
   no overrides — except the charts themselves, which stay left-to-right on
   purpose (see `.np-ch`).
   ========================================================================== */

/* `--np-surface-2` was written against a token that never landed in
   tokens.css, so every rule below that asked for it has always resolved to
   "invalid at computed-value time" — i.e. transparent. It is aliased to the
   token it meant (the warm off-white behind cards) rather than rewriting the
   nine rules that use it. No new colour is invented: this is an alias, and it
   is scoped to the dashboard so the two rules in components.css that make the
   same mistake keep rendering exactly as they do today. */
#np-analytics { --np-surface-2: var(--np-surface-alt); }

/* --- the period bar ------------------------------------------------------ */

/* Sticky (SPEC-ANALYTICS §5.4): the presets, the compare select and the filter
   chips stay reachable while the owner scrolls fifteen cards. */
.np-an-bar {
  position: sticky;
  inset-block-start: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-block: 8px 14px;
  background: var(--np-cream);
}
.np-an-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--np-surface-2);
  border: 1px solid var(--np-muted-line-2);
  border-radius: 12px;
}
.np-an-preset {
  /* 40 px on a desk machine, 48 px on a touch one — the same floor every other
     control on the screen answers to (DESIGN-SPEC §2) */
  display: inline-flex;
  align-items: center;
  min-block-size: var(--np-touch);
  padding: 7px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--np-dim);
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.np-an-preset:hover { color: var(--np-ink); background: var(--np-surface); }
.np-an-preset.is-active {
  color: var(--np-surface);
  background: var(--np-ink);
  box-shadow: 0 1px 3px rgba(58, 52, 43, 0.28);
}
/* Its own shadow beat base.css's :focus-visible on source order at the same
   specificity, so the SELECTED period chip — the one a keyboard user lands on
   first — had no focus cue at all (W22). Compose both. */
.np-an-preset.is-active:focus-visible {
  box-shadow: var(--np-sh-focus), 0 1px 3px rgba(58, 52, 43, 0.28);
}

/* --- the hero ------------------------------------------------------------ */

.np-an-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.15fr);
  gap: 20px;
  padding: 22px 24px;
  overflow: hidden;
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(110, 94, 198, 0.11), transparent 62%),
    var(--np-surface);
  border: 1px solid var(--np-muted-line-2);
  border-radius: 18px;
}
.np-an-hero__figure { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.np-an-hero__num {
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--np-ink);
  font-variant-numeric: tabular-nums;
}
.np-an-hero__unit { font-size: 0.46em; font-weight: 600; color: var(--np-dim); }
.np-an-hero__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block-start: 8px; }

.np-an-delta {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
/* --np-waiter-badge-text measures 4.47:1 on this tint — a hair under AA, and
   this pill is the first thing anyone reads. Darkened here only; the token is
   correct everywhere else it is used. */
.np-an-delta--up   { color: #2A7133; background: rgba(63, 163, 77, 0.13); }
.np-an-delta--down { color: #A33A32;                     background: rgba(179, 53, 47, 0.11); }
/* --np-dim on --np-surface-2 measures 4.49:1 — one hundredth under AA, which
   is why this only failed on the runs where the period happened to be flat.
   Darkened here only; the token is fine on the page background. */
.np-an-delta--flat { color: #685D4F;                     background: var(--np-surface-2); }

/* the mini KPIs beside the hero figure */
.np-an-minis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.np-an-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  background: var(--np-surface-2);
  border: 1px solid var(--np-muted-line);
  border-radius: 12px;
}
.np-an-mini__v {
  font-size: 19px;
  font-weight: 700;
  color: var(--np-ink);
  font-variant-numeric: tabular-nums;
}
.np-an-mini__k { font-size: 11.5px; font-weight: 600; color: var(--np-dim); }

/* --- section scaffolding ------------------------------------------------- */

.np-an-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
  padding-block-start: 14px;
}
.np-an-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--np-surface);
  border: 1px solid var(--np-muted-line-2);
  border-radius: 16px;
}
.np-an-card--wide { grid-column: 1 / -1; }
.np-an-card__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.np-an-card__title { font-size: 14px; font-weight: 700; color: var(--np-ink); }
.np-an-card__hint { font-size: 12px; color: var(--np-dim); }
.np-an-card__head .np-end { margin-inline-start: auto; }

/* The `.np-an-chart` block that used to live here — the stretched
   `preserveAspectRatio="none"` SVG, its HTML x axis, `.np-an-bar-rect`,
   `.np-an-area` and the shared `#np-an-grad` — died with the old analytics.js.
   charts.js is now the only chart code on this screen, and its styles are the
   `.np-ch-*` block at the bottom of this file. */

/* --- the weekday x hour heatmap ------------------------------------------ */

.np-an-heat { direction: ltr; overflow-x: auto; }
.np-an-heat table { border-collapse: separate; border-spacing: 3px; }
.np-an-heat th {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--np-dim);
  text-align: center;
  white-space: nowrap;
}
.np-an-heat th[scope="row"] { text-align: end; padding-inline-end: 4px; }
.np-an-heat td {
  inline-size: 21px;
  block-size: 21px;
  border-radius: 5px;
  background: var(--np-lav);
  transition: transform 0.1s ease;
}
.np-an-heat td:hover { transform: scale(1.28); }
.np-an-heat td.is-empty { background: var(--np-surface-2); }

/* --- ranked rows (products, sellers, tables, categories) ----------------- */

.np-an-rows { display: flex; flex-direction: column; }
.np-an-row {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  /* a ranked row is a <button> when it filters the dashboard (SPEC-ANALYTICS
     §5.4), and a button centres its text and undersizes itself: both are said
     here once rather than at nineteen call sites */
  min-block-size: var(--np-touch);
  padding: 9px 4px;
  text-align: start;
  border-block-end: 1px solid var(--np-divider);
}
.np-an-row:is(button):hover { background: var(--np-surface-alt); }
.np-an-row:last-child { border-block-end: 0; }
.np-an-row__rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--np-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
/* name, sub-line and share bar stack; as plain inline spans they ran together
   into "Dimanche2 x" and the share bar collapsed to nothing */
.np-an-row__main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-inline-size: 0;
}
.np-an-row__name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--np-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-an-row__sub { font-size: 11.5px; color: var(--np-dim); }
.np-an-row__val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--np-ink);
  text-align: end;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.np-an-row__val small { display: block; font-size: 11px; font-weight: 600; color: var(--np-dim); }

/* the share bar sits under the name, sized by --np-an-pct */
.np-an-share {
  block-size: 4px;
  margin-block-start: 5px;
  overflow: hidden;
  background: var(--np-surface-2);
  border-radius: 999px;
}
.np-an-share i {
  display: block;
  block-size: 100%;
  inline-size: var(--np-an-pct, 0%);
  background: var(--np-lav);
  border-radius: 999px;
}
.np-an-share--alt i { background: var(--np-amber, #E08A24); }

/* --- ABC badge ----------------------------------------------------------- */

.np-an-abc {
  display: inline-block;
  min-inline-size: 17px;
  padding: 1px 5px;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  border-radius: 5px;
}
/* --np-waiter-badge-text (#2E7D39) measures 4.29:1 on this tint at 10.5px —
   under the 4.5:1 the acceptance contract asks for. Darkened here only; the
   token itself is unchanged because it passes everywhere else it is used. */
.np-an-abc--A { color: #2A7133; background: rgba(63, 163, 77, 0.15); }
.np-an-abc--B { color: var(--np-amber-badge-text);  background: rgba(224, 138, 36, 0.16); }
.np-an-abc--C { color: var(--np-dim);               background: var(--np-surface-2); }

/* --- small stat list ----------------------------------------------------- */

.np-an-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.np-an-stat { display: flex; flex-direction: column; gap: 1px; }
.np-an-stat__v { font-size: 17px; font-weight: 700; color: var(--np-ink); font-variant-numeric: tabular-nums; }
.np-an-stat__k { font-size: 11.5px; color: var(--np-dim); }

/* --- chips (pairs bought together, unused tables, not-sold products) ----- */

.np-an-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.np-an-chip {
  padding: 5px 10px;
  font-size: 12px;
  color: var(--np-ink);
  background: var(--np-surface-2);
  border: 1px solid var(--np-muted-line);
  border-radius: 999px;
}
.np-an-chip b { font-weight: 700; }

/* --- data-quality strip -------------------------------------------------- */

.np-an-quality { display: flex; flex-wrap: wrap; gap: 8px; }
.np-an-flag {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
}
.np-an-flag--ok   { color: var(--np-waiter-badge-text); background: rgba(63, 163, 77, 0.12); }
.np-an-flag--warn { color: var(--np-amber-badge-text);  background: rgba(224, 138, 36, 0.15); }

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .np-an-hero { grid-template-columns: 1fr; padding: 18px; }
  .np-an-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .np-an-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .np-an-preset { padding: 6px 10px; font-size: 12px; }
  .np-an-heat td { inline-size: 15px; block-size: 15px; }
}

/* The dashboard prints: the period bar and the buttons go, the cards stay and
   are not split across pages. */
@media print {
  .np-an-bar, .np-an-card__head .np-btn { display: none !important; }
  .np-an-card, .np-an-hero { break-inside: avoid; border-color: #CFC7B8; }
  .np-an-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- section headings ----------------------------------------------------
   The dashboard is read top to bottom as a sequence of questions, so each
   group gets a heading rather than dissolving into one long grid. */
.np-an-sec {
  margin: 22px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--np-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.np-an-sec + .np-an-grid { padding-block-start: 8px; }

/* --- the custom from/to range -------------------------------------------- */
.np-an-range {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 14px;
  margin-block-end: 4px;
  background: var(--np-surface);
  border: 1px solid var(--np-muted-line-2);
  border-radius: 14px;
}
.np-an-range__f { display: flex; flex-direction: column; gap: 4px; }
.np-an-range__f > span { font-size: 11.5px; font-weight: 600; color: var(--np-dim); }
.np-an-range__f .np-input { inline-size: auto; }
.np-an-range--sheet { padding: 10px 0 0; background: none; border: 0; }

/* --- the export sheet ----------------------------------------------------- */
.np-an-export { max-inline-size: 520px; }
.np-an-fs {
  padding: 12px 14px;
  margin: 0;
  border: 1px solid var(--np-muted-line-2);
  border-radius: 14px;
}
.np-an-fs > legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--np-dim);
}
.np-an-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 4px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--np-ink);
  cursor: pointer;
}
.np-an-opt + .np-an-opt { border-block-start: 1px solid var(--np-divider); }
.np-an-opt input { margin-block-start: 2px; }

/* ==========================================================================
   The chart kit — charts.js (SPEC-ANALYTICS §5.2 / §5.5)

   Every colour comes from a token; charts.js never writes a fill except the
   per-slice / per-floor colours it is handed, and the one custom property
   `--np-ch-hatch` that carries this SVG own <pattern> id (ids must be unique
   per SVG — a shared one made the second chart on the page steal the paint of
   the first). The plot stays left-to-right in every locale: a time axis that
   ran right-to-left would make the trend lie.
   ========================================================================== */

.np-ch {
  position: relative;
  direction: ltr;
  inline-size: 100%;
  touch-action: pan-y;            /* a horizontal drag brushes, a vertical one
                                     still scrolls the page on a tablet */
  outline: 0;
}
.np-ch:focus-visible { box-shadow: var(--np-sh-focus); border-radius: 8px; }
.np-ch svg { display: block; inline-size: 100%; block-size: auto; overflow: visible; }

.np-ch-grid { stroke: var(--np-divider); }
.np-ch-axis { stroke: var(--np-line); }
.np-ch-tick {
  font-size: 11px;
  fill: var(--np-dim);
  font-variant-numeric: tabular-nums;
}
.np-ch-tick--row { font-weight: 600; }

.np-ch-bar { fill: var(--np-lav); }
.np-ch-bar:hover, .np-ch-bar.is-focus { fill: var(--np-lav-strong); }
.np-ch-bar.is-dim { fill: var(--np-muted-line-2); }
.np-ch-bar.is-hl { stroke: var(--np-ink); stroke-width: 1.5; }
/* the hatch is per-SVG, so the id travels in a custom property */
.np-ch-bar--compare { fill: var(--np-ch-hatch, var(--np-dim-decor)); }
.np-ch-bar--compare:hover, .np-ch-bar--compare.is-focus { fill: var(--np-dim-decor); }
.np-ch-bar--alt { fill: var(--np-amber); }
.np-ch-bar--pos { fill: var(--np-green); }
.np-ch-bar--neg { fill: var(--np-red); }

.np-ch-line {
  fill: none;
  stroke: var(--np-lav-strong);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.np-ch-line--compare { stroke: var(--np-dim-decor); stroke-dasharray: 4 3; }
.np-ch-line--alt { stroke: var(--np-amber); }
.np-ch-line--pos { stroke: var(--np-green); }
.np-ch-line--neg { stroke: var(--np-red); }
.np-ch-area { fill: var(--np-lav); opacity: 0.16; }
.np-ch-step { stroke: var(--np-muted-line); stroke-dasharray: 3 3; }

.np-ch-val { font-size: 10.5px; fill: var(--np-mid); font-variant-numeric: tabular-nums; }
.np-ch-focus { fill: var(--np-lav); opacity: 0.08; }
.np-ch-brush { fill: var(--np-lav); opacity: 0.18; stroke: var(--np-lav-strong); }

/* donut: the slice colour is a per-row value (floors.color, else the
   DESIGN-SPEC §1.1 palette), so it arrives as a fill attribute — no rule here
   may set `fill` on a slice or it would win over it. */
.np-ch-slice { stroke: var(--np-surface); stroke-width: 1; }
.np-ch-slice:hover, .np-ch-slice.is-focus { opacity: 0.85; }
.np-ch-slice.is-hl { stroke: var(--np-ink); stroke-width: 2; }
.np-ch-center__v {
  font-size: 17px;
  font-weight: 700;
  fill: var(--np-ink);
  font-variant-numeric: tabular-nums;
}
.np-ch-center__k { font-size: 11px; fill: var(--np-dim); }

/* heatmap: one token, intensity through fill-opacity */
.np-ch-cell { fill: var(--np-lav); }
.np-ch-cell.is-empty { fill: var(--np-soft); }
.np-ch-cell:hover, .np-ch-cell.is-focus { stroke: var(--np-ink); stroke-width: 1.2; }
.np-ch-cell.is-hl { stroke: var(--np-ink); stroke-width: 1.6; }

/* --- legend --------------------------------------------------------------- */

.np-ch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-block-start: 8px;
}
.np-ch-legend__item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-block-size: var(--np-touch);
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--np-ink);
  cursor: pointer;
  background: var(--np-surface);
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-pill);
}
.np-ch-legend__item[aria-pressed="false"] { color: var(--np-dim); text-decoration: line-through; }
.np-ch-legend__item[aria-pressed="false"] .np-ch-legend__dot { opacity: 0.35; }
.np-ch-legend__dot {
  flex: none;
  inline-size: 10px;
  block-size: 10px;
  background: var(--np-ch-dot, var(--np-lav));
  border-radius: 3px;
}
.np-ch-legend__dot--compare { background: var(--np-dim-decor); }
.np-ch-legend__dot--alt { background: var(--np-amber); }
.np-ch-legend__dot--pos { background: var(--np-green); }
.np-ch-legend__dot--neg { background: var(--np-red); }

/* --- the one shared tooltip ---------------------------------------------- */

.np-ch-tip {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  max-inline-size: 260px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--np-cream);
  background: var(--np-ink);
  border-radius: 10px;
  box-shadow: var(--np-sh-toast);
  direction: ltr;
}
.np-ch-tip__t { padding-block-end: 3px; font-weight: 700; }
.np-ch-tip__r { display: flex; gap: 10px; justify-content: space-between; }
.np-ch-tip__k { color: var(--np-onink-2); }
.np-ch-tip__v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Dashboard furniture the kit is drawn into (SPEC-ANALYTICS §5.4 / §5.5)
   ========================================================================== */

/* --- active filters ------------------------------------------------------- */

.np-an-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex-basis: 100%; }
.np-an-filter {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-block-size: var(--np-touch);
  padding-inline: 12px 6px;
  padding-block: 4px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--np-lav-ink);
  cursor: pointer;
  background: var(--np-lav-soft);
  border: 1px solid var(--np-lav-hover);
  border-radius: var(--np-r-pill);
}
.np-an-filter:hover { background: var(--np-lav-hover); }
/* the cross sits at the inline end, so it mirrors with the language */
.np-an-filter__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 22px;
  block-size: 22px;
  font-size: 13px;
  background: var(--np-surface);
  border-radius: 50%;
}
.np-an-note {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--np-dim);
}
.np-an-printonly { display: none; }

/* --- the section jump chips (phone) --------------------------------------- */

/* §5.4 lists the jump chips under "Phone": they exist because a stacked
   single-column dashboard is long. On a PC the bar is already sticky and the
   grid is two columns, and the extra row cost the sticky bar a third of a
   768 px screen — so they appear only where they earn their place. */
.np-an-jump { display: none; flex-basis: 100%; gap: 6px; overflow-x: auto; }
@media (max-width: 899px) { .np-an-jump { display: flex; } }
.np-an-jump a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--np-touch);
  padding-inline: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--np-mid);
  text-decoration: none;
  white-space: nowrap;
  background: var(--np-surface);
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-pill);
}

/* --- the loading skeleton ------------------------------------------------- */

.np-an-skel {
  block-size: 120px;
  background:
    linear-gradient(90deg, var(--np-soft) 25%, var(--np-surface-alt) 37%, var(--np-soft) 63%);
  background-size: 400% 100%;
  border-radius: 16px;
  animation: np-an-shimmer 1.4s ease-in-out infinite;
}
.np-an-skel--tall { block-size: 220px; }
@keyframes np-an-shimmer {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .np-an-skel { animation: none; }
}

/* --- hero pills ----------------------------------------------------------- */

.np-an-pill--bench { color: var(--np-lav-ink);   background: var(--np-lav-soft); }
.np-an-pill--proj  { color: var(--np-amber-ink); background: var(--np-amber-soft); }

/* --- budget gauge --------------------------------------------------------- */

.np-an-gauge { display: flex; flex-direction: column; gap: 6px; padding-block: 8px; }
.np-an-gauge__head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.np-an-gauge__m { font-size: 13px; font-weight: 600; color: var(--np-ink); }
.np-an-gauge__v { font-size: 12.5px; color: var(--np-mid); font-variant-numeric: tabular-nums; }
.np-an-gauge .np-bar { inline-size: 100%; block-size: 10px; }
.np-an-gauge .np-bar__fill { background: var(--np-green); }
.np-an-gauge.is-warn .np-bar__fill { background: var(--np-amber); }
.np-an-gauge.is-over .np-bar__fill { background: var(--np-red); }

/* --- alert chips ---------------------------------------------------------- */

.np-an-alerts { display: flex; flex-wrap: wrap; gap: 6px; }
.np-an-alerts a, .np-an-alerts button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-block-size: var(--np-touch);
  padding-inline: 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--np-amber-ink);
  text-decoration: none;
  cursor: pointer;
  background: var(--np-amber-soft);
  border: 1px solid var(--np-amber-line);
  border-radius: var(--np-r-pill);
}
.np-an-alerts .is-danger {
  color: var(--np-red);
  background: var(--np-red-soft);
  border-color: var(--np-red-line);
}

/* --- the tickets sheet ---------------------------------------------------- */

.np-an-tk { display: flex; flex-direction: column; gap: 6px; }
.np-an-tk__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-block-size: var(--np-touch);
  padding: 10px 12px;
  font: inherit;
  text-align: start;
  cursor: pointer;
  background: var(--np-surface);
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-line);
}
.np-an-tk__row:hover { border-color: var(--np-line-input); }
.np-an-tk__row.is-open { border-color: var(--np-lav); box-shadow: var(--np-sh-ring); }
.np-an-tk__ref {
  font-family: var(--np-font-mono);
  font-size: 12px;
  color: var(--np-mid);
}
.np-an-tk__main { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.np-an-tk__name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--np-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-an-tk__sub { font-size: 11.5px; color: var(--np-dim); }
.np-an-tk__tot {
  font-size: 14px;
  font-weight: 700;
  color: var(--np-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.np-an-tk__acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; }

/* --- phone ---------------------------------------------------------------- */

@media (max-width: 560px) {
  .np-ch-tick { font-size: 10px; }
  .np-ch-val { font-size: 9.5px; }
  .np-ch-legend__item { padding-inline: 8px; font-size: 11.5px; }
  .np-ch-tip { max-inline-size: 200px; font-size: 12px; }
  /* the presets scroll instead of wrapping, so the bar stays one row high */
  .np-an-presets { flex-wrap: nowrap; overflow-x: auto; }
  .np-an-tk__row { grid-template-columns: minmax(0, 1fr) auto; }
  .np-an-tk__ref { grid-column: 1 / -1; }
}

/* --- print ---------------------------------------------------------------- */

@media print {
  .np-an-filters, .np-an-jump, .np-ch-legend, .np-ch-tip,
  .np-an-card__head button, .np-an-tk__acts { display: none !important; }
  .np-an-printonly { display: block; }
  .np-ch { break-inside: avoid; }
}
