/*
 * PLUS — подписка Plus (components/Plus.php): значок у ника, чипы глав «Plus» / «Только Plus», страница /plus,
 * раздел профиля «Подписка Plus», карточка пейвола «Только для подписчиков Plus», поля формы главы.
 * Подключается на всех страницах (layouts/v3.php): значки и чипы встречаются везде, в том числе в догружаемых списках.
 * Цвет Plus — свой токен --nf-plus (фиолетовый) для светлой и тёмной темы; остальное — токены nb.css.
 */
:root { --nf-plus: oklch(0.5 0.19 295); --nf-plus-soft: oklch(0.5 0.19 295 / 0.1); }
:root[data-theme="dark"] { --nf-plus: oklch(0.8 0.12 295); --nf-plus-soft: oklch(0.8 0.12 295 / 0.13); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) { --nf-plus: oklch(0.8 0.12 295); --nf-plus-soft: oklch(0.8 0.12 295 / 0.13); }
}

/* ---------------------------------------------------------------- значок у ника */
.nf-plus-badge {
	display: inline-flex; align-items: center; gap: 2px; height: 17px; padding: 0 6px 0 4px; box-sizing: border-box;
	border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; line-height: 1; white-space: nowrap;
	color: var(--nf-plus); background: var(--nf-plus-soft); border: 1px solid color-mix(in oklab, var(--nf-plus) 30%, transparent);
	vertical-align: middle; margin-left: 4px; cursor: default;
}
.nf-plus-badge svg { flex: none; }
.nb-profile-name .nf-plus-badge { height: 20px; font-size: 12px; padding: 0 8px 0 6px; }
.nb-dropdown .nf-plus-on { color: var(--nf-plus); background: var(--nf-plus-soft); }

/* ---------------------------------------------------------------- чипы глав (ChapterChips) */
.nb-cchip.is-plus { color: var(--nf-plus); background: var(--nf-plus-soft); font-weight: 600; }
.nb-cchip.is-plus-only { color: var(--nf-plus); background: var(--nf-plus-soft); border-color: color-mix(in oklab, var(--nf-plus) 40%, transparent); font-weight: 600; }
.nb-cchip.is-plus-only .in { font-weight: 400; }
.nb-cchip.is-compact.is-plus { padding: 0 4px; }
@container nb-toc (max-width: 420px) {
	.nb-toc-sub .nb-cchip.is-plus-only .w { display: none; }
}

/* ---------------------------------------------------------------- общий макет страниц Plus */
.nf-plus { max-width: 1040px; margin: 0 auto; }
.nf-plus-eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--nf-plus); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.nf-plus-hero {
	display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: center;
	padding: 34px; border: 1px solid var(--border); border-radius: var(--radius-lg);
	background: radial-gradient(120% 140% at 0% 0%, var(--nf-plus-soft), transparent 60%), var(--card-solid);
	margin-bottom: 26px;
}
.nf-plus-hero h1 { margin: 10px 0 12px; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -.01em; }
.nf-plus-hero .lead { margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--muted-foreground); max-width: 34em; }
.nf-plus-price { padding: 22px; border-radius: var(--radius-lg); background: var(--card-solid); border: 1px solid color-mix(in oklab, var(--nf-plus) 35%, var(--border)); box-shadow: var(--elev-2); }
.nf-plus-price .amount { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nf-plus-price .amount b { font-size: 40px; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.nf-plus-price .amount span { color: var(--muted-foreground); font-size: 15px; }
.nf-plus-price .rub { margin: 6px 0 14px; color: var(--muted-foreground); font-size: 13.5px; }
.nf-plus-price .nb-btn { width: 100%; justify-content: center; }
.nf-plus-price .fine { margin: 10px 0 0; font-size: 12.5px; color: var(--muted-foreground); line-height: 1.45; }

.nf-plus-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 30px; padding: 0; list-style: none; }
.nf-plus-perks li { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.nf-plus-perks .ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; color: var(--nf-plus); background: var(--nf-plus-soft); margin-bottom: 12px; }
.nf-plus-perks h3 { margin: 0 0 6px; font-size: 16.5px; }
.nf-plus-perks p { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }

.nf-plus-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.nf-plus-sec h2 { font-size: 20px; margin: 0 0 12px; }
.nf-plus-steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.nf-plus-steps li { counter-increment: s; position: relative; padding: 2px 0 0 40px; line-height: 1.5; font-size: 14.5px; }
.nf-plus-steps li::before {
	content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
	color: var(--nf-plus); background: var(--nf-plus-soft);
}
.nf-plus-steps li b { display: block; }
.nf-plus-steps li span { color: var(--muted-foreground); }

.nf-plus-faq details { border-bottom: 1px solid var(--border); }
.nf-plus-faq details:first-of-type { border-top: 1px solid var(--border); }
.nf-plus-faq summary { cursor: pointer; padding: 13px 28px 13px 0; font-weight: 600; list-style: none; position: relative; line-height: 1.4; }
.nf-plus-faq summary::-webkit-details-marker { display: none; }
.nf-plus-faq summary::after { content: "+"; position: absolute; right: 4px; top: 11px; font-size: 20px; line-height: 1; color: var(--muted-foreground); }
.nf-plus-faq details[open] summary::after { content: "−"; }
.nf-plus-faq details p { margin: 0 0 14px; color: var(--muted-foreground); line-height: 1.55; font-size: 14.5px; }

/* ---------------------------------------------------------------- карточка состояния (страница /plus и профиль) */
.nf-plus-status { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-solid); display: grid; gap: 14px; }
.nf-plus-status.is-on { border-color: color-mix(in oklab, var(--nf-plus) 40%, var(--border)); }
.nf-plus-status.is-warn { border-color: color-mix(in oklab, var(--warning) 50%, var(--border)); background: radial-gradient(90% 140% at 0% 0%, color-mix(in oklab, var(--warning) 10%, transparent), transparent 65%), var(--card-solid); }
.nf-plus-status .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nf-plus-status .head h2, .nf-plus-status .head h3 { margin: 0; font-size: 18px; }
.nf-plus-state { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.nf-plus-state.is-active { color: var(--nf-plus); background: var(--nf-plus-soft); }
.nf-plus-state.is-cancelled { color: var(--foreground); background: var(--muted); }
.nf-plus-state.is-grace { color: color-mix(in oklab, var(--warning) 80%, var(--foreground)); background: color-mix(in oklab, var(--warning) 16%, transparent); }
.nf-plus-state.is-off { color: var(--muted-foreground); background: var(--muted); }
.nf-plus-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0; }
.nf-plus-facts > div { padding: 10px 12px; border-radius: var(--radius); background: var(--muted); min-width: 0; }
.nf-plus-facts dt { font-size: 12px; color: var(--muted-foreground); margin: 0 0 3px; font-weight: 500; }
.nf-plus-facts dd { margin: 0; font-weight: 650; font-size: 14.5px; overflow-wrap: anywhere; }
.nf-plus-note { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted-foreground); }
.nf-plus-note.is-warn { color: color-mix(in oklab, var(--warning) 75%, var(--foreground)); }
.nf-plus-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nf-plus-form { display: grid; gap: 12px; }
.nf-plus-consent label { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.nf-plus-consent input { margin-top: 3px; flex: none; width: 16px; height: 16px; accent-color: var(--nf-plus); }
.nf-plus-balance { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted-foreground); }
.nf-plus-balance b { color: var(--foreground); font-variant-numeric: tabular-nums; }

/* история периодов */
.nf-plus-hist { width: 100%; border-collapse: collapse; font-size: 14px; }
.nf-plus-hist th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted-foreground); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.nf-plus-hist td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.nf-plus-hist td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nf-plus-hist .muted { color: var(--muted-foreground); font-size: 12.5px; }

/* ---------------------------------------------------------------- пейвол «Только для подписчиков Plus» */
.nb-paywall.is-plus .nb-paywall-lock { color: var(--nf-plus); background: var(--nf-plus-soft); }
.nb-paywall.is-plus { border-color: color-mix(in oklab, var(--nf-plus) 35%, var(--border)); }
.nb-paywall.is-plus .nb-coin-chip.is-price { color: var(--nf-plus); background: var(--nf-plus-soft); border-color: color-mix(in oklab, var(--nf-plus) 35%, transparent); }
.nb-paywall .nf-plus-perk-list { margin: 4px auto 0; padding: 0; list-style: none; display: grid; gap: 6px; max-width: 30em; text-align: left; font-size: 14px; }
.nb-paywall .nf-plus-perk-list li { display: flex; gap: 8px; align-items: flex-start; }
.nb-paywall .nf-plus-perk-list svg { color: var(--nf-plus); flex: none; margin-top: 3px; }
.nb-paywall .nf-plus-hint, .nf-plus-hint { display: flex; gap: 6px; align-items: flex-start; justify-content: center; }
.nf-plus-hint svg { color: var(--nf-plus); flex: none; margin-top: 3px; }

/* ---------------------------------------------------------------- форма главы (быстрая форма оглавления и редактор) */
.nf-plus-field { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.nf-plus-field label.nf-plus-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; cursor: pointer; margin: 0; }
.nf-plus-field label.nf-plus-check input { margin: 3px 0 0; accent-color: var(--nf-plus); }
.nf-plus-field label.nf-plus-check svg { color: var(--nf-plus); margin-top: 2px; }
.nf-plus-field .ce-hint, .nf-plus-field .bs-hint { margin: 4px 0 0 24px; }

/* ---------------------------------------------------------------- телефоны */
@media (max-width: 820px) {
	.nf-plus-hero { grid-template-columns: 1fr; padding: 22px; gap: 20px; }
	.nf-plus-perks { grid-template-columns: 1fr; gap: 12px; }
	.nf-plus-cols { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
	.nf-plus-hero { padding: 18px 16px; }
	.nf-plus-price { padding: 16px; }
	.nf-plus-price .amount b { font-size: 34px; }
	.nf-plus-status { padding: 16px; }
	.nf-plus-hist th:nth-child(4), .nf-plus-hist td:nth-child(4) { display: none; }
	.nf-plus-actions .nb-btn { flex: 1 1 auto; justify-content: center; }
}
