/*
 * Chetver design system — base, components and charts, ported from the redesign prototype
 * (.claude/redesign/src/shell.html, snapshot of 7 Oct 2026). Prototype-only parts are left out:
 * the design viewer, live embeds, the state switcher (.proto), the landing-site shell and the
 * «bridge» for per-screen copies. Needs tokens.css first. The cabinet frame lives in cabinet.css.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.5 var(--f-ui); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); letter-spacing: 0; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
[data-lucide], .ico { width: 16px; height: 16px; flex: none; stroke-width: 1.75; display: inline-block; vertical-align: middle; }
.ico-sm, .ico-sm[data-lucide] { width: 14px; height: 14px; }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.75; flex: none; }
.ico-sm svg.lucide, svg.lucide.ico-sm { width: 14px; height: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--panel-2); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--wash); color: var(--ink); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--ink-3); }
.icon-btn:hover { background: var(--wash); color: var(--ink); }

/* ---------- Chips, pills, tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--r-sm); background: var(--wash); color: var(--ink);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip:hover { background: var(--wash-2); }
.chip .caret { color: var(--ink-3); width: 14px; height: 14px; }
.chip-white { background: var(--panel); box-shadow: var(--shadow); }
.chip-white:hover { background: var(--panel-2); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 6px; background: var(--panel); box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.eyebrow svg.lucide { width: 14px; height: 14px; color: var(--ink-3); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap; background: var(--wash); color: var(--ink-2);
}
.tag-blue   { background: color-mix(in srgb, var(--s1) 12%, var(--panel)); color: color-mix(in srgb, var(--s1) 80%, var(--ink)); }
.tag-orange { background: color-mix(in srgb, var(--s2) 13%, var(--panel)); color: color-mix(in srgb, var(--s2) 75%, var(--ink)); }
.tag-aqua   { background: color-mix(in srgb, var(--s3) 13%, var(--panel)); color: color-mix(in srgb, var(--s3) 70%, var(--ink)); }
.tag-yellow { background: color-mix(in srgb, var(--s4) 16%, var(--panel)); color: color-mix(in srgb, var(--s4) 60%, var(--ink)); }
.tag-magenta{ background: color-mix(in srgb, var(--s5) 15%, var(--panel)); color: color-mix(in srgb, var(--s5) 70%, var(--ink)); }
.tag-violet { background: color-mix(in srgb, var(--s7) 12%, var(--panel)); color: color-mix(in srgb, var(--s7) 80%, var(--ink)); }
.tag-good { background: var(--good-wash); color: var(--good-ink); }
.tag-warn { background: var(--warn-wash); color: var(--warn-ink); }
.tag-bad  { background: var(--bad-wash); color: var(--bad-ink); }
.tag-ink  { background: var(--btn-bg); color: var(--btn-fg); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.status-good::before { background: var(--good); }
.status-warn::before { background: var(--warn); }
.status-bad::before { background: var(--bad); }
.status-info::before { background: var(--s1); }
.kbd { font-family: var(--f-mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--wash); color: var(--ink-3); }

/* Deltas */
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.delta::before { font-size: 11px; }
.delta.up { color: var(--good-ink); }
.delta.up::before { content: "↗"; }
.delta.down { color: var(--bad-ink); }
.delta.down::before { content: "↘"; }
.delta.flat { color: var(--ink-3); }
.delta.flat::before { content: "→"; }

/* Monogram "favicons" (brands, domains, engines) */
.mono-av {
  width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; flex: none;
  font: 600 10.5px/1 var(--f-ui); color: #fff; background: var(--ink-3); letter-spacing: 0;
}
.mono-av.lg { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
.mono-av.xl { width: 40px; height: 40px; border-radius: 10px; font-size: 17px; }
.av-1 { background: var(--s1); } .av-2 { background: var(--s2); } .av-3 { background: var(--s3); } .av-4 { background: var(--s4); }
.av-5 { background: var(--s5); } .av-6 { background: var(--s6); } .av-7 { background: var(--s7); } .av-8 { background: var(--s8); }
.av-ink { background: var(--btn-bg); color: var(--btn-fg); }
.av-soft { background: var(--wash-2); color: var(--ink-2); }
.swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; display: inline-block; }

/* ---------- Surfaces ---------- */
.card { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 16px 20px; }
/* card head: Overview v4 values (was 14 16 0 and a 13.5px title) — sides 20, 16 on phones; title 14/20; sub 12 */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 0; min-height: 52px; }
.card-head > div { min-width: 0; }
.card-head h2, .card-head h3, .card-title { font: 500 14px/20px var(--f-ui); color: var(--ink); letter-spacing: -0.01em; }
.card-head small, .card-sub { display: block; font-size: 12px; line-height: 1.45; color: var(--ink-3); margin-top: 2px; }
.card-head .btn { flex: none; }
.card-body { padding: 12px 20px 16px; }
@media (max-width: 760px) { .card-head { padding: 14px 16px 0; } .card-body { padding: 12px 16px 16px; } .card-pad { padding: 16px; } }
.well { background: var(--panel-2); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--ring); }
.divider { height: 1px; background: var(--hair); border: 0; margin: 0; }

/* Segmented control */
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--wash); }
.seg button, .seg a { height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.seg .on, .seg [aria-pressed="true"], .seg [aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--ring), var(--shadow-sm); }

/* Tabs (underline) */
.tabs { display: flex; gap: 18px; box-shadow: inset 0 -1px 0 var(--hair); overflow-x: auto; scrollbar-width: none; }
.tabs.in-card { padding: 0 20px; }
@media (max-width: 760px) { .tabs.in-card { padding: 0 16px; } }
.tabs a, .tabs button { padding: 10px 0; font-size: 13px; font-weight: 500; color: var(--ink-3); box-shadow: inset 0 -1.5px 0 transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--ink); box-shadow: inset 0 -1.5px 0 var(--ink); }
.count { font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 10px; background: var(--wash); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; min-width: 0; position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 8px 12px;
  border-bottom: 1px solid var(--hair); white-space: nowrap; background: var(--panel);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--panel-2); }
.tbl .idx { width: 32px; color: var(--ink-3); font-size: 12px; }
.tbl .r { text-align: right; }
.tbl .you td { background: color-mix(in srgb, var(--s1) 5%, var(--panel)); }
.tbl .you:hover td { background: color-mix(in srgb, var(--s1) 8%, var(--panel)); }
.cell-brand { display: flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.cell-2 { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cell-2 small { font-size: 12px; color: var(--ink-3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* inline meter like peec's "|86" */
.meter-i { display: inline-flex; align-items: center; gap: 6px; }
.meter-i::before { content: ""; width: 2px; height: 12px; border-radius: 1px; background: var(--good); }
.meter-i.warn::before { background: var(--warn); }
.meter-i.bad::before { background: var(--bad); }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.bar-cell .track { flex: 1; height: 6px; border-radius: 3px; background: var(--wash); overflow: hidden; }
.bar-cell .fill { display: block; height: 100%; border-radius: 3px; background: var(--s1); }

/* ---------- Stat tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi-value { font: 500 var(--fs-tile)/1.1 var(--f-display); letter-spacing: -0.03em; color: var(--ink); }
.kpi-value small { font-size: 14px; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.rank { font-variant-numeric: tabular-nums; }
.rank b { font-weight: 500; color: var(--ink); }

/* Progress / score ring */
.progress { height: 6px; border-radius: 3px; background: var(--wash); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

/* Empty / locked */
.locked { position: relative; }
.lock-veil {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit;
  background: color-mix(in srgb, var(--panel) 70%, transparent); backdrop-filter: blur(3px);
}
.lock-card { background: var(--panel); box-shadow: var(--shadow-pop); border-radius: var(--r-lg); padding: 18px; max-width: 320px; text-align: center; display: grid; gap: 10px; justify-items: center; }

/* Callout / notice */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--panel-2); box-shadow: 0 0 0 1px var(--ring); font-size: 13px; color: var(--ink-2); }
.notice.info { background: var(--info-wash); color: var(--ink); box-shadow: none; }
.notice.warn { background: var(--warn-wash); color: var(--ink); box-shadow: none; }
.notice.good { background: var(--good-wash); color: var(--ink); box-shadow: none; }
/* canon: wash in the tone, text in ink, the icon carries the tone; one optional action on the right */
.notice > svg.lucide, .notice > [data-lucide] { flex: none; margin-top: 2px; color: var(--ink-3); }
.notice.info > svg.lucide, .notice.info > [data-lucide] { color: var(--info-ink); }
.notice.warn > svg.lucide, .notice.warn > [data-lucide] { color: var(--warn-ink); }
.notice.good > svg.lucide, .notice.good > [data-lucide] { color: var(--good-ink); }
.notice > .btn { margin-left: auto; flex: none; }

/* Forms */
.field { display: grid; gap: 6px; }
.label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.input {
  height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 0; background: var(--panel);
  box-shadow: 0 0 0 1px var(--ring), var(--shadow-sm); font-size: 13.5px; width: 100%; min-width: 0;
}
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.check i.box { width: 16px; height: 16px; border-radius: 4px; box-shadow: 0 0 0 1px var(--ring); background: var(--panel); display: inline-grid; place-items: center; }
.check i.box.on { background: var(--btn-bg); color: var(--btn-fg); box-shadow: none; }
.toggle { width: 30px; height: 18px; border-radius: 9px; background: var(--wash-2); position: relative; flex: none; display: inline-block; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow-sm); transition: left .15s; }
.toggle.on { background: var(--btn-bg); }
.toggle.on::after { left: 14px; background: var(--btn-fg); }

/* Tooltip (charts) */
.tip {
  position: absolute; pointer-events: none; z-index: 20; min-width: 150px;
  background: var(--float-bg); color: var(--on-float); border-radius: 10px; padding: 9px 11px;
  font-size: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); display: grid; gap: 4px;
}
.tip .tip-h { font-weight: 500; opacity: .75; margin-bottom: 2px; }
.tip .tip-r { display: flex; align-items: center; gap: 7px; justify-content: space-between; font-variant-numeric: tabular-nums; }
.tip .tip-r span:first-child { display: inline-flex; align-items: center; gap: 7px; }

/* Charts */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ink-3); font: 400 11px var(--f-ui); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis line { stroke: var(--axis); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 2px; border-radius: 1px; display: inline-block; }
.legend i.sq { width: 8px; height: 8px; border-radius: 2px; }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.stack { display: grid; gap: 12px; min-width: 0; }
.stack-lg { display: grid; gap: 20px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.hide-sm { }
@media (max-width: 720px) { .hide-sm { display: none !important; } }


/* ==========================================================================
   PREMIUM LAYER — depth, motion and finish. Loaded last; tokens only.
   ========================================================================== */
::selection { background: color-mix(in srgb, var(--s1) 24%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--wash-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--wash-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; border: 3px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* raised surfaces get a soft inner top light */
.card, .insight-line, .feature, .quote, .price, .nav-item.on, .chip-white, .btn-secondary, .eyebrow, .qa, .inline-chip { box-shadow: inset 0 1px 0 var(--hl), var(--shadow); }
.card { transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
a.card:hover { box-shadow: inset 0 1px 0 var(--hl), 0 0 0 1px var(--ring), 0 10px 24px -10px rgba(0, 0, 0, .16); transform: translateY(-1px); }

/* primary action: ink with a faint vertical sheen and a crisp edge */
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--btn-bg) 88%, #fff) 0%, var(--btn-bg) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 1px color-mix(in srgb, var(--btn-bg) 90%, #000), 0 1px 2px rgba(0, 0, 0, .22);
}
.btn-primary:hover { opacity: 1; background: linear-gradient(180deg, color-mix(in srgb, var(--btn-bg) 80%, #fff) 0%, color-mix(in srgb, var(--btn-bg) 94%, #fff) 100%); }
.btn-secondary:hover { background: var(--panel-2); box-shadow: inset 0 1px 0 var(--hl), 0 0 0 1px var(--ring), 0 2px 6px -2px rgba(0, 0, 0, .12); }
.btn, .icon-btn, .chip, .nav-item, .seg button, .seg a, .tabs a, .tabs button, .tag, .tbl td, .tbl th, .ws, .qa { transition: background-color .15s ease, color .15s ease, box-shadow .2s var(--ease), transform .12s ease, opacity .15s ease; }
.btn-lg { letter-spacing: -0.012em; }

.tbl thead th { position: relative; }
.tbl tbody tr { transition: background-color .12s ease; }

/* type finish */
body { font-feature-settings: "tnum" 0, "calt" 1; }
.tbl, .kpi-value small, .delta, .num { font-feature-settings: "tnum" 1; }
.h-hero, .h-sec, .page-title { text-wrap: balance; }
.h-hero { letter-spacing: -0.04em; }
.page-title { letter-spacing: -0.03em; }

/* only a dot for data that is flowing right now pulses (.status.live); a green state («Працює», «Підписка активна») is static */
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: no-preference) { .status.live::before { animation: live 2.4s ease-out infinite; } }

/* entrance: short, never fully hidden at rest.
   fill-mode is `backwards`, not `both`: a filled end keyframe keeps a transform on every block,
   which makes each block its own stacking context, so an open popover sat under the next block
   and real clicks landed on that block (P0-8). */
@keyframes rise { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .page > * { animation: rise .42s var(--ease) backwards; }
  .page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; }
  .page > *:nth-child(4) { animation-delay: .12s; } .page > *:nth-child(5) { animation-delay: .16s; }
  .page > *:nth-child(n+6) { animation-delay: .2s; }
}
/* guard: the block that holds an open popover always stacks above the blocks after it
   (also covers the first .42s, while the entrance animation still holds a transform) */
.page > *:has(details[data-pop][open]) { position: relative; z-index: 20; }

/* charts: series highlight from legend, draw-in, gradient fills */
.chart svg .ser { transition: opacity .18s ease; }
.chart svg.hl .ser { opacity: .16; }
.chart svg.hl .ser.on { opacity: 1; }
@keyframes draw { from { stroke-dashoffset: .42; } to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(.6); } to { transform: none; } }
@keyframes fadein { from { opacity: .3; } to { opacity: 1; } }
.chart svg path.ln.dash { stroke-dasharray: 4 4; }
@media (prefers-reduced-motion: no-preference) {
  .chart svg path.ln { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw .6s var(--ease) both; }
  .chart svg path.ln.dash { stroke-dasharray: 4 4; animation: none; }
  .chart svg .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .55s var(--ease) both; }
  .chart svg .area { animation: fadein .6s ease both; }
  .chart svg .dot { animation: fadein .25s .3s ease both; }
  .chart svg .seg-d { animation: fadein .6s ease both; }
}
.legend span { cursor: default; padding: 2px 6px; margin: -2px -6px; border-radius: 5px; transition: background-color .12s ease, opacity .15s ease; }
.legend span:hover { background: var(--wash); }
.legend.has-hl span.dim { opacity: .45; }
.tip { backdrop-filter: blur(10px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 14px 34px rgba(0, 0, 0, .28); }


/* ---- shared fixes from the premium pass ---- */
[hidden] { display: none !important; }
.chip.on { background: var(--panel); box-shadow: inset 0 1px 0 var(--hl), var(--shadow); }
.insight-line > span:not(.spacer) { flex: 1 1 180px; min-width: 0; }
.insight-line > span.rank, .insight-line > span.muted { flex: none; }
p { text-wrap: pretty; }
.lead, .page-sub, .card-sub, .feature p, .sec-head p { text-wrap: balance; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.toggle::before { content: ""; position: absolute; inset: -9px -6px; }

/* popover menu (filter chips) */
.menu { position: absolute; z-index: 70; min-width: 168px; padding: 5px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-pop); display: grid; gap: 1px; animation: rise .16s var(--ease) both; }
.menu button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 13px; text-align: left; white-space: nowrap; }
.menu button:hover { background: var(--wash); }
.menu button.on { font-weight: 500; }
.menu button.on::after { content: "✓"; margin-left: auto; color: var(--ink-3); font-size: 12px; }


/* phone: comfortable touch targets */
@media (max-width: 720px) {
  .btn-sm { height: 36px; padding: 0 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .chip { height: 34px; }
  .seg button, .seg a { height: 32px; }
  .tabs a, .tabs button { min-height: 40px; }
  summary { min-height: 40px; }
  .eyebrow { height: 32px; }
}

/* ==========================================================================
   SHARED COMPONENTS (WP19a, phase 3) — the approved Overview v4 patterns as one set.
   Values: Overview v4 (`.ov4-*`) and «Запити AI-ботів» (`.bt-*`), as staged in sys-foundations
   («Патерни»). Screens migrate their prefixed copies to these classes in WP19b; lint.py warns
   on any NEW copy (`-cardh -proto -delta -num -why -fine -band -grp`, `.btn[disabled]`, `.page-sub`).
   ========================================================================== */

/* ---- type scale: one class per role (sizes in :root --fs-*) ---- */
.t-index { font: 500 var(--fs-index)/0.9 var(--f-display); letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.t-hero { font: 500 var(--fs-hero)/0.9 var(--f-display); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.t-tile { font: 500 var(--fs-tile)/1.1 var(--f-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.t-title { font: 500 var(--fs-title)/1.2 var(--f-display); letter-spacing: -0.03em; text-wrap: balance; }
.t-lock { font: 500 var(--fs-title)/1.25 var(--f-display); letter-spacing: -0.025em; text-wrap: balance; }
.t-verdict { font: 500 var(--fs-verdict)/1.4 var(--f-display); letter-spacing: -0.022em; text-wrap: pretty; }
.t-why { font: 500 var(--fs-why)/1.45 var(--f-ui); letter-spacing: -0.012em; text-wrap: pretty; }
.t-card { font: 500 var(--fs-card)/20px var(--f-ui); letter-spacing: -0.01em; }
.t-row { font: 500 var(--fs-row)/1.35 var(--f-ui); }
.t-body { font: 400 var(--fs-body)/1.5 var(--f-ui); }
.t-cap { font: 400 var(--fs-cap)/1.45 var(--f-ui); color: var(--ink-3); }
.t-fine { font: 400 var(--fs-fine)/1.45 var(--f-ui); color: var(--ink-3); }
.t-mono { font: 500 var(--fs-fine)/1.45 var(--f-mono); letter-spacing: 0; }
@media (max-width: 760px) { .t-hero { font-size: 48px; } }


/* ---- card head extras: meta on the right, «Як рахуємо» popover ---- */
.card-meta { font-size: 12px; line-height: 1.45; color: var(--ink-3); text-align: right; white-space: nowrap; flex: none; }
.card-meta span { display: block; }
.how { position: relative; display: inline-block; vertical-align: -5px; margin-left: 2px; }
.how > summary { list-style: none; cursor: pointer; color: var(--ink-4); display: inline-grid; place-items: center; width: 22px; height: 20px; min-height: 0; border-radius: 6px; position: relative; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary::after { content: ""; position: absolute; inset: -8px; }
.how > summary:hover, .how[open] > summary { color: var(--ink); background: var(--wash); }
.how:not([open]) > div { display: none; }
.how > div { position: absolute; z-index: 9; top: 28px; left: -12px; width: min(380px, calc(100vw - 56px)); padding: 14px 16px; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-pop); font: 400 12.5px/1.5 var(--f-ui); color: var(--ink-2); letter-spacing: 0; display: grid; gap: 10px; justify-items: start; text-wrap: pretty; }
.how b { font-weight: 500; color: var(--ink); }
@media (max-width: 720px) { .card:has(.how) { position: relative; } .how { position: static; } .how > div { left: 12px; right: 12px; width: auto; top: 50px; } }
@media (max-width: 520px) {
  .card-head:has(> .card-meta) { flex-direction: column; gap: 2px; }
  .card-meta { text-align: left; white-space: normal; }
  .card-meta span { display: none; }
}

/* popovers sit one step above the card (in the dark theme the card colour would swallow them) */
details[data-pop] > :not(summary), .pop, .menu { --panel: var(--pop-bg); --wash: var(--pop-wash); }

/* ---- hero: answer column (number · change · why) + trend ---- */
.hero { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 16px 32px; padding: 14px 20px 18px; }
.hero-ans { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; min-width: 0; }
.hero-tr { min-width: 0; display: grid; gap: 6px; align-content: start; }
.hero-num { font: 500 var(--fs-hero)/0.9 var(--f-display); letter-spacing: -0.05em; color: var(--ink); margin-left: -3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hero-num span { font-size: 20px; font-weight: 400; letter-spacing: -0.02em; color: var(--ink-3); margin-left: 8px; }
.hero-num.xl { font-size: var(--fs-index); letter-spacing: -0.06em; margin-left: -4px; }   /* 88: the AI-visibility index only (D12) */
.hero-num.xl span { margin-left: 6px; }
.hero-drow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.hero-delta { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border-radius: 8px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; background: var(--wash); color: var(--ink-2); }
.hero-delta svg.lucide { width: 17px; height: 17px; stroke-width: 2.3; }
.hero-delta.good { background: var(--good-wash); color: var(--good-ink); }
.hero-delta.bad { background: var(--bad-wash); color: var(--bad-ink); }
.hero-delta.flat { background: var(--wash); color: var(--ink-2); }
.hero-vs { font-size: 12.5px; color: var(--ink-3); }
/* the answer: «why» sentence under a hero number; .lg = the card answer, the same size as the Overview verdict */
.answer { font: 500 var(--fs-why)/1.45 var(--f-ui); letter-spacing: -0.012em; color: var(--ink); max-width: 38ch; text-wrap: pretty; }
.answer .soft { font-weight: 400; }
.answer.lg { font: 500 var(--fs-verdict)/1.4 var(--f-display); letter-spacing: -0.022em; max-width: none; }
.answer.lg > span:not([class]) { color: var(--ink-3); }
@media (max-width: 1100px) { .hero { grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr); } }
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 18px; gap: 18px; }
  .hero-num { font-size: 48px; } .hero-num span { font-size: 18px; }
  .hero-num.xl { font-size: var(--fs-index); } .hero-num.xl span { font-size: 20px; }
}

/* ---- card band: the card's bottom strip on --panel-2 with up to three icon tiles ---- */
.card-band { margin-top: auto; border-top: 1px solid var(--hair); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 14px 20px 16px; display: grid; gap: 12px; }
.band-l { font-size: 12.5px; color: var(--ink-3); }
.band-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; }
.band-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; text-align: left; min-width: 0; color: var(--ink); }
.band-item b { display: block; font: 500 var(--fs-row)/1.35 var(--f-ui); text-wrap: pretty; }
.band-item small { display: block; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); margin-top: 2px; text-wrap: pretty; }
:is(a, button).band-item:hover b { text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }
@media (max-width: 760px) {
  .card-band { padding: 12px 16px 14px; }
  .band-items { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .band-item { padding: 12px 0; border-top: 1px solid var(--hair); }
  .band-item:first-child { border-top: 0; padding-top: 0; }
}

/* ---- icon tile: 30px, tone = wash + ink of the tone ---- */
.ico-tile { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--wash); color: var(--ink-3); flex: none; }
.ico-tile svg.lucide { width: 15px; height: 15px; }
.ico-tile.good { background: var(--good-wash); color: var(--good-ink); }
.ico-tile.warn { background: var(--warn-wash); color: var(--warn-ink); }
.ico-tile.bad { background: var(--bad-wash); color: var(--bad-ink); }
.ico-tile.info { background: var(--info-wash); color: var(--info-ink); }

/* ---- page fine print: under the last card; one caveat + where the data comes from ---- */
.page-fine { display: flex; align-items: center; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; font-size: var(--fs-fine); color: var(--ink-3); padding: 0 4px; }
.page-fine > span { display: inline-flex; gap: 7px; align-items: center; min-width: 0; }
.page-fine .btn { padding-right: 0; color: var(--ink-3); font-size: var(--fs-fine); font-weight: 400; white-space: normal; height: auto; min-height: 26px; text-align: left; line-height: 1.4; }
.page-fine .status { font-size: var(--fs-fine); font-weight: 400; color: var(--ink-3); }
@media (max-width: 760px) { .page-fine .btn { min-height: 44px; } }

/* ---- group head + issue row («Що покращити» list) ---- */
.grp-h { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 20px; font: 500 12.5px/1.3 var(--f-ui); color: var(--ink-2); background: var(--panel-2); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.grp-h:first-child { border-top: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.grp-h em { font-style: normal; font-weight: 400; color: var(--ink-3); }
:is(.grp-h, .issue > summary) > .dot { width: 8px; height: 8px; border-radius: 50%; display: block; justify-self: center; background: var(--ink-4); }
:is(.grp-h, .issue > summary) > .dot.bad { background: var(--bad); }
:is(.grp-h, .issue > summary) > .dot.warn { background: var(--warn); }
:is(.grp-h, .issue > summary) > .dot.good { background: var(--good); }
.issue + .issue { border-top: 1px solid var(--hair); }
.issue > summary { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 16px; gap: 12px; align-items: start; padding: 14px 20px; min-height: 56px; list-style: none; cursor: pointer; }
.issue > summary::-webkit-details-marker { display: none; }
.issue > summary > .dot { margin-top: 6px; }
.issue-t b { display: block; font: 500 var(--fs-card)/20px var(--f-ui); letter-spacing: -0.01em; text-wrap: pretty; }
.issue-t small { display: block; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); margin-top: 2px; }
.issue-t small i { font-style: normal; color: var(--ink-4); }
.issue-t code { font: 400 12px/1.45 var(--f-mono); color: var(--ink-2); overflow-wrap: anywhere; }
.issue > summary > svg.lucide { color: var(--ink-4); transition: transform .2s var(--ease); margin-top: 2px; }
.issue[open] > summary > svg.lucide { transform: rotate(180deg); }
.issue-b { padding: 0 20px 18px 52px; display: grid; gap: 10px; justify-items: start; }
.issue-b p { font-size: var(--fs-row); line-height: 1.55; color: var(--ink-2); max-width: 76ch; text-wrap: pretty; }
@media (max-width: 760px) { .grp-h { padding: 9px 16px; } .issue > summary { padding: 14px 16px; } .issue-b { padding: 0 16px 16px; } }
@media (max-width: 520px) {
  .issue > summary { grid-template-columns: 20px minmax(0, 1fr) 16px; row-gap: 8px; }
  .issue > summary > .dot { grid-area: 1 / 1; }
  .issue > summary > .issue-t { grid-area: 1 / 2; }
  .issue > summary > .tag { grid-area: 2 / 2; justify-self: start; }
  .issue > summary > svg.lucide { grid-area: 1 / 3; }
}

/* ---- disabled button: faded, a ring, no hover; the reason sits next to it ---- */
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:not(.btn-ghost) { box-shadow: 0 0 0 1px var(--ring); }
.btn[disabled]:active { transform: none; }
.btn-primary[disabled]:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--btn-bg) 88%, #fff) 0%, var(--btn-bg) 100%); }
.btn-secondary[disabled]:hover { background: var(--panel); }
.btn-ghost[disabled]:hover { background: transparent; color: var(--ink-2); }

/* ---- rank row: who and how much — avatar + name, count + share, bar in the entity colour, change, last visit ----
   wrap the rows in .rank-list (the narrow-width layouts key on it); bars: companies = width of the leader, sites = n/96 */
.rank-h, .rank-row { display: grid; grid-template-columns: minmax(240px, 1.5fr) 84px minmax(120px, 2fr) 88px 112px 20px; column-gap: 16px; align-items: center; padding: 9px 20px; }
.rank-h { font-size: 12px; color: var(--ink-3); padding-top: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--hair); }
.rank-h .rn { display: block; width: 48px; text-align: right; }
.rank-h .r, .rank-row .r { text-align: right; }
.rank-row { min-height: 56px; color: var(--ink); text-align: left; }
.rank-row + .rank-row { border-top: 1px solid var(--hair); }
:is(a, button).rank-row:hover { background: var(--panel-2); }
:is(a, button).rank-row:hover b { text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }
.rank-nm { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
.rank-nm b { font: 500 var(--fs-row)/1.35 var(--f-ui); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rank-nm small { display: block; font-size: 12px; color: var(--ink-3); }
.rank-nm .mono { font-size: 13px; }
.rank-cnt { display: grid; grid-template-columns: 48px 28px; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.rank-cnt b { font: 500 var(--fs-row)/1 var(--f-ui); text-align: right; }
.rank-cnt em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.rank-bar { height: 8px; border-radius: 4px; background: var(--wash); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 4px; min-width: 3px; }
.rank-mm { display: contents; }
.rank-ch { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-ch.good { color: var(--good-ink); }
.rank-ch.bad { color: var(--bad-ink); }
.rank-lv { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.rank-row > svg.lucide { color: var(--ink-4); }
@media (max-width: 1340px) { .rank-list :is(.rank-h, .rank-row) { grid-template-columns: minmax(280px, 1.7fr) 84px minmax(100px, 1.8fr) 88px 112px 20px; } }
@media (max-width: 1100px) { .rank-list :is(.rank-h, .rank-row) { grid-template-columns: minmax(176px, 1.5fr) 84px minmax(56px, 2fr) 72px 96px 20px; column-gap: 12px; } }
@media (max-width: 760px) {
  .rank-list .rank-h { display: none; }
  .rank-list .rank-row { grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "nm cnt ch" "bar bar bar" "mm mm mm"; row-gap: 8px; padding: 12px 16px; align-items: start; }
  .rank-list div.rank-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm cnt" "bar bar" "mm mm"; }
  .rank-list .rank-nm { grid-area: nm; }
  .rank-list .rank-cnt { grid-area: cnt; justify-self: end; grid-template-columns: none; grid-auto-flow: column; padding-top: 2px; }
  .rank-list .rank-bar { grid-area: bar; height: 6px; }
  .rank-list .rank-mm { grid-area: mm; display: flex; gap: 6px; font-size: 12px; color: var(--ink-3); }
  .rank-list .rank-mm .rank-ch { font-size: 12px; text-align: left; }
  .rank-list .rank-mm .rank-lv { font-size: 12px; color: var(--ink-3); }
  .rank-list .rank-mm .rank-lv:not(:empty)::before { content: "· "; }
  .rank-list .rank-row > svg.lucide { grid-area: ch; }
}


/* ==========================================================================
   LARAVEL PORT ADDITIONS — what the prototype draws with JS or per screen.
   Charts are server-rendered: positions are % of the plot box (CSS --x/--y),
   lines use non-scaling strokes, so they fit any width without JS (the same
   technique as the prototype's Overview chart .ov5-ch).
   ========================================================================== */
.card:has(> .card-band) { display: flex; flex-direction: column; }
.btn-reason { font-size: var(--fs-cap); color: var(--ink-3); max-width: 46ch; text-wrap: pretty; }
/* the veil needs room for its card: the locked block is at least as tall as the lock card */
.locked { display: grid; min-height: 232px; border-radius: var(--r-lg); }
.locked > [inert] { display: grid; }
.lock-card b { font: 500 17px/1.3 var(--f-display); letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.lock-card p { font-size: 12.5px; line-height: 1.45; }
.lock-actions { justify-content: center; }

/* empty state: ring, never a border (sys-foundations «Підняття») */
.ds-empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 28px 20px; border-radius: var(--r-md); background: var(--panel-2); box-shadow: 0 0 0 1px var(--ring); }
.ds-empty-t b { display: block; font: 500 var(--fs-row)/1.35 var(--f-ui); color: var(--ink); }
.ds-empty-t p { font-size: var(--fs-cap); line-height: 1.45; color: var(--ink-3); margin-top: 4px; max-width: 52ch; text-wrap: pretty; }

/* charts: shared */
.ds-chart { margin: 0; min-width: 0; container-type: inline-size; position: relative; }
.ds-g { position: absolute; left: 0; right: 0; top: var(--y); border-top: 1px solid var(--grid); pointer-events: none; }
.ds-g b { position: absolute; right: calc(100% + 8px); top: -7px; font: 400 11px/14px var(--f-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-legend { margin-top: 12px; }
.ds-legend i { width: 10px; height: 2px; border-radius: 1px; background: var(--c, var(--s1)); }
.ds-legend i.is-previous { width: 14px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 55%, var(--panel)) 0 4px, transparent 4px 7px); }
.ds-legend i.is-bar { width: 8px; height: 8px; border-radius: 2px; }
.ds-chart-notes { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--hair); display: grid; gap: 7px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.ds-chart-notes li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 9px; align-items: start; }
.ds-chart-notes b { font-weight: 500; color: var(--ink); white-space: nowrap; }
.ds-nn { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.2px var(--ink-3); font: 600 10px/1 var(--f-ui); color: var(--ink); margin-top: 1.5px; }

/* line: your value s1 2.25 px with a fill, previous period dashed in ink at 55 %, ①②③ above the plot */
.ds-line { position: relative; height: var(--h, 220px); margin: 12px 2px 0 36px; }
.ds-chart--notes .ds-line { margin-top: 32px; }
.ds-line svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ds-line__ln { fill: none; stroke: var(--c, var(--s1)); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.ds-line__ln.is-focus { stroke-width: 2.25; }
.ds-line__ln.is-previous { stroke-dasharray: 4 4; opacity: .55; }
.ds-line__ln.is-plain { opacity: .55; }
.ds-line__dot { position: absolute; left: var(--x); top: var(--y); width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--c, var(--s1)); box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
.ds-line__dot.is-note { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--panel); box-shadow: 0 0 0 2px var(--c, var(--s1)); }
.ds-line__v { position: absolute; left: var(--x); top: -4px; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--ink-4) 80%, transparent); pointer-events: none; }
.ds-line__mark { position: absolute; left: var(--x); top: -26px; transform: translateX(-50%); width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1.2px var(--ink-3); font: 600 10px/1 var(--f-ui); color: var(--ink); pointer-events: none; }
/* the first and last hover columns are centred on the plot edges: clip them so they never widen the page or cover a neighbour */
.ds-line__hits { position: absolute; inset: 0; overflow: hidden; }
.ds-line__hit { position: absolute; top: 0; bottom: 0; left: calc(var(--x) - var(--w) / 2); width: var(--w); }
.ds-line__hit:hover { background: linear-gradient(90deg, transparent calc(50% - .5px), var(--axis) calc(50% - .5px), var(--axis) calc(50% + .5px), transparent calc(50% + .5px)); }
.ds-line__one { position: absolute; z-index: 1; left: 18%; right: 0; top: 18%; bottom: 18%; display: grid; place-content: center; text-align: center; padding: 0 12px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--ink) 16%, transparent); background: var(--panel); font-size: 12.5px; color: var(--ink-3); text-wrap: balance; }
.ds-x { position: relative; height: 14px; margin: 8px 2px 0 36px; }
.ds-x span { position: absolute; left: var(--x); transform: translateX(-50%); font-size: 11px; line-height: 14px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; display: none; }
.ds-x span.is-first { transform: none; }
.ds-x span.is-last { transform: translateX(-100%); }
.ds-x span.is-wide { display: inline; }
@container (max-width: 520px) {
  .ds-x span.is-wide { display: none; }
  .ds-x span.is-narrow { display: inline; }
}

/* bars: days; a few bars may grow to 44 px, a month of days stays at 24 px */
.ds-bars { position: relative; height: var(--h, 200px); margin: 12px 2px 0 40px; }
.ds-bars__cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); }
.ds-bars__col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.ds-bars__col.is-dim .ds-bars__stack { opacity: .45; }
.ds-bars__stack { width: min(var(--bw, 24px), 62%); display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; transform-origin: 50% 100%; }
.ds-bars__stack i { display: block; min-height: 1px; background: var(--c, var(--s1)); }
.ds-bars__col:hover .ds-bars__stack { filter: brightness(1.08); }
.ds-bars-x { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); margin: 8px 2px 0 40px; font-size: 11px; line-height: 14px; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.ds-bars-x span { white-space: nowrap; visibility: hidden; }
.ds-bars-x span.is-wide { visibility: visible; }
@container (max-width: 520px) {
  .ds-bars-x span.is-wide { visibility: hidden; }
  .ds-bars-x span.is-narrow { visibility: visible; }
}
@media (prefers-reduced-motion: no-preference) {
  .ds-bars__stack { animation: grow .55s var(--ease) both; }
  .ds-line__area { animation: fadein .6s ease both; }
}
.ds-chart .tip { top: 8px; }
