/* Notino Multimarket Research - component primitives.
   Depends on dist/tokens.css. Plain CSS so it works in the React dashboard, in HTML slides and in the preview.
   Class prefix: nt-. Colours only through tokens. */

/* ---------- Base ---------- */
.nt-root, .nt-root * { box-sizing: border-box; }
.nt-root {
  font-family: var(--nt-font-sans);
  font-size: var(--nt-text-body);
  line-height: var(--nt-text-body-lh);
  color: var(--nt-ink);
  background: var(--nt-page);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
.nt-root :focus-visible { outline: 2px solid var(--nt-focus); outline-offset: 2px; }

/* ---------- Type (brand: headings Light/Regular/Medium, no bold, no italics, no caps, LH 100 %) ---------- */
.nt-display { font-size: var(--nt-text-display); line-height: var(--nt-text-display-lh); font-weight: var(--nt-text-display-weight); letter-spacing: var(--nt-text-display-tracking); text-wrap: balance; margin: 0; }
.nt-h1 { font-size: var(--nt-text-h1); line-height: var(--nt-text-h1-lh); font-weight: var(--nt-text-h1-weight); letter-spacing: var(--nt-text-h1-tracking); text-wrap: balance; margin: 0; }
.nt-h2 { font-size: var(--nt-text-h2); line-height: var(--nt-text-h2-lh); font-weight: var(--nt-text-h2-weight); letter-spacing: var(--nt-text-h2-tracking); text-wrap: balance; margin: 0; }
.nt-h3 { font-size: var(--nt-text-h3); line-height: var(--nt-text-h3-lh); font-weight: var(--nt-text-h3-weight); letter-spacing: var(--nt-text-h3-tracking); text-wrap: balance; margin: 0; }
.nt-card-title { font-size: var(--nt-text-card-title); line-height: var(--nt-text-card-title-lh); font-weight: var(--nt-text-card-title-weight); margin: 0; }
.nt-lead { font-size: var(--nt-text-lead); line-height: var(--nt-text-lead-lh); font-weight: var(--nt-text-lead-weight); color: var(--nt-ink-2); margin: 0; }
.nt-body { font-size: var(--nt-text-body); line-height: var(--nt-text-body-lh); }
.nt-small { font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); }
.nt-caption { font-size: var(--nt-text-caption); line-height: var(--nt-text-caption-lh); color: var(--nt-muted); }
.nt-label { font-size: var(--nt-text-label); line-height: var(--nt-text-label-lh); font-weight: var(--nt-text-label-weight); color: var(--nt-muted); }
.nt-muted { color: var(--nt-muted); }
.nt-ink-2 { color: var(--nt-ink-2); }
.nt-root strong, .nt-root b { font-weight: var(--nt-weight-bold); } /* emphasis inside body copy only */
.nt-prose { max-width: 65ch; overflow-wrap: break-word; } /* no auto-hyphenation in running text; bg/uk/el have no hyphenation dictionary in Chrome */

/* ---------- App bar: black, white wordmark (the brand's primary logo use) ---------- */
.nt-appbar {
  background: var(--nt-inverse); color: var(--nt-on-inverse);
  min-height: var(--nt-appbar-h);
  display: flex; align-items: center; gap: var(--nt-space-6); flex-wrap: wrap;
  padding-block: var(--nt-space-2);
  padding-left: max(var(--nt-gutter-mobile), env(safe-area-inset-left, 0px));
  padding-right: max(var(--nt-gutter-mobile), env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--nt-line);
}
.nt-appbar__logo { width: var(--nt-logo-appbar-w); height: auto; display: block; flex: none; }
.nt-appbar__product { font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); font-weight: var(--nt-weight-regular); color: var(--nt-on-inverse); min-width: 0; }
.nt-appbar__spacer { flex: 1 1 auto; }
.nt-appbar__meta { font-size: var(--nt-text-caption); line-height: var(--nt-text-caption-lh); color: var(--nt-grey-300); /* on the always-black bar: 11.6:1 */ }

/* ---------- Blacktag label: black box, white text. Echoes the logo blacktag; marks sections and key findings. ---------- */
.nt-tag-black {
  display: inline-flex; align-items: center; gap: var(--nt-space-1);
  background: var(--nt-inverse); color: var(--nt-on-inverse);
  font-size: var(--nt-text-label); line-height: var(--nt-text-label-lh); font-weight: var(--nt-weight-medium);
  padding: var(--nt-space-1) var(--nt-space-2); border-radius: var(--nt-radius-none);
}
/* On dark surfaces a black box disappears: outline it in white. */
:root[data-theme="dark"] .nt-tag-black { box-shadow: inset 0 0 0 1px var(--nt-on-inverse); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nt-tag-black { box-shadow: inset 0 0 0 1px var(--nt-on-inverse); } }

/* Small solid tag, as notino.* uses for "Akce" / "Dárek". Pink only for Notino-specific labels. */
.nt-tag { display: inline-flex; align-items: center; gap: var(--nt-space-1); font-size: var(--nt-text-label); line-height: var(--nt-text-label-lh); font-weight: var(--nt-weight-medium); padding: var(--nt-space-1) var(--nt-space-2); border-radius: var(--nt-radius-xs); background: var(--nt-soft); color: var(--nt-ink); white-space: nowrap; }
.nt-tag--notino { background: var(--nt-accent); color: var(--nt-on-accent); }
.nt-tag--warn { background: var(--nt-warn-bg); color: var(--nt-warn-ink); }
.nt-tag--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--nt-line-strong); }

/* ---------- Buttons (crisp 2 px like notino.*). Primary is black, never pink. ---------- */
.nt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--nt-space-2);
  min-height: 36px; padding: 0 var(--nt-space-4);
  font: inherit; font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); font-weight: var(--nt-weight-medium);
  border-radius: var(--nt-radius-xs); border: 1px solid transparent; cursor: pointer;
  transition: background-color var(--nt-dur-fast) var(--nt-ease), border-color var(--nt-dur-fast) var(--nt-ease);
}
.nt-btn--primary { background: var(--nt-ink); color: var(--nt-card); }
.nt-btn--primary:hover { background: var(--nt-ink-2); }
.nt-btn--secondary { background: var(--nt-card); color: var(--nt-ink); border-color: var(--nt-line-strong); }
.nt-btn--secondary:hover { background: var(--nt-soft); }
.nt-btn--ghost { background: transparent; color: var(--nt-ink); }
.nt-btn--ghost:hover { background: var(--nt-soft); }
.nt-btn[disabled] { opacity: .45; cursor: not-allowed; }
/* Campaign-style pill (Calm Down Beauty key visuals): slides and hero moments only, not dashboard controls. */
.nt-btn--pill { border-radius: var(--nt-radius-pill); background: transparent; color: inherit; border: 1.5px solid currentColor; padding: 0 var(--nt-space-5); }

/* ---------- Segmented control (wave, metric switch) ---------- */
.nt-segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--nt-soft); border-radius: var(--nt-radius-xs); flex-wrap: wrap; }
.nt-segmented button { font: inherit; font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); padding: var(--nt-space-1) var(--nt-space-3); border: 0; border-radius: var(--nt-radius-xs); background: transparent; color: var(--nt-ink-2); cursor: pointer; min-height: 32px; }
.nt-segmented button[aria-pressed="true"] { background: var(--nt-card); color: var(--nt-ink); font-weight: var(--nt-weight-medium); box-shadow: var(--nt-shadow-card); }

/* ---------- Market chip: ISO code + local name. Selected = pink tint + 1 px pink ring (3:1). ---------- */
.nt-market-chip {
  display: inline-flex; align-items: center; gap: var(--nt-space-2);
  font: inherit; font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); color: var(--nt-ink);
  min-height: 32px; padding: 0 var(--nt-space-3); border-radius: var(--nt-radius-xs);
  background: var(--nt-card); border: 1px solid var(--nt-line-strong); cursor: pointer;
}
.nt-market-chip__code { font-weight: var(--nt-weight-medium); }
.nt-market-chip__name { color: var(--nt-muted); }
.nt-market-chip[aria-pressed="true"] { background: var(--nt-accent-tint); border-color: var(--nt-accent); }

/* ---------- Panels ---------- */
.nt-panel { background: var(--nt-card); border: 1px solid var(--nt-card-border); border-radius: var(--nt-radius-sm); box-shadow: var(--nt-shadow-card); padding: var(--nt-space-5); min-width: 0; }
.nt-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--nt-space-3); flex-wrap: wrap; margin-bottom: var(--nt-space-4); }
.nt-panel__head > * { min-width: 0; }
.nt-panel__foot { margin-top: var(--nt-space-4); padding-top: var(--nt-space-3); border-top: 1px solid var(--nt-line); }

/* ---------- KPI strip: one panel, tiles split by hairlines (not a row of identical cards) ---------- */
.nt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); background: var(--nt-card); border: 1px solid var(--nt-card-border); border-radius: var(--nt-radius-sm); box-shadow: var(--nt-shadow-card); }
.nt-kpi { padding: var(--nt-space-5); display: flex; flex-direction: column; gap: var(--nt-space-2); min-width: 0; border-left: 1px solid var(--nt-line); }
.nt-kpi:first-child { border-left: 0; }
.nt-kpi__label { font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); color: var(--nt-ink-2); }
.nt-kpi__value { font-size: var(--nt-text-kpi); line-height: var(--nt-text-kpi-lh); font-weight: var(--nt-text-kpi-weight); letter-spacing: var(--nt-text-kpi-tracking); color: var(--nt-ink); }
.nt-kpi__row { display: flex; align-items: center; gap: var(--nt-space-2); flex-wrap: wrap; }
.nt-kpi[aria-current="true"] { background: var(--nt-accent-tint); box-shadow: inset 0 0 0 1px var(--nt-accent); }
@media (max-width: 640px) { .nt-kpi { border-left: 0; border-top: 1px solid var(--nt-line); } .nt-kpi:first-child { border-top: 0; } }

/* ---------- Change vs. previous wave. Colour only when significant; always with a sign and an arrow. ---------- */
.nt-delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); font-weight: var(--nt-weight-medium); color: var(--nt-muted); white-space: nowrap; }
.nt-delta--up { color: var(--nt-up); }
.nt-delta--down { color: var(--nt-down); }
.nt-delta__arrow { font-size: .75em; }

/* ---------- Ranked list with slim share bars ---------- */
.nt-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--nt-space-3); }
.nt-rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--nt-space-1) var(--nt-space-3); align-items: baseline; }
.nt-rank__name { min-width: 0; overflow-wrap: anywhere; font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); }
.nt-rank__value { font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); font-weight: var(--nt-weight-medium); text-align: right; }
.nt-rank__track { grid-column: 1 / -1; height: 4px; background: var(--nt-soft); border-radius: 1px; overflow: hidden; }
.nt-rank__bar { height: 100%; background: var(--nt-data-other); }
.nt-rank li[data-entity="notino"] .nt-rank__bar { background: var(--nt-data-notino); }
.nt-rank li[data-entity="notino"] .nt-rank__name { font-weight: var(--nt-weight-medium); }

/* ---------- Table ---------- */
.nt-table-wrap { overflow-x: auto; max-width: 100%; }
.nt-table { width: 100%; border-collapse: collapse; font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); }
.nt-table th { text-align: left; font-weight: var(--nt-weight-medium); color: var(--nt-ink-2); padding: var(--nt-space-2) var(--nt-space-3); border-bottom: 1px solid var(--nt-line-strong); position: sticky; top: 0; background: var(--nt-card); white-space: nowrap; }
.nt-table td { padding: var(--nt-space-2) var(--nt-space-3); border-bottom: 1px solid var(--nt-line); vertical-align: baseline; }
.nt-table td.num, .nt-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.nt-table tr[data-entity="notino"] td { background: var(--nt-accent-tint); }

/* ---------- Heatmap cell ---------- */
.nt-cell { display: block; padding: var(--nt-space-2); text-align: center; font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); font-weight: var(--nt-weight-medium); border-radius: 1px; }

/* ---------- States ---------- */
.nt-skeleton { background: var(--nt-skeleton); border-radius: var(--nt-radius-xs); animation: nt-pulse 1.4s var(--nt-ease) infinite alternate; }
@keyframes nt-pulse { from { opacity: 1; } to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .nt-skeleton { animation: none; } }
.nt-state { display: grid; gap: var(--nt-space-2); justify-items: start; padding: var(--nt-space-5); border: 1px dashed var(--nt-line-strong); border-radius: var(--nt-radius-sm); color: var(--nt-ink-2); font-size: var(--nt-text-small); line-height: var(--nt-text-small-lh); }

/* ---------- Provenance footer: source, wave, fieldwork, base on every view ---------- */
.nt-source { font-size: var(--nt-text-caption); line-height: var(--nt-text-caption-lh); color: var(--nt-muted); display: flex; flex-wrap: wrap; gap: var(--nt-space-1) var(--nt-space-4); }
.nt-source > * { min-width: 0; }
