/* «Сигнал» — the news publication of KOVARYN. Standalone: no core.css, its own paper look.
   Themes: paper (default), sepia, night — set on <html data-theme>. Text size: --fs. */

:root {
  --bg: #F4F1EA; --bg2: #ECE7DC; --card: #FBF9F4; --ink: #141513; --ink2: #3D403B; --dim: #6A6E66; --line: #D9D3C5; --line2: #C4BCAA;
  --acc: #0A7A42; --acc-ink: #FFFFFF; --signal: #2BFF88;
  --r-tech: #2448D8; --r-company: #0A7A42; --r-community: #B8460C;
  --hl: rgba(43, 255, 136, .35);
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --serif: "Literata", Georgia, serif;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --read: var(--serif);
  --fs: 20px;
  --gutter: clamp(16px, 4.5vw, 56px);
  --max: 1200px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
:root[data-theme="sepia"] { --bg: #F2E8D3; --bg2: #E8DCC2; --card: #F7EEDB; --ink: #2E2418; --ink2: #4E4130; --dim: #76664F; --line: #DDCDAE; --line2: #CCB892; }
:root[data-theme="night"] {
  --bg: #0F100F; --bg2: #181A18; --card: #151715; --ink: #ECEAE3; --ink2: #C9C6BD; --dim: #949389; --line: #2A2D2A; --line2: #3A3E3A;
  --acc: #2BFF88; --acc-ink: #03130A; --r-tech: #7EA2FF; --r-company: #45E08C; --r-community: #FF9A5C; --hl: rgba(43, 255, 136, .22);
  color-scheme: dark;
}
:root[data-face="sans"] { --read: var(--sans); }
:root[data-fs="-1"] { --fs: 18px; }
:root[data-fs="1"] { --fs: 23px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background .3s, color .3s; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--hl); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); }
kbd { font: 500 12px var(--mono); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }

/* Buttons and fields */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg); font: 600 15px var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), background .15s, color .15s; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: default; transform: none; }
.button--line { background: transparent; color: var(--ink); }
.button--line:hover { background: var(--ink); color: var(--bg); }
input:not([type="checkbox"]):not([type="radio"]), textarea, select { width: 100%; min-height: 46px; padding: 11px 14px; border: 1.5px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 16px; }
input:focus, textarea:focus { outline: none; border-color: var(--acc); }
textarea { resize: vertical; line-height: 1.5; }

/* Section heading: a rule with a label, like a newspaper */
.sect-h { display: flex; align-items: center; gap: 14px; font: 600 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 0 0 20px; }
.sect-h::after { content: ""; flex: 1; height: 1px; background: var(--ink); opacity: .85; }
.rub { font: 600 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--r-company); }
.rub--tech { color: var(--r-tech); }
.rub--community { color: var(--r-community); }

/* ---------- Masthead ---------- */
.mast { border-bottom: 3px double var(--ink); }
.mast__strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); font: 500 12.5px var(--mono); color: var(--dim); }
.mast__date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mast__streak { color: var(--ink); white-space: nowrap; }
.mast__acts { display: flex; align-items: center; gap: 6px; }
.mast__btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--ink); }
.mast__btn:hover { background: var(--bg2); }
.mast__plus { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg); font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; }
.mast__plus.is-on { background: transparent; color: var(--ink); }
.mast__brand { text-align: center; padding-top: clamp(18px, 3.5vw, 34px); padding-bottom: 10px; }
.mast__logo { font: 900 clamp(56px, 11vw, 128px)/.9 var(--display); letter-spacing: -.035em; text-decoration: none; display: inline-flex; align-items: flex-end; }
.mast__dot { display: inline-block; width: .16em; height: .16em; border-radius: 50%; background: var(--signal); margin: 0 0 .12em .06em; box-shadow: 0 0 0 .025em var(--ink); }
.mast__tag { font: italic 600 clamp(14px, 1.6vw, 17px) var(--display); color: var(--ink2); margin-top: 10px; }
.mast__nav { display: flex; gap: 4px clamp(14px, 2.4vw, 30px); justify-content: center; align-items: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-top: 12px; padding-bottom: 12px; font: 600 14.5px var(--sans); }
.mast__nav::-webkit-scrollbar { display: none; }
.mast__nav a { text-decoration: none; white-space: nowrap; padding: 6px 2px; border-bottom: 2px solid transparent; color: var(--ink2); }
.mast__nav a:hover { color: var(--ink); }
.mast__nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.mast__nav [data-saved-n]:not(:empty) { font: 600 11px var(--mono); background: var(--ink); color: var(--bg); border-radius: 999px; padding: 1px 6px; margin-left: 2px; }
.mast__write { color: var(--acc) !important; }
.mast--slim .mast__brand { padding-top: 14px; padding-bottom: 4px; }
.mast--slim .mast__logo { font-size: clamp(40px, 6vw, 64px); }
.mast--slim .mast__tag { display: none; }

/* Reading progress + compact bar while reading */
.rbar { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.rbar span { display: block; height: 100%; width: 0; background: var(--acc); transition: width .1s linear; }
.mini { position: fixed; inset: 0 0 auto; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transform: translateY(-100%); transition: transform .3s var(--ease); }
.mini.is-on { transform: none; }
.mini__in { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.mini__logo { font: 900 24px/1 var(--display); text-decoration: none; display: inline-flex; align-items: flex-end; flex: none; }
.mini__t { flex: 1; min-width: 0; font: 600 14px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
.mini__left { font: 500 12px var(--mono); color: var(--dim); white-space: nowrap; }

/* ---------- Feed ---------- */
.feedp { padding: 28px 0 80px; }
.feedp__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; margin-top: 44px; }
.feedp__side { position: sticky; top: 72px; display: grid; gap: 28px; }
.nfront { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: 40px; padding-bottom: 36px; border-bottom: 1px solid var(--ink); }
.nfront__side .ntop ol { gap: 0; }

.nfeed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 32px; }
.nfeed__empty, .nfeed__end { color: var(--dim); font: italic 400 17px var(--serif); padding: 24px 0; grid-column: 1 / -1; }
.nfeed__end { text-align: center; }
.nfeed__more { text-align: center; margin-top: 32px; }
.nfeed--more { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }

.nc { position: relative; }
.nc__link { display: grid; gap: 14px; text-decoration: none; }
.nc__cover { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px; background: var(--bg2); }
.nc__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.nc__link:hover .nc__cover img, .nc__link:hover .gcov__w { transform: scale(1.04); }
.nc__badge { position: absolute; left: 10px; top: 10px; font: 600 11px var(--mono); background: var(--ink); color: var(--bg); padding: 4px 8px; border-radius: 999px; }
.nc__body { display: grid; gap: 8px; }
.nc__kick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: 500 12px var(--mono); color: var(--dim); }
.nc__pin { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--bg); background: var(--r-community); padding: 3px 7px; border-radius: 3px; }
.nc__title { font: 800 clamp(21px, 2vw, 25px)/1.15 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.nc__link:hover .nc__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.nc__lead { font: 400 16px/1.5 var(--serif); color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc__foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 12px var(--mono); color: var(--dim); }
.nc.is-read .nc__title { color: var(--dim); }
.nc--hero .nc__cover { aspect-ratio: 16 / 9.5; }
.nc--hero .nc__title { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -.02em; font-weight: 900; }
.nc--hero .nc__lead { font-size: clamp(17px, 1.5vw, 20px); -webkit-line-clamp: 4; }
.nfeed--more .nc__title { font-size: 19px; }
.nfeed--more .nc__lead { display: none; }

/* Generated cover. Hue buckets as classes: the CSP forbids inline style attributes */
.hu0 { --h: 150; } .hu1 { --h: 200; } .hu2 { --h: 260; } .hu3 { --h: 20; } .hu4 { --h: 330; } .hu5 { --h: 45; } .hu6 { --h: 175; } .hu7 { --h: 225; }
.gcov { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 6%; overflow: hidden; background:
  radial-gradient(120% 90% at 100% 0%, hsl(var(--h) 70% 62% / .55), transparent 60%),
  linear-gradient(160deg, hsl(var(--h) 30% 16%), hsl(calc(var(--h) + 40) 35% 9%)); color: #F4F1EA; }
.gcov--tech { background: radial-gradient(110% 90% at 100% 0%, hsl(calc(var(--h) / 4 + 210) 90% 62% / .6), transparent 60%), linear-gradient(160deg, #10183A, #080B18); }
.gcov--company { background: radial-gradient(110% 90% at 100% 0%, rgba(43, 255, 136, .5), transparent 60%), linear-gradient(160deg, #0C1A12, #050806); }
.gcov--community { background: radial-gradient(110% 90% at 100% 0%, hsl(calc(var(--h) / 8 + 15) 95% 60% / .55), transparent 60%), linear-gradient(160deg, #2A140A, #120804); }
.gcov__w { font: 900 clamp(34px, 6vw, 84px)/.9 var(--display); letter-spacing: -.03em; text-transform: lowercase; opacity: .95; transition: transform .6s var(--ease); transform-origin: left bottom; overflow-wrap: anywhere; }
.gcov__dot { position: absolute; right: 7%; top: 9%; width: 12px; height: 12px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 24px var(--signal); }
.nc--hero .gcov__w { font-size: clamp(56px, 9vw, 140px); }

/* Numbered lists: most read, discussed */
.ntop ol { list-style: none; display: grid; }
.ntop li a { display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.ntop li:first-child a { padding-top: 0; }
.ntop__n { grid-row: span 2; font: 900 34px/1 var(--display); color: var(--line2); }
.ntop__t { font: 700 17px/1.25 var(--display); }
.ntop li a:hover .ntop__t { text-decoration: underline; text-underline-offset: 3px; }
.ntop__m { font: 500 11.5px var(--mono); color: var(--dim); }
.ntop .is-read .ntop__t { color: var(--dim); }

/* Continue reading */
.cont { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 16px; padding: 14px 18px; margin-bottom: 28px; border: 1.5px solid var(--ink); border-radius: 12px; text-decoration: none; background: var(--card); }
.cont__k { font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.cont__t { font: 700 17px/1.3 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cont__bar { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.cont__bar span { display: block; height: 100%; background: var(--acc); }
.saved { margin: 8px 0 40px; }

/* Side cards */
.pluscard { padding: 24px; border-radius: 16px; background: #0F1110; color: #F4F1EA; display: grid; gap: 10px; justify-items: start; position: relative; overflow: hidden; }
.pluscard::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(43, 255, 136, .45), transparent 65%); }
.pluscard__k { font: 600 12px var(--mono); color: var(--signal); letter-spacing: .08em; }
.pluscard__t { font: 800 24px/1.1 var(--display); }
.pluscard__x { font-size: 14.5px; color: #C9C6BD; }
.pluscard .button { background: var(--signal); border-color: var(--signal); color: #03130A; margin-top: 6px; }
.habit { padding: 22px; border: 1.5px solid var(--ink); border-radius: 16px; display: grid; gap: 8px; }
.habit__k { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.habit__n b { font: 900 44px/1 var(--display); }
.habit__n span { font: 600 15px var(--sans); color: var(--ink2); }
.habit__week { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 4px 0; }
.habit__week li { display: grid; gap: 4px; justify-items: center; font: 500 10.5px var(--mono); color: var(--dim); }
.habit__week i { width: 100%; aspect-ratio: 1; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); }
.habit__week .is-on i { background: var(--acc); border-color: var(--acc); }
.habit__week .is-today { color: var(--ink); font-weight: 600; }
.habit__x { font-size: 13.5px; color: var(--dim); }

.nsearch-h { padding: 12px 0 32px; border-bottom: 1px solid var(--ink); margin-bottom: 8px; }
.nsearch-h__t { font: 900 clamp(36px, 6vw, 64px)/1 var(--display); letter-spacing: -.02em; }
.nsearch-h__n { color: var(--dim); margin-top: 10px; }

/* ---------- Article ---------- */
.postp { padding: 0 0 40px; }
.na { max-width: 820px; padding-top: clamp(28px, 5vw, 56px); }
.na-status { font: 500 14px var(--mono); background: var(--bg2); border-left: 3px solid var(--r-community); padding: 12px 16px; margin-bottom: 24px; }
.na-head { text-align: center; display: grid; gap: 18px; justify-items: center; }
.na-kicker { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; font: 500 12.5px var(--mono); color: var(--dim); }
.na-title { font: 900 clamp(36px, 6.2vw, 68px)/1.03 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.na-lead { font: italic 400 clamp(19px, 2.2vw, 24px)/1.45 var(--serif); color: var(--ink2); max-width: 680px; text-wrap: pretty; }
.na-byline { display: flex; align-items: center; gap: 12px; text-align: left; padding-top: 6px; }
.na-byline b { display: block; font: 600 15px var(--sans); }
.na-byline small { font: 500 12px var(--mono); color: var(--dim); }
.ava { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: 800 18px var(--display); color: #fff; background: hsl(var(--h, 150) 45% 34%); flex: none; }

.na-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 32px auto 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line2); background: transparent; font: 600 14px var(--sans); cursor: pointer; transition: border-color .15s, background .15s; }
.tool:hover { border-color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tool__i { font-size: 13px; }
.tool--ai { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tool--ai .tool__i { color: var(--signal); }
.tool--icon { width: 40px; padding: 0; justify-content: center; font: 700 15px var(--display); }

/* AI panel */
.ai { margin: 24px 0 0; border-radius: 18px; background: #0F1110; color: #ECEAE3; padding: 8px 8px 18px; animation: rise .45s var(--ease); position: relative; overflow: hidden; }
.ai::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(120deg, rgba(43, 255, 136, .8), transparent 40%, transparent 60%, rgba(43, 255, 136, .5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.ai__tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ai__tabs [role="tab"] { min-height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: transparent; color: #A8A69D; font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; }
.ai__tabs [aria-selected="true"] { background: #1D201E; color: #fff; }
.ai__x { margin-left: auto; width: 40px; min-height: 40px; border: 0; background: none; color: #A8A69D; cursor: pointer; border-radius: 12px; flex: none; }
.plus-tag { font: 700 11px var(--mono); color: #03130A; background: var(--signal); border-radius: 4px; padding: 1px 5px; margin-left: 2px; }
.ai__out { padding: 18px 16px 4px; font: 400 18px/1.6 var(--serif); min-height: 80px; }
.ai__out ul { list-style: none; display: grid; gap: 12px; }
.ai__out li { padding-left: 26px; position: relative; }
.ai__out li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.ai__out p + p { margin-top: 12px; }
.ai__out .ai__q { font: 600 14px var(--sans); color: var(--signal); margin-bottom: 6px; }
.ai__out .ai__a + .ai__q { margin-top: 18px; }
.ai__wait { display: grid; gap: 10px; }
.ai__wait i { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #1D201E 0%, #2D322F 50%, #1D201E 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.ai__wait i:nth-child(2) { width: 88%; } .ai__wait i:nth-child(3) { width: 70%; }
.ai__lock { display: grid; gap: 12px; justify-items: start; font: 400 16px/1.5 var(--sans); color: #C9C6BD; }
.ai__lock b { font: 800 22px/1.2 var(--display); color: #fff; }
.ai__lock .button { background: var(--signal); border-color: var(--signal); color: #03130A; }
.ai__ask { display: flex; gap: 8px; padding: 10px 16px 0; }
.ai__ask input { background: #1D201E !important; border-color: #2D322F !important; color: #fff !important; border-radius: 999px !important; }
.ai__ask .button { background: var(--signal); border-color: var(--signal); color: #03130A; }
.ai__muted { color: #8E8C84 !important; font-size: 15px; }
.ai__note { font: 500 11.5px var(--mono); color: #7F7D75; padding: 12px 16px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.na-cover { margin: 36px calc(-1 * min(80px, 6vw)) 0; }
.na-cover img { width: 100%; border-radius: 4px; }

/* Article text */
.na-body { margin: 40px auto 0; max-width: 680px; font: 400 var(--fs)/1.72 var(--read); color: var(--ink); }
.na-body > * + * { margin-top: 1.15em; }
.na-body > p:first-child::first-letter { float: left; font: 900 4.1em/.82 var(--display); margin: .06em .1em 0 0; color: var(--ink); }
.na-body h2 { font: 800 1.55em/1.18 var(--display); letter-spacing: -.01em; margin-top: 1.8em; }
.na-body h3 { font: 700 1.22em/1.25 var(--display); margin-top: 1.5em; }
.na-body a { color: var(--acc); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.na-body strong { font-weight: 600; }
.na-body ul, .na-body ol { padding-left: 1.3em; display: grid; gap: .45em; }
.na-body li::marker { color: var(--acc); }
.na-body blockquote { border: 0; padding: .6em 0 .6em 0; text-align: center; font: italic 600 1.35em/1.35 var(--display); position: relative; margin: 1.6em 0; }
.na-body blockquote::before { content: "“"; display: block; font: 900 3em/0.6 var(--display); color: var(--acc); margin-bottom: .1em; }
.na-body blockquote cite { display: block; font: 500 .55em var(--mono); font-style: normal; color: var(--dim); margin-top: .8em; }
.na-body hr { border: 0; text-align: center; height: 1em; }
.na-body hr::after { content: "✦ ✦ ✦"; font-size: .8em; color: var(--dim); letter-spacing: .6em; }
.na-body code { font: 500 .82em var(--mono); background: var(--bg2); padding: .1em .35em; border-radius: 4px; }
.na-body pre { background: #0F1110; color: #ECEAE3; padding: 18px 20px; border-radius: 10px; overflow-x: auto; font-size: .78em; line-height: 1.6; }
.na-body pre code { background: none; padding: 0; font-size: inherit; }
.na-fig { margin: 1.8em calc(-1 * min(60px, 5vw)) !important; }
.na-fig img { width: 100%; border-radius: 4px; }
.na-fig figcaption { font: 500 13px var(--mono); color: var(--dim); margin-top: 10px; padding: 0 min(60px, 5vw); }
.na-note { background: var(--bg2); border-left: 4px solid var(--acc); padding: 1em 1.2em; border-radius: 0 10px 10px 0; font-size: .92em; }
.na-note__t { font: 700 1.05em var(--display); margin-bottom: .3em; }
.na-body .is-flash { background: var(--hl); transition: background 1.5s; }
.na-source, .na-ugc { max-width: 680px; margin: 28px auto 0; font: 500 13px var(--mono); color: var(--dim); }
.na-source a { color: var(--acc); }
.na-end { max-width: 680px; margin: 36px auto 0; display: flex; justify-content: center; }
.na-end span { width: 12px; height: 12px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px var(--ink); }

/* Blocks inside articles: buttons, poll, question, CTA */
.na-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.na-body .button { font-size: 15px; text-decoration: none; color: var(--bg); }
.na-body .button--line { color: var(--ink); }
.na-cta { border: 1.5px solid var(--ink); border-radius: 16px; padding: 24px; display: grid; gap: 12px; font-family: var(--sans); }
.na-cta__t { font: 800 1.15em/1.2 var(--display); }
.na-cta__x { font-size: .85em; color: var(--ink2); }
.na-poll { border: 1.5px solid var(--ink); border-radius: 16px; padding: 22px; font: 400 16px var(--sans); display: grid; gap: 10px; }
.na-poll__q { font: 800 21px/1.25 var(--display); }
.na-poll__hint { font: 500 12.5px var(--mono); color: var(--dim); }
.na-poll__list { list-style: none; padding: 0 !important; display: grid; gap: 8px !important; }
.na-poll__opt { position: relative; width: 100%; min-height: 50px; text-align: left; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--card); cursor: pointer; overflow: hidden; }
.na-poll__opt:hover:not(:disabled) { border-color: var(--ink); }
.na-poll__opt:disabled { cursor: default; }
.na-poll__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--hl); transition: width .8s var(--ease); }
.na-poll__opt.is-mine { border-color: var(--acc); }
.na-poll__opt[aria-pressed="true"] { border-color: var(--ink); }
.na-poll__text { position: relative; flex: 1; font-weight: 500; }
.na-poll__pct { position: relative; font: 600 14px var(--mono); }
.na-ask { border: 1.5px solid var(--line2); border-radius: 16px; padding: 22px; display: grid; gap: 10px; font: 400 16px var(--sans); background: var(--card); }
.na-ask__q { font: 800 20px/1.25 var(--display); }
.na-ask__hint { color: var(--dim); font-size: 14px; }
.na-ask__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.na-ask__msg { font-size: 14px; color: var(--acc); }
.na-ask__msg.is-err { color: #C2261C; }
.na-ask.is-done textarea, .na-ask.is-done input, .na-ask.is-done button { display: none; }

/* Reactions, share */
.na-react, .na-share, .na-comments, .na-write { max-width: 680px; margin: 48px auto 0; }
.na-react { text-align: center; display: grid; gap: 14px; justify-items: center; }
.na-react__t { font: 800 22px var(--display); }
.na-react__row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.na-react__b { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--card); cursor: pointer; font-size: 20px; transition: transform .18s var(--ease), border-color .15s; }
.na-react__b b { font: 600 14px var(--mono); }
.na-react__b:hover { border-color: var(--ink); }
.na-react__b[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.na-react__b.is-pop { transform: scale(1.18); }
.na-share { padding: 28px; border-radius: 18px; background: var(--bg2); }
.na-share__h { font: 800 24px var(--display); }
.na-share__x { color: var(--ink2); margin: 6px 0 16px; font-size: 15px; }
.na-share__row { display: flex; flex-wrap: wrap; gap: 8px; }
.shr { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--card); font: 600 14px var(--sans); text-decoration: none; cursor: pointer; }
.shr:hover { border-color: var(--ink); }
.shr--tg:hover { background: #2AABEE; border-color: #2AABEE; color: #fff; }
.shr--wa:hover { background: #25D366; border-color: #25D366; color: #fff; }
.shr--x:hover { background: #000; border-color: #000; color: #fff; }
.shr--vk:hover { background: #0077FF; border-color: #0077FF; color: #fff; }
.shr--fb:hover { background: #1877F2; border-color: #1877F2; color: #fff; }
.na-share__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.scard { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 14px; align-items: center; text-align: left; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line2); background: var(--card); cursor: pointer; }
.scard:hover { border-color: var(--ink); }
.scard__pv { grid-row: span 2; width: 34px; border-radius: 5px; background: linear-gradient(160deg, #0C1A12, #050806); position: relative; }
.scard__pv::after { content: ""; position: absolute; right: 5px; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }
.scard__pv--story { aspect-ratio: 9 / 16; }
.scard__pv--post { aspect-ratio: 4 / 5; }
.scard b { font: 700 16px var(--display); }
.scard small { font-size: 12.5px; color: var(--dim); }

/* Comments */
.na-comments__h { font: 800 28px var(--display); margin-bottom: 18px; }
.na-comments__h span { font: 600 15px var(--mono); color: var(--dim); }
.na-cform { display: grid; gap: 10px; }
.na-cform__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.na-cform__me { font: 500 13px var(--mono); color: var(--dim); }
.na-cform__msg { font-size: 14px; color: var(--acc); }
.na-cform__msg.is-err, .is-err { color: #C2261C; }
.na-cform__login { color: var(--ink2); display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.na-clist { list-style: none; display: grid; margin-top: 18px; }
.na-c { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.na-c__ava { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 800 16px var(--display); }
.na-c__head { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.na-c__head time { font: 500 12px var(--mono); color: var(--dim); }
.na-c__text { font: 400 17px/1.55 var(--serif); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.na-c__reply { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--acc); background: var(--bg2); font-size: 15px; border-radius: 0 8px 8px 0; }
.na-c__reply b { display: block; font: 600 12px var(--mono); color: var(--acc); }
.na-clist__empty { color: var(--dim); font: italic 16px var(--serif); padding: 10px 0; }
.na-write { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0; border-top: 3px double var(--ink); border-bottom: 1px solid var(--line); }
.na-write p { flex: 1 1 320px; font: 400 16px/1.5 var(--serif); }
.na-write b { font-family: var(--display); }
.na-flash { margin-top: 8px; font-size: 14px; }
.na-more { margin-top: 72px; }

/* Up next */
.upnext { position: fixed; z-index: 55; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); display: flex; align-items: center; gap: 4px; padding: 8px; border-radius: 18px; background: var(--ink); color: var(--bg); box-shadow: 0 18px 50px rgba(0, 0, 0, .3); animation: rise .4s var(--ease); }
.upnext__link { flex: 1; display: flex; align-items: center; gap: 14px; padding: 8px; text-decoration: none; min-width: 0; }
.upnext__link small { display: block; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--signal); }
.upnext__t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 700 16px/1.25 var(--display); }
.upnext__ring { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.upnext__ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.upnext__ring circle { fill: none; stroke: color-mix(in srgb, var(--bg) 25%, transparent); stroke-width: 3; }
.upnext__ring .upnext__p { stroke: var(--signal); stroke-dasharray: 100.5; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.upnext__ring b { font: 600 14px var(--mono); }
.upnext__x { width: 40px; height: 40px; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 50%; flex: none; }

/* Quote bubble on text selection */
.qbub { position: absolute; z-index: 70; display: flex; gap: 2px; padding: 4px; background: var(--ink); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: rise .2s var(--ease); max-width: calc(100vw - 16px); overflow-x: auto; }
.qbub button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--bg); font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; }
.qbub button:hover { background: color-mix(in srgb, var(--bg) 15%, transparent); }
.qbub button[data-q="card"] { color: var(--signal); }

/* Dialog sheets */
.sheet { margin: auto; border: 0; border-radius: 22px; padding: 28px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.sheet::backdrop { background: rgba(10, 10, 9, .55); backdrop-filter: blur(4px); }
.sheet[open] { animation: rise .3s var(--ease); }
.sheet__x { position: absolute; right: 12px; top: 12px; }
.sheet__x button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg2); cursor: pointer; }
.sheet__k { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.sheet__h { font: 900 52px/1 var(--display); letter-spacing: -.02em; margin-top: 6px; }
.grad { color: var(--acc); }
.sheet__lead { font: 400 17px/1.5 var(--serif); color: var(--ink2); margin-top: 10px; }
.sheet__list { list-style: none; display: grid; gap: 12px; margin: 20px 0; }
.sheet__list li { padding-left: 28px; position: relative; font-size: 15px; color: var(--ink2); }
.sheet__list li::before { content: "✦"; position: absolute; left: 4px; color: var(--acc); }
.sheet__list b { color: var(--ink); }
.sheet__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.sheet__price b { font: 800 26px var(--display); }
.sheet__price span { font: 500 13px var(--mono); color: var(--acc); }
.sheet__acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.sheet__msg { font-size: 14px; margin-top: 10px; color: var(--acc); }
.sheet__msg:empty { display: none; }
.sheet__fine { font-size: 12.5px; color: var(--dim); margin-top: 12px; }
.sheet--search { width: min(640px, calc(100vw - 24px)); margin-top: 10vh; }
.srch { display: flex; gap: 8px; }
.srch input { border-radius: 999px !important; font-size: 17px !important; }
.srch__res { list-style: none; display: grid; margin-top: 10px; }
.srch__res a { display: grid; gap: 2px; padding: 12px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.srch__res a:hover, .srch__res a:focus { background: var(--bg2); }
.srch__res b { font: 700 17px/1.3 var(--display); }
.srch__res small { font: 500 12px var(--mono); color: var(--dim); }
.srch__hint { font-size: 13px; color: var(--dim); margin-top: 12px; }
.type__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.sheet--type .sheet__k { margin-bottom: 6px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg2); }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer; font: 600 13.5px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.sheet--card { width: min(460px, calc(100vw - 24px)); }
.cardv { display: grid; place-items: center; background: var(--bg2); border-radius: 14px; padding: 14px; margin-top: 36px; }
.cardv canvas { max-width: 100%; max-height: 56dvh; height: auto; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.cardv__themes { display: flex; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.cardv__themes button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line2); cursor: pointer; position: relative; }
.cardv__themes button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg) inset; }
.cardv__themes button[disabled]::after { content: "+"; position: absolute; right: -6px; top: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--signal); color: #03130A; font: 700 11px/16px var(--mono); }

.toast__btn { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; margin-left: 4px; }
.ct--ink { background: #0F1110; } .ct--paper { background: #F4F1EA; } .ct--signal { background: #2BFF88; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font: 600 14.5px var(--sans); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: rise .3s var(--ease); max-width: calc(100vw - 32px); text-align: center; }

/* Footer */
.colo { border-top: 3px double var(--ink); margin-top: 40px; padding: 40px 0 48px; }
.colo__in { display: grid; gap: 14px; justify-items: center; text-align: center; }
.colo__logo { font: 900 44px/1 var(--display); display: inline-flex; align-items: flex-end; letter-spacing: -.03em; }
.colo__x { max-width: 520px; color: var(--ink2); font: 400 15px/1.5 var(--serif); }
.colo__links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font: 600 14px var(--sans); }
.colo__links a, .colo__links button { text-decoration: none; background: none; border: 0; cursor: pointer; padding: 6px 0; }
.colo__links a:hover, .colo__links button:hover { text-decoration: underline; }
.colo__meta { font: 500 12px var(--mono); color: var(--dim); }

/* ---------- Writer (/news/write) ---------- */
.page-head { padding-top: 40px; padding-bottom: 32px; }
.kicker { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.kicker a { text-decoration: none; }
.h1 { font: 900 clamp(36px, 6vw, 64px)/1.03 var(--display); letter-spacing: -.02em; margin-top: 12px; }
.lede { font: 400 19px/1.55 var(--serif); color: var(--ink2); max-width: 680px; margin-top: 14px; }
.nw { padding-bottom: 72px; }
.nw__login { border: 1.5px solid var(--ink); border-radius: 16px; padding: 28px; max-width: 640px; display: grid; gap: 18px; justify-items: start; color: var(--ink2); }
.nw__app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.nw__mine { grid-column: 1 / -1; }
.nw__mine:empty { display: none; }
.nw__mine h2 { font: 800 22px var(--display); margin-bottom: 12px; }
.nw__list { list-style: none; padding: 0; display: grid; gap: 8px; }
.nw__item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border: 1px solid var(--line2); border-radius: 14px; padding: 12px 16px; background: var(--card); }
.nw__item b { font-weight: 600; flex: 1 1 240px; }
.nw__badge { font: 500 12px var(--mono); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--dim); }
.nw__badge--pending { color: #9A6A00; border-color: #9A6A00; }
.nw__badge--published { color: var(--acc); border-color: var(--acc); }
.nw__badge--rejected { color: #C2261C; border-color: #C2261C; }
.nw__reason { flex-basis: 100%; font-size: 14px; color: #C2261C; }
.nw__link { background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-size: 15px; padding: 0; min-height: 32px; }
.nw__form { display: grid; gap: 20px; }
.nw__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nw__state { font: 500 13px var(--mono); color: var(--dim); }
.nw__f { display: grid; gap: 8px; }
.nw__f > span { font-weight: 600; }
.nw__f small { color: var(--dim); font-weight: 400; font-size: 14px; }
.nw__f textarea[name="body"] { font: 15px/1.6 var(--mono); min-height: 420px; }
.nw__f.is-err input, .nw__f.is-err textarea { border-color: #C2261C; }
.nw__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.nw__tools button { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); font-size: 14px; cursor: pointer; }
.nw__tools button:hover { border-color: var(--ink); }
.nw__count { font: 500 12px var(--mono); color: var(--dim); }
.nw__cover-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nw__cover-row img { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.nw__rules { font-size: 14px; color: var(--dim); }
.nw__msg { font-size: 15px; color: var(--acc); }
.nw__msg.is-err { color: #C2261C; }
.nw__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.nw__preview { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--line2); border-radius: 16px; padding: 24px; background: var(--card); }
.na--preview { padding-top: 12px; max-width: none; }
.na--preview .na-title { font-size: 34px; text-align: left; }
.na--preview .na-lead { font-size: 18px; margin-top: 10px; }
.na--preview .na-body { margin-top: 20px; --fs: 17px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .feedp__grid { grid-template-columns: 1fr; gap: 40px; }
  .feedp__side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .nfeed--more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .nfront { grid-template-columns: 1fr; gap: 32px; }
  .nw__app { grid-template-columns: 1fr; }
  .nw__preview { position: static; max-height: none; }
  .mast__streak { display: none; }
}
@media (max-width: 600px) {
  :root { --fs: 18.5px; }
  :root[data-fs="-1"] { --fs: 17px; }
  :root[data-fs="1"] { --fs: 21px; }
  .nfeed, .nfeed--more { grid-template-columns: 1fr; gap: 30px; }
  .mast__nav { justify-content: flex-start; }
  .na-cover, .na-fig { margin-left: calc(-1 * var(--gutter)) !important; margin-right: calc(-1 * var(--gutter)) !important; }
  .na-cover img, .na-fig img { border-radius: 0; }
  .na-share { padding: 20px; margin-left: calc(-1 * var(--gutter) / 2); margin-right: calc(-1 * var(--gutter) / 2); }
  .na-share__cards { grid-template-columns: 1fr; }
  .na-tools { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
  .na-tools::-webkit-scrollbar { display: none; }
  .tool { flex: none; }
  .ai { margin-left: calc(-1 * var(--gutter) / 2); margin-right: calc(-1 * var(--gutter) / 2); }
  .ai__ask { flex-direction: column; }
  .upnext { right: 8px; left: 8px; bottom: 8px; width: auto; }
  .sheet { padding: 22px; }
  .sheet__h { font-size: 44px; }
  .ntop__t { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .mast__strip, .mast__nav, .na-tools, .na-react, .na-share, .na-comments, .na-write, .na-more, .colo, .rbar, .mini, .upnext { display: none !important; } body { background: #fff; color: #000; } }
