/* VIEWS: учёт просмотров — график «просмотры и уникальные», чипы в оглавлении и карточках (docs/VIEWS.md).
 * Цвета рядов — проверенная пара (синий / оранжевый, различимы при дальтонизме), для тёмной темы — свои ступени. */
:root {
	--vw-1: #2a78d6;
	--vw-2: #eb6834;
}
:root[data-theme="dark"] {
	--vw-1: #3987e5;
	--vw-2: #d95926;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--vw-1: #3987e5;
		--vw-2: #d95926;
	}
}

/* ------------------------------------------------------------ график */
.nf-vw-chart { margin: 0; min-width: 0; }
.nf-vw-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; color: var(--muted-foreground); }
.nf-vw-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.nf-vw-legend b { color: var(--foreground); font-weight: 600; }
.nf-vw-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--vw-1); flex-shrink: 0; }
.nf-vw-key.k2 { background: var(--vw-2); }

.nf-vw-plot { position: relative; height: 200px; margin-left: 46px; margin-right: 6px; touch-action: pan-y; outline: none; }
.nf-vw-plot:focus-visible { box-shadow: 0 0 0 2px var(--ring); border-radius: 4px; }
.nf-vw-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nf-vw-plot .g { stroke: var(--border); stroke-width: 1; }
.nf-vw-plot .g0 { stroke: color-mix(in oklab, var(--muted-foreground) 45%, transparent); stroke-width: 1; }
.nf-vw-plot .a1 { fill: var(--vw-1); opacity: .1; }
.nf-vw-plot .l1, .nf-vw-plot .l2 { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nf-vw-plot .l1 { stroke: var(--vw-1); }
.nf-vw-plot .l2 { stroke: var(--vw-2); }
.nf-vw-y span { position: absolute; left: -46px; width: 38px; text-align: right; transform: translateY(-50%); font-size: 11px; line-height: 1; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nf-vw-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--vw-1); box-shadow: 0 0 0 2px var(--card-solid, var(--background)); pointer-events: none; }
.nf-vw-dot.d2 { background: var(--vw-2); }
.nf-vw-x { display: flex; justify-content: space-between; gap: 8px; margin: 8px 6px 0 46px; font-size: 11px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.nf-vw-cross { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: color-mix(in oklab, var(--foreground) 35%, transparent); pointer-events: none; }
.nf-vw-cross[hidden], .nf-vw-tip[hidden] { display: none; }
.nf-vw-tip {
	position: absolute; top: 4px; z-index: 3; min-width: 150px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius, 8px);
	background: var(--card-solid, var(--background)); color: var(--foreground); box-shadow: var(--elev-2, 0 6px 20px rgba(0, 0, 0, .12));
	font-size: 12.5px; line-height: 1.45; pointer-events: none; white-space: nowrap;
}
.nf-vw-tip b { display: block; margin-bottom: 3px; font-weight: 600; }
.nf-vw-tip span { display: flex; align-items: center; gap: 7px; }
.nf-vw-tip em { margin-left: auto; padding-left: 10px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.nf-vw-empty { margin: 0; padding: 36px 0; text-align: center; color: var(--muted-foreground); font-size: 13.5px; }

.nf-vw-table { margin-top: 14px; font-size: 13px; }
.nf-vw-table summary { cursor: pointer; color: var(--muted-foreground); }
.nf-vw-table summary:hover { color: var(--foreground); }
.nf-vw-table .wrap { max-height: 320px; overflow: auto; margin-top: 8px; }
.nf-vw-table table { width: 100%; border-collapse: collapse; }
.nf-vw-table th, .nf-vw-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.nf-vw-table th:first-child, .nf-vw-table td:first-child { text-align: left; }
.nf-vw-table th { font-weight: 600; color: var(--muted-foreground); font-size: 12px; }

@media (max-width: 560px) {
	.nf-vw-plot { height: 170px; margin-left: 38px; }
	.nf-vw-y span { left: -38px; width: 32px; font-size: 10.5px; }
	.nf-vw-x { margin-left: 38px; }
	.nf-vw-x span.mid { display: none; }
}

/* ------------------------------------------------------------ числа, чипы */
.nf-vw-num { font-variant-numeric: tabular-nums; }
.nf-vw-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; line-height: 1; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nf-vw-chip svg { opacity: .8; }

/* статистика тайтла (Настройки перевода → Статистика) */
.nf-vw-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-bottom: 16px; }
.nf-vw-fact-tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius, 8px); background: var(--card); }
.nf-vw-fact-tile .lbl { font-size: 12px; color: var(--muted-foreground); }
.nf-vw-fact-tile b { font-size: 22px; line-height: 1.15; font-weight: 700; }
.nf-vw-fact-tile .sub { font-size: 12px; color: var(--muted-foreground); }
.nf-vw-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius, 8px); background: var(--secondary); }
.nf-vw-seg a { padding: 4px 10px; border-radius: calc(var(--radius, 8px) - 2px); font-size: 12.5px; color: var(--muted-foreground); text-decoration: none; }
.nf-vw-seg a.on { background: var(--card-solid, var(--background)); color: var(--foreground); font-weight: 600; box-shadow: var(--elev-1, none); }
.nf-vw-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.nf-vw-rank td.n, .nf-vw-rank th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 14px; }
.nf-vw-rank td, .nf-vw-rank th { padding-top: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--border); vertical-align: top; }
.nf-vw-rank tr:last-child td { border-bottom: 0; }
.nf-vw-rank th { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.nf-vw-rank td.t { min-width: 9em; overflow-wrap: anywhere; }
@media (max-width: 560px) { .nf-vw-rank .opt { display: none; } }
.nf-vw-rank .sub { display: block; font-size: 12px; color: var(--muted-foreground); }
.nf-vw-reasons { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted-foreground); }
.nf-vw-reasons b { color: var(--foreground); font-variant-numeric: tabular-nums; }
.nf-vw-statlink { color: inherit; text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.nf-vw-statlink:hover { color: inherit; text-decoration-style: solid; }
/* пост блога: «N просмотров» под текстом */
.nf-vw-post { display: flex; align-items: center; gap: 6px; margin: 8px 0 18px; font-size: 13px; color: var(--muted-foreground); }
