/* public/radar.css — Product Radar (public/radar.js). Built on library.css: same
   tokens, tabs, panels, chart and buttons; only the product card and the drawer are new. */
.radar-sources { display: grid; gap: 0; margin: -6px 0 18px; border-top: 1px solid var(--border); }
.radar-src { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.radar-src-txt { display: grid; gap: 2px; min-width: 0; font-size: 13px; color: var(--text-2); }
.radar-src-txt b { color: var(--text); font-size: 14px; font-weight: 600; }
.radar-src-err { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.radar-refresh { flex: none; }


/* Product Radar in the Brands grammar (founder, 26/10): the shared 22px title,
   one line with the counts and the guide / sources buttons, Brands' search field,
   one line of square chips (Category, Score, Price, Sort), then one 58px row per
   product with fixed columns, so every figure sits under the one above it. The
   hero, its three tiles, the category pills and the 620px cards are gone. */
.radar-head { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s2); }
.radar-tabs { justify-content: space-between; min-height: calc(var(--h-sm) + var(--s3)); padding-bottom: var(--s3); margin: 0 calc(-1 * var(--page-gutter, var(--s4))); padding-left: var(--page-gutter, var(--s4)); padding-right: var(--page-gutter, var(--s4)); border-bottom: 1px solid var(--border); }
.radar-count { margin: 0; font-size: var(--fs-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.radar-count b { color: var(--text); font-weight: 600; }
.radar-dot { margin: 0 var(--s2); }
.radar-tabs .dir-hd-act { display: flex; gap: var(--s2); margin-left: auto; }
.radar-tabs .dir-hd-act .btn { height: var(--h-sm); padding: 0 var(--s3); font-size: var(--fs-sm); border-radius: var(--r-xs); }
.radar-tabs .btn[aria-expanded="true"] { background: var(--panel-3); }
/* a source that is not working: a small warm dot on Sources, the words in its tooltip */
.radar-src-btn { position: relative; }
.radar-src-btn.is-warn::after { content: ''; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn, #e0a030); }
.radar-head .radar-help { margin: 0; padding: var(--s3) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-ui); color: var(--text-2); }
.radar-head .radar-help p { margin: 0 0 var(--s2); max-width: 80ch; line-height: 1.5; }
.radar-head .radar-help p:last-child { margin-bottom: 0; }
.radar-head .radar-sources { margin: 0; }
.radar-head .radar-sources[hidden] { display: none; }

/* search, then the chips: Brands' components */
.radar-bar { display: flex; flex-direction: column; gap: var(--s2); padding-top: var(--s1); }
.radar-search { position: relative; flex: none; width: min(420px, 100%); }
.radar-search .cmp-field-ico { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cmp-pane .radar-search.cmp-field .cmp-input { width: 100%; height: var(--h-md); padding-left: 32px; padding-right: var(--s3); font-size: var(--fs-ui); border-radius: var(--r-xs); background: var(--panel); }
.radar-filters { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.cmp-pane .radar-filters .dir-chip { height: var(--h-sm); padding: 0 24px 0 10px; gap: 6px; border-radius: var(--r-xs); background: var(--panel-2); font-size: var(--fs-sm); flex: none; }
.cmp-pane .radar-filters .dir-chip::after { right: 9px; width: 4px; height: 4px; }
.cmp-pane .radar-filters .dir-chip-k::after { content: ':'; }
.radar-filters .dir-chip-v { max-width: 180px; }
/* Price: two small fields inside one chip, no chevron */
.cmp-pane .radar-filters .radar-pricechip { padding: 0 6px 0 10px; cursor: default; }
.cmp-pane .radar-filters .radar-pricechip::after { content: none; }
.radar-pricechip .radar-price { width: 52px; height: 22px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 500; -moz-appearance: textfield; }
.radar-pricechip .radar-price::-webkit-outer-spin-button, .radar-pricechip .radar-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.radar-pricechip .radar-price:focus-visible { outline: none; box-shadow: var(--focus); }
.radar-price-sep { color: var(--muted); }

/* the list: fixed columns (product, score, price, sales, revenue, reviews, rank, tools) */
.radar-list { border-top: 1px solid var(--border); }
.cmp-pane .dir-row.radar-row {
  grid-template-columns: minmax(240px, 1fr) 104px 100px 112px 148px 140px 100px 72px;
  min-height: 58px; padding: var(--s2); gap: var(--s3); cursor: pointer;
}
.radar-row:focus-within { background: var(--panel-2); }
.radar-c-prod { display: flex; align-items: center; gap: 10px; }
.radar-pic { flex: none; width: 42px; height: 42px; border-radius: var(--r-xs); background: #fff; object-fit: contain; padding: 2px; box-sizing: border-box; }
.radar-pic.is-none { background: var(--panel-3); }
.radar-name { display: block; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-body); font-weight: 600; line-height: 18px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.radar-name:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.radar-row .dir-sub-txt { font-size: var(--fs-sm); line-height: 16px; }
.radar-row .dir-fig { align-items: baseline; gap: 5px; }
.radar-row .dir-fig-n { font-size: var(--fs-body); }
.radar-row .dir-fig-u { font-size: var(--fs-sm); }
/* the score: number and label, a small dot for its band, never a filled badge */
.radar-c-score { align-items: center; }
.radar-tone { flex: none; align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--border-2); }
.radar-tone.is-hot { background: var(--ok); }
.radar-tone.is-watch { background: var(--accent); }
.radar-delta { font-size: var(--fs-sm); color: var(--ok); }
.radar-c-act { justify-content: flex-end; gap: 0; }
.radar-row .dir-track, .radar-row .dir-open { width: var(--h-md); height: var(--h-md); }
.radar-row .dir-track .ico, .radar-row .dir-open .ico { width: 16px; height: 16px; }
.radar-save.is-saved { color: var(--accent-ink); background: transparent; }
.radar-save.is-saved .ico { fill: currentColor; }
.radar-list .dir-empty { padding: var(--s5) var(--s3); }

/* the page is a container: the columns step down with the room, not the window */
.cmp-pane.is-radar #libRoot, .lib-page:has(.radar-list, .radar-cards) { container: radarpage / inline-size; }
@container radarpage (max-width: 1060px) {
  .cmp-pane .dir-row.radar-row { grid-template-columns: minmax(220px, 1fr) 104px 100px 112px 148px 72px; }
  .radar-row .radar-c-reviews, .radar-row .radar-c-rank { display: none; }
}
/* phone: the product and its tools, then score, price and sales on one line */
@container radarpage (max-width: 640px) {
  .cmp-pane .dir-row.radar-row {
    position: relative; grid-template-columns: 100px 96px minmax(0, 1fr); grid-template-areas: 'prod prod prod' 'score price sales';
    row-gap: var(--s1); column-gap: var(--s3); padding: var(--s3) var(--s2);
  }
  .radar-row .radar-c-prod { grid-area: prod; padding-right: calc(2 * 40px + var(--s1)); }
  /* the score's word and the rating live in the tooltip and the drawer here */
  .radar-row .radar-c-score .dir-fig-u, .radar-row .radar-c-price .dir-fig-u { display: none; }
  .radar-row .radar-c-score { grid-area: score; padding-left: calc(42px + 10px); }
  .radar-row .radar-c-price { grid-area: price; }
  .radar-row .radar-c-sales { grid-area: sales; }
  .radar-row .radar-c-rev, .radar-row .radar-c-reviews, .radar-row .radar-c-rank { display: none; }
  .radar-row .radar-c-act { position: absolute; top: var(--s3); right: var(--s2); }
  .radar-filters { overflow-x: auto; scrollbar-width: none; }
  .cmp-pane .radar-filters .dir-chip { height: var(--h-md); }
  .radar-row .dir-track, .radar-row .dir-open { width: 40px; height: 40px; }
}

/* Grid or List: two square icon buttons after Sort, Brands' chip fill */
.radar-view { display: inline-flex; flex: none; gap: 2px; padding: 2px; border-radius: var(--r-xs); background: var(--panel-2); }
.radar-view-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.radar-view-btn .ico { width: 14px; height: 14px; }
.radar-view-btn:hover { color: var(--text); }
.radar-view-btn[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.radar-view-btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* the grid (founder, 27/10: « oui pour le Radar »). The square photo is the tile,
   like Explore's: no frame, no border. Under it the name on two lines, one reading
   line (score chip, revenue a month, 30-day trend) and a quiet line (price, rating,
   rank, tag). Save and Amazon appear on hover; a saved product keeps its bookmark.
   Tokens only. */
.radar-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: var(--s5) var(--s4); padding-top: var(--s3); }
.radar-card { display: flex; flex-direction: column; min-width: 0; cursor: pointer; container: radarcard / inline-size; }
.radar-media { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r); overflow: hidden; background: #fff; }
.radar-media::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
.radar-media img { width: 100%; height: 100%; object-fit: contain; padding: 8%; box-sizing: border-box; transition: transform .35s cubic-bezier(.32, .72, 0, 1); }
.radar-card:hover .radar-media img { transform: scale(1.03); }
.radar-noimg { display: block; width: 100%; height: 100%; background: var(--panel-3); }
.radar-acts { position: absolute; right: var(--s2); top: var(--s2); display: flex; gap: 4px; }
.radar-acts .radar-save, .radar-act { display: inline-grid; place-items: center; width: var(--h-sm); height: var(--h-sm); padding: 0; border: 0; border-radius: var(--r-xs); background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; opacity: 0; transform: translateY(-2px); transition: opacity .15s ease, transform .15s ease; }
.radar-acts .ico { width: 15px; height: 15px; }
.radar-card:hover .radar-acts > *, .radar-card:focus-within .radar-acts > *, .radar-acts .radar-save.is-saved { opacity: 1; transform: none; }
.radar-acts .radar-save.is-saved .ico { fill: currentColor; }
.radar-card .radar-name > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.radar-card .radar-name { display: flex; align-items: flex-start; white-space: normal; overflow: hidden; height: 36px; margin: 10px 0 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-ui); font-weight: 500; line-height: 18px; text-align: left; cursor: pointer; }
.radar-line { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s2); min-width: 0; }
.radar-lead { display: inline-flex; align-items: center; gap: var(--s2); min-width: 0; }
.radar-card .radar-score { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: var(--r-xs); font-size: var(--fs-ui); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.radar-card .radar-score.is-hot { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }
.radar-card .radar-score.is-watch { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.radar-rev { display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.radar-rev b { font-size: var(--fs-title); font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.radar-rev span { font-size: var(--fs-sm); color: var(--muted); }
.radar-trend { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.radar-trend svg { width: 40px; height: 16px; overflow: visible; }
.radar-spark-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.radar-spark-area { stroke: none; fill: currentColor; opacity: .12; }
.radar-trend.is-up { color: var(--ok); }
.radar-trend.is-down { color: var(--danger); }
.radar-trend.is-flat, .radar-trend.is-wait { color: var(--muted); font-weight: 500; }
.radar-meta { margin: 6px 0 0; font-size: var(--fs-sm); line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.radar-meta em { font-style: normal; font-weight: 500; color: var(--text); }
.radar-mtag.is-new { color: var(--ok); font-weight: 600; }
/* a narrow tile drops the sparkline before the figures can touch; touch screens have no hover */
@container radarcard (max-width: 211px) { .radar-trend svg { display: none; } }
@media (hover: none) and (pointer: coarse) { .radar-acts > * { opacity: 1; transform: none; } }
.radar-savedbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.radar-savedbar .lib-summary { margin: 0; }
.radar-cards .dir-empty { grid-column: 1 / -1; margin: 0; padding: var(--s5) 0; }
@container radarpage (max-width: 640px) {
  .radar-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s2); }
  .radar-trend svg { display: none; }
  .radar-acts > * { opacity: 1; transform: none; }
  .radar-view-btn { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) { .radar-media img, .radar-acts > * { transition: none; } .radar-card:hover .radar-media img { transform: none; } }
.radar-dfs-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.radar-dfs-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.radar-dfs-form .lib-input { flex: 1 1 200px; }
.radar-dfs-form .lib-note { flex: 1 1 100%; margin: 0; }
.radar-dfs-cap { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.radar-dfs-cap .lib-input { flex: 0 0 90px; width: 90px; }
.radar-src-name { color: var(--muted); font-size: 13px; }
.radar-more { display: flex; justify-content: center; margin: 22px 0 0; }

.radar-drawer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); display: flex; justify-content: flex-end; }
.radar-panel { width: min(620px, 100%); height: 100%; overflow-y: auto; background: var(--bg); color: var(--text); padding: 8px 28px 48px; box-shadow: -24px 0 48px -24px #000; }
.radar-dhead { display: flex; gap: 18px; align-items: flex-start; margin: 16px 0 18px; }
.radar-dhead img { width: 104px; height: 104px; object-fit: contain; background: #fff; border-radius: var(--r-lg); flex: none; }
.radar-dhead > div { display: grid; gap: 6px; min-width: 0; }
.radar-dtitle { margin: 0; font: 600 18px/1.3 var(--xdisplay, inherit); }
.radar-dstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 14px; border: 1px solid var(--border-2); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.radar-dstats > div { display: grid; gap: 3px; padding: 14px 16px; min-width: 0; }
.radar-dstats > div + div { border-left: 1px solid var(--border-2); }
.radar-dstats b { font: 700 26px/1 var(--xdisplay, inherit); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.radar-dstats span { color: var(--muted); font-size: 12px; line-height: 1.3; }
/* Key figures: a ruled table, label left, value right, two columns. */
.radar-panel .lib-h3 { margin: 26px 0 10px; font-size: 16px; }
.radar-dl { display: grid; margin: 0; padding: 4px 16px; border: 1px solid var(--border-2); border-radius: var(--r-lg); background: var(--panel); }
.radar-dl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-width: 0; padding: 10px 0; }
.radar-dl-row + .radar-dl-row { border-top: 1px solid var(--border); }
.radar-dl dt { color: var(--muted); font-size: 12px; flex: none; }
.radar-dl dd { margin: 0; font-size: 13.5px; font-weight: 600; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.radar-panel .lib-panel { border: 1px solid var(--border-2); }
.radar-hist { border-top: 1px solid var(--border-2); padding-top: 8px; }
.radar-parts { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-2); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.radar-parts .lib-bar-row { padding: 11px 16px; border-bottom: 1px solid var(--border); }
.radar-parts .lib-bar-row:last-child { border-bottom: 0; }
.radar-parts .lib-bar-v { font-weight: 600; }
.radar-hist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.radar-hist li { display: flex; justify-content: space-between; color: var(--text-2); }
.radar-hist b { color: var(--text); font-weight: 600; }

@media (max-width: 640px) {
  .radar-src { align-items: flex-start; flex-direction: column; gap: 8px; }
  .radar-dstats > div { padding: 12px; }
  .radar-dstats b { font-size: 22px; }
  .radar-panel { padding: 8px 16px 40px; }
}

/* Secondary text a step lighter inside the Radar (the pane is always dark): clears AA with room on the card and panel fills. */
.radar-panel { --muted: #A6AAB2; --text-2: #C6C9D0; }
/* The detail drawer enters like the ad drawer: the dim fades, the panel slides in on the spring. */
.radar-drawer { animation: mo-fade-in var(--dur-2) var(--ease-out) backwards; }
.radar-panel { animation: radar-slide var(--dur-3) var(--spring) backwards; touch-action: pan-y; }
@keyframes radar-slide { from { transform: translateX(48px); opacity: 0; } }
