@font-face { font-family: "Huninn"; src: url(assets/fonts/Huninn-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
html { font-synthesis: none; } /* Huninn has one weight — no faux bold */

:root {
  --bg: #F5F5F7; --card: #FFFFFF; --ink: #1D1D1F; --grey: #86868B; --grey2: #6E6E73; --line: #D2D2D7;
  --fill: #E8E8ED; --seg: #FFFFFF; --blue: #0071E3; --code: #F5F5F7; --hero: #1D1D1F; --bar: rgba(245,245,247,.82);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
  --font: "Huninn", -apple-system, "SF Pro Display", system-ui, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --apple: cubic-bezier(.25,.1,.25,1); --expo: cubic-bezier(.16,1,.3,1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --c-join: #0071E3; --c-leave: #EB6834; --danger: #FF3B30;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1C1C1E; --ink: #F5F5F7; --grey: #8E8E93; --grey2: #AEAEB2; --line: #38383A;
    --fill: #2C2C2E; --seg: #48484A; --blue: #2997FF; --code: #2C2C2E; --hero: #1C1C1E; --bar: rgba(0,0,0,.78);
    --shadow: 0 0 0 1px rgba(255,255,255,.04);
    --c-join: #2997FF; --c-leave: #D95926; --danger: #FF453A;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1C1C1E; --ink: #F5F5F7; --grey: #8E8E93; --grey2: #AEAEB2; --line: #38383A;
  --fill: #2C2C2E; --seg: #48484A; --blue: #2997FF; --code: #2C2C2E; --hero: #1C1C1E; --bar: rgba(0,0,0,.78);
  --shadow: 0 0 0 1px rgba(255,255,255,.04);
    --c-join: #2997FF; --c-leave: #D95926; --danger: #FF453A;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--grey); }

.app { max-width: 520px; margin: 0 auto; }
.screen { display: none; padding: 16px 16px calc(104px + var(--safe-b)); animation: in .45s var(--expo); }
.screen.on { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(12px); } }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; letter-spacing: -.01em; }
.mark { width: 28px; height: 28px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 15px; }
h1 { font-size: 32px; line-height: 1.08; letter-spacing: -.025em; margin: 8px 0 20px; font-weight: 400; }
h1 span { color: var(--grey); }
h2 { font-size: 22px; letter-spacing: -.015em; margin: 0; font-weight: 400; }
h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; line-height: 1.25; font-weight: 400; }
.kind { font-size: 12px; color: var(--grey); letter-spacing: .04em; text-transform: uppercase; }
.ava { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #5E5CE6, #0071E3); color: #fff; display: grid; place-items: center; font-size: 15px; text-align: center; flex: none; }
.ava[data-me] { background-size: cover; background-position: center; }
.ava.lg { width: 72px; height: 72px; font-size: 30px; }
.ava.xs { width: 28px; height: 28px; font-size: 12px; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 32px 0 14px; }
.link { color: var(--blue); font-size: 15px; }

/* search */
.search-pill, .search { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--fill); color: var(--grey); font-size: 16px; }
.search-pill svg, .search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.search input::placeholder { color: var(--grey); }

/* continue reading */
.continue { margin-top: 16px; }
.cont { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); width: 100%; }
.cont .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; flex: none; }
.cont .ic img { width: 24px; height: 24px; }
.cont .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cont h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; transition: width .5s var(--expo); }
.play { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.play svg { width: 16px; height: 16px; }

/* rails */
.rail { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }

/* hero cards */
.hero-rail { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; }
.hero-rail::-webkit-scrollbar { display: none; }
.hero { flex: none; width: 82%; scroll-snap-align: start; border-radius: 26px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .45s var(--expo); }
.hero:active, .item:active, .coll:active, .tile:active, .cont:active { transform: scale(.98); }
.hero .stage { position: relative; aspect-ratio: 16 / 10; background: var(--hero); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero .stage.light { background: #FFFFFF; }
.hero .stage img { width: 34%; max-height: 52%; object-fit: contain; }
.hero .stage img.mascot { width: 56%; max-height: 92%; position: absolute; bottom: -6%; filter: drop-shadow(0 12px 24px rgba(0,0,0,.25)); }
.hero .stage .badge { position: absolute; left: 14px; top: 14px; }
.hero .meta { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.hero h3 { font-size: 20px; }
.hero p { margin: 0; color: var(--grey2); font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.14); color: #F5F5F7; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.badge.new { background: var(--blue); color: #fff; }

/* chips & segmented tabs (from the library) */
.chips { gap: 8px; }
.search + .chips { margin-top: 14px; }
.chips button { border: 0; background: var(--fill); color: var(--ink); font-size: 15px; padding: 9px 16px; border-radius: 999px; display: flex; align-items: center; gap: 7px; transition: background .2s, color .2s; white-space: nowrap; }
.chips button img { width: 16px; height: 16px; object-fit: contain; }
.chips button.on { background: var(--ink); color: var(--bg); }
.chips button span { color: var(--grey); }
.tabs { display: flex; gap: 4px; padding: 3px; background: var(--fill); border-radius: 999px; margin-bottom: 14px; }
.tabs button { flex: 1; text-align: center; color: var(--grey2); font-size: 14px; padding: 8px 6px; border-radius: 999px; transition: background .25s var(--apple), color .25s; white-space: nowrap; }
.tabs button.on { background: var(--seg); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* collections */
.coll { width: 64%; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; background: var(--card); box-shadow: var(--shadow); transition: transform .45s var(--expo); }
.coll .logos { display: flex; }
.coll .logos span { width: 34px; height: 34px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; margin-right: -6px; border: 2px solid var(--card); }
.coll .logos img { width: 18px; height: 18px; object-fit: contain; }
.coll h3 { margin-top: auto; }

/* feed items */
.list { display: flex; flex-direction: column; gap: 12px; }
.item { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); width: 100%; transition: transform .45s var(--expo); }
.item .head { display: flex; align-items: center; gap: 10px; }
.item .head .kind { flex: 1; }
.item .ic { width: 36px; height: 36px; border-radius: 11px; background: var(--bg); display: grid; place-items: center; flex: none; }
.item .ic img { width: 20px; height: 20px; object-fit: contain; }
.item .ic svg { width: 19px; height: 19px; }
.item .txt { display: flex; flex-direction: column; gap: 6px; }
.item h3 { font-size: 18px; }
.item p { margin: 0; color: var(--grey2); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tags span { font-size: 12px; color: var(--grey2); background: var(--bg); padding: 4px 9px; border-radius: 999px; }
.tags span.lvl { color: var(--blue); }
.save { width: 36px; height: 36px; margin: -4px -8px -4px 0; display: grid; place-items: center; color: var(--grey); border-radius: 50%; flex: none; }
.save svg { width: 19px; height: 19px; }
.save.on { color: var(--blue); }
.save.on svg, #rSave.on svg { fill: currentColor; }
.item .snippet { font: 13px/1.5 var(--mono); background: var(--code); color: var(--grey2); padding: 10px 12px; border-radius: 12px; margin-top: 2px; }
.item .snippet span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* explore */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { border-radius: 22px; background: var(--card); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 112px; transition: transform .45s var(--expo); }
.tile .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; }
.tile .ic img { width: 22px; height: 22px; object-fit: contain; }
.tile .ic svg { width: 20px; height: 20px; }
.tile .muted { font-size: 13px; margin-top: 3px; }
.empty { padding: 48px 16px; text-align: center; color: var(--grey); font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty img { width: 140px; }

/* profile */
.me { display: flex; align-items: center; gap: 16px; margin: 12px 0 22px; }
.me h2 { font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--card); box-shadow: var(--shadow); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-weight: 400; font-size: 26px; letter-spacing: -.02em; }
.stats span { font-size: 13px; color: var(--grey); }
.card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 16px; margin-top: 12px; }
.level { display: flex; flex-direction: column; gap: 10px; }
.level-row { display: flex; justify-content: space-between; align-items: baseline; }
.level-row h3 { font-size: 22px; }
.level p { margin: 0; font-size: 14px; line-height: 1.4; }
.topics-progress { display: flex; flex-direction: column; gap: 14px; }
.tp { display: flex; gap: 12px; align-items: center; }
.tp img { width: 20px; height: 20px; object-fit: contain; }
.tp .txt { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.tp .txt div:first-child { display: flex; justify-content: space-between; }
.menu { padding: 0 16px; }
.mi { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 52px; font-size: 16px; }
.mi.col { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 0; }
.mi.col .tabs { margin: 0; background: var(--bg); }
.mi + .mi { border-top: 1px solid var(--line); }
.sw { position: relative; width: 50px; height: 30px; flex: none; }
.sw input { position: absolute; opacity: 0; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--fill); transition: background .25s var(--apple); }
.sw i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .3s var(--expo); }
.sw input:checked + i { background: #34C759; }
.sw input:checked + i::after { transform: translateX(20px); }

/* tab bar */
.tabbar { position: fixed; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); z-index: 5; width: calc(100% - 32px); max-width: 420px; display: flex; justify-content: space-around; padding: 6px; border-radius: 30px; background: var(--bar); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: 0 0 0 .5px var(--line), 0 12px 32px rgba(0,0,0,.14); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--grey); padding: 7px 0 6px; border-radius: 24px; transition: color .2s, background .25s var(--apple); }
.tabbar button.on { color: var(--ink); background: var(--fill); }
.tabbar button.on svg { stroke-width: 2.2; }

/* reader */
.reader { position: fixed; inset: 0; z-index: 10; background: var(--bg); overflow-y: auto; transform: translateX(100%); transition: transform .5s var(--expo); visibility: hidden; }
.reader.open { transform: none; visibility: visible; }
.rbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 8px 8px; background: var(--bar); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); }
.rbar-title { flex: 1; min-width: 0; font-size: 15px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .25s; }
.rbar-title.show { opacity: 1; }
.icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
#rSave.on { color: var(--blue); }
.rprog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.rprog i { display: block; height: 100%; width: 0; background: var(--blue); }
.rbody { max-width: 640px; margin: 0 auto; padding: 8px 20px 24px; font-size: 17px; line-height: 1.6; }
.rbody h1 { font-size: 30px; margin: 10px 0 14px; }
.rbody h2 { margin: 30px 0 10px; font-size: 22px; }
.rbody p { margin: 0 0 14px; }
.rbody h3 { margin: 24px 0 8px; font-size: 19px; }
.rbody ul, .rbody ol { margin: 0 0 14px; padding-left: 22px; }
.rbody li { margin: 0 0 6px; }
.rbody li::marker { color: var(--grey); }
.rbody blockquote { margin: 0 0 14px; padding: 2px 0 2px 14px; border-left: 3px solid var(--line); color: var(--grey2); }
.rbody a { color: var(--blue); text-decoration: none; }
.rbody :not(pre) > code { font-family: var(--mono); font-size: .88em; background: var(--fill); padding: 2px 5px; border-radius: 6px; }
.rbody .rload { display: flex; justify-content: center; padding: 40px 0; }
.rbody .empty .btn { margin-top: 4px; }
.rbody .lead { color: var(--grey2); font-size: 18px; line-height: 1.5; }
.author { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--grey); margin: 18px 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.author b { font-weight: 400; color: var(--ink); display: block; font-size: 15px; }
.cover { border-radius: 24px; background: var(--hero); aspect-ratio: 16 / 9; display: grid; place-items: center; margin: 0 0 22px; overflow: hidden; }
.cover img { width: 26%; }
.toc { background: var(--card); box-shadow: var(--shadow); border-radius: 20px; padding: 6px 16px; margin: 0 0 22px; }
.toc .kind { padding: 12px 0 4px; }
.step { display: flex; align-items: center; gap: 12px; padding: 11px 0; font-size: 16px; line-height: 1.35; width: 100%; }
.step + .step { border-top: 1px solid var(--line); }
.step .ck { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; transition: background .25s, border-color .25s; }
.step .ck svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2.6; opacity: 0; }
.step.done .ck { background: var(--blue); border-color: var(--blue); }
.step.done .ck svg { opacity: 1; }
.step.done span:last-child { color: var(--grey); }
.code { position: relative; background: var(--code); border-radius: 16px; margin: 0 0 16px; overflow: hidden; }
.code .chead { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 0; font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: .04em; }
.code pre { margin: 0; padding: 10px 14px 14px; overflow-x: auto; font: 14px/1.55 var(--mono); color: var(--ink); white-space: pre; }
.code.prompt pre { white-space: pre-wrap; }
.copy { font-size: 13px; color: var(--blue); text-transform: none; letter-spacing: 0; padding: 4px 0 4px 8px; }
.callout { display: flex; gap: 12px; background: var(--card); box-shadow: var(--shadow); border-radius: 18px; padding: 14px 16px; margin: 0 0 16px; font-size: 16px; line-height: 1.5; }
.callout .dot { width: 6px; border-radius: 6px; background: var(--blue); flex: none; }
.callout b { font-weight: 400; display: block; color: var(--ink); }
.callout span { color: var(--grey2); }
.sticker { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.sticker img { width: 96px; }
.sticker div { background: var(--card); box-shadow: var(--shadow); padding: 12px 16px; border-radius: 20px 20px 20px 6px; font-size: 16px; }
.rfoot { max-width: 640px; margin: 0 auto; padding: 0 20px calc(32px + var(--safe-b)); }
.react { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0 28px; border-top: 1px solid var(--line); }
.react-row { display: flex; gap: 10px; }
.react-row button { padding: 10px 16px; border-radius: 999px; background: var(--fill); font-size: 15px; transition: background .2s, color .2s, transform .2s var(--expo); }
.react-row button.on { background: var(--ink); color: var(--bg); }
.react-row button:active { transform: scale(.94); }
.next-label { margin-bottom: 10px; }
.btn { display: inline-flex; justify-content: center; align-items: center; font-size: 16px; padding: 13px 20px; border-radius: 999px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.secondary { background: var(--fill); color: var(--ink); }
.btn.wide { width: 100%; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.32); display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .3s var(--apple); }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet .panel { width: 100%; max-width: 520px; margin: 0 auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; transform: translateY(100%); transition: transform .5s var(--expo); }
.sheet.open .panel { transform: none; }
.sheet .panel p { margin: 0; font-size: 15px; line-height: 1.45; }
.sheet .tabs { margin: 4px 0 0; }
.grab { width: 36px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 6px; }
.field { width: 100%; border: 0; outline: 0; background: var(--card); border-radius: 14px; padding: 13px 14px; font: inherit; font-size: 16px; color: var(--ink); resize: none; }
.field::placeholder { color: var(--grey); }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 30; background: var(--ink); color: var(--bg); font-size: 15px; padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .4s var(--expo); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* доступ: загрузка, «подпишитесь», ошибка */
.gate { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: none; overflow-y: auto; }
body:not([data-state="ready"]) .gate { display: flex; }
body:not([data-state="ready"]) .app { display: none; }
.gate-body { display: none; margin: auto; width: 100%; max-width: 420px; padding: 24px 16px calc(24px + var(--safe-b)); flex-direction: column; align-items: center; text-align: center; gap: 12px; animation: in .45s var(--expo); }
body[data-state="loading"] #gateLoading, body[data-state="locked"] #gateLocked, body[data-state="error"] #gateError { display: flex; }
.gate-body img { width: 150px; margin-bottom: 8px; }
.gate-body h1 { margin: 0; }
.gate-body h1 span { display: block; }
.gate-body p { margin: 0 0 12px; font-size: 16px; line-height: 1.45; }
.gate-body p:empty { display: none; }
.gate-body .btn[disabled] { opacity: .5; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--fill); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ——— админка ——— */
.admin-sec { margin-top: 28px; }
.admin-sec > h2 { margin-bottom: 12px; }
.stats.tiles { margin-bottom: 10px; }
.stats.tiles small { font-size: 12px; color: var(--grey); }
.muted.note { font-size: 13px; line-height: 1.45; margin: 8px 2px 0; }

/* графики: тонкие столбики, скруглённый конец данных, 2px зазор, подсказка по наведению/тапу */
.chart { position: relative; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-head h3 { font-size: 16px; }
.legend { display: flex; gap: 12px; font-size: 13px; color: var(--grey2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c-join); }
.legend i.leave { background: var(--c-leave); }
.plot { display: flex; align-items: stretch; gap: 2px; height: 140px; touch-action: pan-y; }
.plot .col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; border-radius: 4px; }
.plot .col.hot { background: var(--fill); }
.plot .half { flex: 1; display: flex; }
.plot .half.up { align-items: flex-end; border-bottom: 1px solid var(--line); }
.plot .half.down { align-items: flex-start; }
.plot .single { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.plot b { display: block; width: 100%; background: var(--c-join); }
.plot .up b, .plot .single b { border-radius: 4px 4px 0 0; }
.plot .down b { background: var(--c-leave); border-radius: 0 0 4px 4px; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--grey); margin-top: 6px; }
.tip { position: absolute; z-index: 3; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.4; padding: 7px 10px; border-radius: 10px; white-space: nowrap; opacity: 0; transform: translate(-50%, -100%); transition: opacity .15s; }
.tip.show { opacity: 1; }
.tbl { margin-top: 12px; font-size: 14px; }
.tbl summary { color: var(--blue); cursor: pointer; list-style: none; }
.tbl summary::-webkit-details-marker { display: none; }
.tbl table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); font-weight: 400; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--grey); font-size: 12px; }

/* списки с полосками: источники, платформы, топ материалов */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbars .row { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.hbars .row > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.hbars .row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .row .muted { flex: none; font-variant-numeric: tabular-nums; }
.empty-line { color: var(--grey); font-size: 15px; }

/* лента событий канала */
.events { display: flex; flex-direction: column; }
.ev { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; font-size: 15px; line-height: 1.35; }
.ev + .ev { border-top: 1px solid var(--line); }
.ev .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--grey); }
.ev .dot.join { background: var(--c-join); }
.ev .dot.leave { background: var(--c-leave); }
.ev .txt { flex: 1; min-width: 0; }
.ev .txt div:last-child { font-size: 13px; color: var(--grey); }

/* заметки в админке */
#noteNew { margin-bottom: 14px; }
.note-row { display: block; width: 100%; background: var(--card); box-shadow: var(--shadow); border-radius: 20px; padding: 14px 16px; }
.note-row + .note-row { margin-top: 10px; }
.note-row h3 { margin: 6px 0 4px; }
.note-row p { margin: 0; color: var(--grey); font-size: 14px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.status { display: inline-block; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--fill); color: var(--grey2); }
.status.pub { background: var(--blue); color: #fff; }

/* редактор заметки */
.editor { z-index: 15; }
.ed-toggle { padding: 0 10px; height: 40px; }
.ed-form { display: flex; flex-direction: column; gap: 10px; }
.ed-form .tabs { margin: 0; }
.ed-form select.field { -webkit-appearance: none; appearance: none; }
.ed-body { min-height: 42vh; line-height: 1.5; font-size: 16px; }
.ed-help { font-size: 13px; color: var(--grey); line-height: 1.7; }
.ed-help summary { color: var(--blue); cursor: pointer; }
.ed-help code { font-family: var(--mono); background: var(--fill); padding: 1px 5px; border-radius: 5px; color: var(--ink); }
.ed-preview h1 { margin-top: 0; }
.ed-error { color: var(--danger); font-size: 15px; margin: 12px 0 0; }
.ed-error:empty { display: none; }
.ed-actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 calc(16px + var(--safe-b)); }
.btn.danger { background: var(--fill); color: var(--danger); }
.btn[disabled] { opacity: .5; }

/* медиа в тексте */
.rbody .media { margin: 0 0 18px; }
.rbody .media img, .rbody .media video { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--fill); }
.rbody .media figcaption { font-size: 14px; line-height: 1.4; color: var(--grey); margin-top: 8px; }
.rbody .media.missing { padding: 16px; border-radius: 16px; background: var(--fill); color: var(--grey); font-size: 15px; }
.rbody a.filecard { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.filecard .fic { flex: none; width: 42px; height: 50px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 12px; letter-spacing: .04em; display: grid; place-items: center; }
.filecard .fmeta { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.filecard .fmeta b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard .fmeta span { font-size: 13px; color: var(--grey); }
.ed-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-tools .btn { padding: 10px 16px; font-size: 15px; }
.ed-tools .muted { font-size: 14px; }
