/* Планнер на телефоне (v4): the shell and the four screens of js/m/. Everything here is under html.m4 (a phone with the new view on),
   so the computer and «Прежний вид» never see it. Colours are the studio's tokens (tokens.css); the platform colours are set here. */
html.m4 {
  --pf-ig: #E1306C; --pf-tg: #2AABEE; --pf-yt: #FF4E45; --pf-th: var(--text); --pf-vk: #4C75A3; --pf-tt: #25F4EE;
  --m-draft: var(--st-draft); --m-ready: var(--st-ready); --m-sched: var(--st-scheduled); --m-pub: var(--st-published); --m-err: var(--st-error);
  --m-dir: var(--dir-2); --m-cal: #E06C6C;
}
html.m4[data-theme="light"] { --pf-tt: #0B9E9A; --m-cal: #B23A3A; }

/* ---------- the shell: our head instead of the planner's top bar ---------- */
html.m4 .topbar { display: none; }
html.m4 .m-hd { position: sticky; top: var(--safe-top, 0px); z-index: 20; background: var(--bg); padding: 8px 16px 10px; }
html.m4 .m-hd-row { display: flex; align-items: center; gap: 8px; min-height: 40px; }
html.m4 .m-hd h1 { margin: 0; flex: 1; min-width: 0; font: 600 28px/1.15 var(--sans); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m4 .m-ib { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--text); position: relative; text-decoration: none; cursor: pointer; padding: 0; }
html.m4 .m-ib[hidden] { display: none; }
html.m4 .m-ib .m-ic { width: 19px; height: 19px; }
html.m4 .m-errb { color: var(--st-error); border-color: color-mix(in srgb, var(--st-error) 40%, var(--line)); }
html.m4 .m-ib .bd { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--st-error); color: #fff; font: 600 11px/18px var(--sans); text-align: center; }
html.m4 .m-tabs { display: flex; gap: 4px; margin-top: 12px; padding: 3px; border-radius: 13px; background: var(--sunken); border: 1px solid var(--line); }
html.m4 .m-tabs[hidden] { display: none; }
html.m4 .m-tabs a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 2px; border-radius: 10px; font: 500 13.5px var(--sans); color: var(--muted); text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
html.m4 .m-tabs a[aria-current="page"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .18); }
html.m4 .m-tabs .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--st-error); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
html.m4 .m-tabs .n[hidden] { display: none; }
/* our screens draw their own head; the other sections keep theirs under the «‹» row, without the second title */
html.m4.m4-own .page-head { display: none; }
html.m4:not(.m4-own) #view-title { display: none; }
html.m4 .page-head { padding: 0 16px; }
html.m4 .view.m-view { padding: 4px 0 calc(110px + env(safe-area-inset-bottom, 0px)); }
html.m4 .m-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
html.m4 .num { font-variant-numeric: tabular-nums; }
html.m4.m-ov body { overflow: hidden; }

/* ---------- shared ---------- */
.m-view button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; text-align: inherit; }
.m-view button:focus-visible, .m-sheet button:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: 10px; }
.m-pad { padding: 0 16px; }
.m-h { display: flex; align-items: baseline; gap: 8px; margin: 22px 16px 8px; }
.m-h h3 { margin: 0; font: 600 16px var(--sans); }
.m-h small { color: var(--muted); font-size: 13px; }
.m-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--c); }
.m-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.m-pm { display: inline-flex; gap: 4px; }
.m-pm .m-ic { width: 14px; height: 14px; stroke-width: 1.8; }
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 16px; background: var(--sunken); border: 1px solid var(--line); font: 500 13px var(--sans); color: var(--text); white-space: nowrap; text-decoration: none; cursor: pointer; }
.m-view .m-btn { border: 1px solid var(--line); padding: 0 13px; }
.m-btn.pri, .m-view .m-btn.pri { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.m-btn.gold, .m-view .m-btn.gold { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.m-btn:disabled { opacity: .55; }
.m-btn .m-ic { width: 15px; height: 15px; }
.m-warnline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--st-error); flex-basis: 100%; }
.m-warnline .m-ic { width: 13px; height: 13px; }
.m-ghint { margin: 10px 16px 0; font-size: 12.5px; color: var(--faint); text-align: center; text-wrap: balance; }
.m-ghint.err { color: var(--st-error); }
.m-ghint a { color: var(--muted); }
.m-skel { height: 96px; margin: 10px 16px 0; border-radius: 18px; background: linear-gradient(90deg, var(--panel), var(--raised), var(--panel)); background-size: 200% 100%; animation: mShim 1.4s linear infinite; }
.m-pad .m-skel, .m-ibx .m-skel { margin-left: 0; margin-right: 0; }
@keyframes mShim { to { background-position: -200% 0; } }
.m-err { margin: 16px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--st-error) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--st-error) 30%, var(--line)); font-size: 14px; display: grid; gap: 10px; justify-items: start; }
.m-note { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; display: flex; gap: 6px; align-items: flex-start; }
.m-note .m-ic { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- План ---------- */
.m-lvl { display: flex; gap: 2px; margin: 4px 16px 12px; padding: 2px; border-radius: 11px; background: var(--sunken); border: 1px solid var(--line); }
.m-view .m-lvl button { flex: 1; padding: 6px 0; border-radius: 9px; font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: center; }
.m-view .m-lvl button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.m-lvl-body.zoom-out { animation: mZout .32s var(--ease); }
.m-lvl-body.zoom-in { animation: mZin .32s var(--ease); }
@keyframes mZout { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes mZin { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.m-wkh { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px; }
.m-wkh > span { flex: 1; display: grid; text-align: center; min-width: 0; }
.m-wkh b { font-size: 17px; font-weight: 600; }
.m-wkh small { font-size: 12.5px; color: var(--muted); }
.m-view .m-wkh .m-ib { width: 36px; height: 36px; border: 1px solid var(--line); }
.m-wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 12px; }
.m-view .m-wkd { display: grid; justify-items: center; gap: 4px; padding: 6px 0 7px; border-radius: 14px; font-size: 11px; color: var(--muted); text-align: center; }
.m-wkd b { font-size: 17px; font-weight: 600; color: var(--text); }
.m-view .m-wkd.on { background: var(--m-cal); color: #fff; }
.m-wkd.on b { color: #fff; }
.m-wkd .mini { width: 24px; height: 30px; border-radius: 5px; overflow: hidden; background: var(--sunken); border: 1px dashed var(--line-strong); }
.m-wkd .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-wkd .mini.none { border-color: transparent; background: none; }
.m-wkd .mini.ghost { border-color: var(--m-dir); background: color-mix(in srgb, var(--m-dir) 12%, transparent); }
.m-wkd.on .mini.none { opacity: 0; }
.m-wkhint { margin: 10px 16px 0; display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.m-wkhint .m-ic { width: 16px; height: 16px; color: var(--accent); fill: var(--accent-soft); margin-top: 1px; }
.m-wkhint b { color: var(--text); font-weight: 500; }
.m-day { margin: 18px 16px 0; display: grid; gap: 8px; }
.m-day-h { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; }
.m-day-h small { color: var(--muted); font-weight: 400; font-size: 13px; }
.m-day-h.today { color: var(--m-cal); }
.m-list { display: grid; gap: 8px; }
.m-view .m-post { position: relative; display: flex; gap: 12px; padding: 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: left; width: 100%; align-items: stretch; color: var(--text); }
.m-cv { position: relative; width: 64px; aspect-ratio: 4 / 5; align-self: flex-start; border-radius: 10px; overflow: hidden; flex: none; background: var(--sunken); }
.m-cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-cv.txt { display: grid; place-items: center; padding: 6px; background: linear-gradient(160deg, var(--accent-soft), var(--sunken)); font-size: 9.5px; line-height: 1.2; color: var(--muted); text-align: center; overflow: hidden; }
.m-post .w { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 2px 0; }
.m-post .tm { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.m-post .tm b { color: var(--text); font-weight: 600; font-size: 14px; }
.m-post .tt { font-size: 15px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-post .foot { margin-top: auto; padding-top: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.m-post .foot small { font-size: 12.5px; color: var(--muted); }
.m-views { display: inline-flex; align-items: center; gap: 4px; }
.m-views .m-ic { width: 13px; height: 13px; }
.m-view .m-post.ghost { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--m-dir) 55%, var(--line-strong)); }
.m-post.ghost .m-cv { background: color-mix(in srgb, var(--m-dir) 10%, transparent); display: grid; place-items: center; color: var(--m-dir); }
.m-post.ghost .tm { color: var(--m-dir); }
.m-view .m-post.warn { border-color: color-mix(in srgb, var(--st-error) 50%, var(--line)); }
.m-view .m-free { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 13.5px; width: 100%; text-align: left; }
.m-view .m-free .m-btn { margin-left: auto; }
.m-day .m-free { margin-top: 0; }
.m-pad > .m-free { margin-top: 14px; }
.m-calline { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--m-sched) 12%, var(--panel)); font-size: 13px; }
.m-calline i { width: 3px; align-self: stretch; border-radius: 2px; background: var(--m-sched); }
/* Неделя */
.m-wtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px; }
.m-view .m-wt { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: left; min-height: 150px; min-width: 0; color: var(--text); }
.m-view .m-wt.today { border-color: var(--m-cal); box-shadow: inset 0 0 0 1px var(--m-cal); }
.m-view .m-wt.empty { background: transparent; border-style: dashed; }
.m-wt .wt-h { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--muted); }
.m-wt .wt-h b { font-size: 20px; font-weight: 600; color: var(--text); }
.m-wt.today .wt-h, .m-wt.today .wt-h b { color: var(--m-cal); }
.m-wt .wcvs { display: flex; gap: 5px; flex: 1; min-height: 0; }
.m-wt .wcv { position: relative; flex: 1; max-width: 50%; aspect-ratio: 4 / 5; max-height: 96px; border-radius: 9px; overflow: hidden; background: var(--sunken); }
.m-wt .wcv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-wt .wcv b { position: absolute; left: 4px; bottom: 3px; font-size: 10px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .8); }
.m-wt .wcv.plan { outline: 1.5px dashed var(--accent); outline-offset: -1.5px; }
.m-wt .wcv.txt { padding: 5px; font-size: 9px; line-height: 1.2; color: var(--muted); background: linear-gradient(160deg, var(--accent-soft), var(--sunken)); border: 1px dashed var(--accent-line); }
.m-wt .wcv.ghost { display: grid; place-items: center; align-content: center; gap: 3px; padding: 4px; color: var(--m-dir); border: 1.5px dashed color-mix(in srgb, var(--m-dir) 55%, var(--line-strong)); background: color-mix(in srgb, var(--m-dir) 8%, transparent); }
.m-wt .wcv.ghost .m-ic { width: 16px; height: 16px; }
.m-wt .wcv.ghost i { font-style: normal; font-size: 8.5px; line-height: 1.15; text-align: center; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.m-wt .wt-free { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12.5px; color: var(--faint); }
.m-wt .wt-free .m-ic { width: 15px; height: 15px; }
.m-wt .wt-cal { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.m-wt .wt-cal i { width: 7px; height: 7px; border-radius: 50%; background: var(--m-sched); }
.m-wt.sum { justify-content: flex-start; gap: 8px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; min-height: 150px; }
.m-wt .sumrow { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.m-wt .sumrow b { color: var(--text); font-weight: 600; }
/* Месяц */
.m-mh { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 10px 4px; font-size: 11px; color: var(--faint); text-align: center; }
.m-mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 0 10px; }
.m-view .m-mc { position: relative; aspect-ratio: 4 / 5; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; padding: 0; }
.m-view .m-mc.out { opacity: .35; }
.m-mc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-mc .mc-d { position: absolute; z-index: 1; top: 3px; left: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.m-mc.has .mc-d { color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .8); }
.m-view .m-mc.today { border: 2px solid var(--m-cal); }
.m-mc.today .mc-d { color: var(--m-cal); }
.m-view .m-mc.plan { border: 1.5px dashed var(--accent); background: linear-gradient(160deg, var(--accent-soft), var(--sunken)); }
.m-mc .mc-t { position: absolute; left: 3px; right: 3px; bottom: 4px; font-size: 8px; line-height: 1.15; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: left; }
.m-view .m-mc.ghost { border: 1.5px dashed color-mix(in srgb, var(--m-dir) 55%, var(--line-strong)); background: color-mix(in srgb, var(--m-dir) 7%, transparent); }
.m-mc .mc-g { position: absolute; inset: 0; display: grid; place-items: center; color: var(--m-dir); }
.m-mc .mc-g .m-ic { width: 16px; height: 16px; }
.m-mc .mc-n { position: absolute; z-index: 1; right: 3px; bottom: 3px; padding: 0 4px; border-radius: 6px; background: rgb(0 0 0 / .6); color: #fff; font-size: 9.5px; font-weight: 600; }
.m-mc .mc-cal { position: absolute; z-index: 1; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--m-sched); box-shadow: 0 0 0 1.5px var(--bg); }
.m-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 16px 0; font-size: 12px; color: var(--muted); }
.m-legend span { display: inline-flex; align-items: center; gap: 6px; }
.m-legend i { width: 12px; height: 16px; border-radius: 3px; }
.m-legend .lg-p { background: linear-gradient(160deg, #7a6650, #2a2622); }
.m-legend .lg-d { border: 1.5px dashed var(--accent); }
.m-legend .lg-g { border: 1.5px dashed var(--m-dir); }
.m-legend .lg-c { width: 7px; height: 7px; border-radius: 50%; background: var(--m-sched); }

/* ---------- Сетка ---------- */
.m-prof { display: flex; align-items: center; gap: 14px; padding: 4px 16px 0; }
.m-av { width: 62px; height: 62px; border-radius: 50%; padding: 2px; flex: none; background: conic-gradient(#F9CE34, #EE2A7B, #6228D7, #F9CE34); display: grid; }
.m-av img, .m-av > span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--bg); object-fit: cover; background: var(--raised); font-weight: 600; font-size: 22px; }
.m-prof .pw { flex: 1; min-width: 0; display: grid; gap: 6px; }
.m-prof .pw > b { font-size: 16px; font-weight: 600; }
.m-pnums { display: flex; gap: 16px; }
.m-pnums span { display: grid; font-size: 11.5px; color: var(--muted); }
.m-pnums b { font-size: 16px; font-weight: 600; color: var(--text); }
.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 12px; }
.m-gt { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sunken); touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.m-gt img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.m-gt .v { position: absolute; left: 5px; bottom: 4px; display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .7); }
.m-gt .v .m-ic { width: 12px; height: 12px; }
.m-gt .kind { position: absolute; top: 5px; right: 5px; color: #fff; filter: drop-shadow(0 1px 3px rgb(0 0 0 / .6)); }
.m-gt .kind .m-ic { width: 15px; height: 15px; }
.m-gt.plan { outline: 2px dashed var(--accent); outline-offset: -2px; display: grid; place-items: center; padding: 10px; text-align: center; background: linear-gradient(160deg, var(--accent-soft), var(--sunken)); touch-action: none; }
.m-gt.plan img { position: absolute; inset: 0; opacity: .85; }
.m-gt.plan b { position: relative; font-size: 11.5px; line-height: 1.25; color: var(--text); }
.m-gt.plan .when { position: absolute; z-index: 1; top: 6px; left: 6px; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 600; }
.m-gt.lift { z-index: 3; box-shadow: 0 12px 28px rgb(0 0 0 / .45); transition: box-shadow .15s; }
.m-gt.drop { outline: 3px solid var(--accent); }
.m-gap { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); background: var(--bg); }
.m-gap::before, .m-gap::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Входящие ---------- */
.m-ibx { margin: 4px 16px 0; }
.m-sec { border-radius: 18px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.m-sec + .m-sec { margin-top: 12px; }
.m-sec-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px; font-size: 13px; color: var(--muted); }
.m-sec-h b { color: var(--text); font-weight: 600; font-size: 14px; }
.m-msgw { position: relative; overflow: hidden; }
.m-msgw .bg { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 18px; background: var(--m-pub); color: #fff; font-weight: 600; font-size: 13px; gap: 6px; }
.m-msg { position: relative; display: flex; gap: 11px; padding: 11px 14px; background: var(--panel); touch-action: pan-y; transition: transform .25s var(--ease); }
.m-msgw + .m-msgw .m-msg { border-top: 1px solid var(--line); }
.m-ava { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff; background: var(--c); }
.m-msg .w { flex: 1; min-width: 0; display: grid; gap: 3px; }
.m-msg .who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.m-msg .who b { color: var(--text); font-weight: 600; }
.m-msg .who .m-ic { width: 13px; height: 13px; }
.m-msg .tx { font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.m-msg .on-post { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.m-msg .on-post img { width: 16px; height: 20px; border-radius: 3px; object-fit: cover; }
.m-msg .acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.m-reply { display: none; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: var(--sunken); border: 1px solid var(--line-strong); font-size: 14px; line-height: 1.4; }
.m-reply.on { display: block; }
.m-reply textarea { width: 100%; min-height: 60px; resize: none; border: 0; outline: none; background: none; color: var(--text); font: 400 15px/1.45 var(--sans); padding: 0; }
.m-reply .rb { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.m-think { background: linear-gradient(90deg, var(--muted), var(--text), var(--muted)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: mShim 1.5s linear infinite; }
.m-group { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.m-stack { display: flex; }
.m-stack span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); margin-left: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--c); }
.m-stack span:first-child { margin-left: 0; }
.m-group .w { flex: 1; min-width: 0; }
.m-group b { display: block; font-size: 14.5px; font-weight: 600; }
.m-group small { display: block; color: var(--muted); font-size: 12.5px; }
.m-okmark { display: inline-flex; align-items: center; gap: 4px; color: var(--m-pub); font-size: 12.5px; font-weight: 600; }
.m-okmark .m-ic { width: 14px; height: 14px; stroke-width: 2.4; }
.m-empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.m-empty .m-ic { width: 32px; height: 32px; color: var(--m-pub); stroke-width: 2; }
.m-empty b { color: var(--text); font-size: 17px; font-weight: 600; }
.m-bub { max-width: 82%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--sunken); font-size: 14.5px; line-height: 1.35; justify-self: start; overflow-wrap: anywhere; }
.m-bub.mine { justify-self: end; border-radius: 16px 16px 4px 16px; background: var(--accent-soft); }
.m-bub small { display: block; margin-top: 2px; font-size: 11px; color: var(--faint); }
.m-chat { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; margin: 4px 0 10px; }

/* ---------- Цифры ---------- */
.m-plats { display: flex; gap: 6px; padding: 4px 16px 0; overflow-x: auto; scrollbar-width: none; }
.m-plats::-webkit-scrollbar { display: none; }
.m-view .m-plats button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--muted); flex: none; }
.m-view .m-plats button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.m-plats .m-ic { width: 14px; height: 14px; }
.m-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.m-kpi { padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 3px; min-width: 0; }
.m-kpi.w2 { grid-column: span 2; }
.m-kpi small { color: var(--muted); font-size: 12.5px; }
.m-kpi > b { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
.m-kpi .d { font-size: 12.5px; font-weight: 600; }
.m-kpi .d.up { color: var(--m-pub); }
.m-kpi .d.down { color: var(--st-error); }
.m-kpi .d.muted { color: var(--muted); font-weight: 400; }
.m-bars { display: flex; align-items: flex-end; gap: 7px; height: 110px; margin-top: 10px; }
.m-bars.thin { gap: 2px; }
.m-bars > div { flex: 1; display: grid; gap: 5px; justify-items: center; align-self: stretch; grid-template-rows: 1fr auto; cursor: pointer; }
.m-bars i { width: 100%; align-self: end; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--pf-ig) 45%, var(--sunken)); }
.m-bars.thin i { border-radius: 2px; }
.m-bars i.mx { background: var(--pf-ig); }
.m-bars i.td { background: var(--line-strong); }
.m-bars span { font-size: 11px; color: var(--faint); }
.m-bars div.sel i { outline: 2px solid var(--text); outline-offset: 2px; }
.m-bars-v { font-size: 13px; color: var(--muted); min-height: 18px; margin-top: 6px; }
.m-bars-v b { color: var(--text); }
.m-top { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
.m-top::-webkit-scrollbar { display: none; }
.m-tp { flex: none; width: 132px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; text-align: left; color: var(--text); text-decoration: none; }
.m-tp .cvw { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sunken); }
.m-tp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-tp .rk { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.m-tp .m { padding: 8px 10px; display: grid; gap: 2px; }
.m-tp .m b { font-size: 17px; font-weight: 600; }
.m-tp .m small { font-size: 11.5px; color: var(--muted); }
.m-insight { margin: 14px 16px 0; padding: 12px 14px; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 14px; line-height: 1.45; }
.m-insight b { font-weight: 600; }

/* ---------- sheets ---------- */
.m-scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s; }
.m-scrim.on { opacity: 1; pointer-events: auto; }
.m-sheet { position: fixed; z-index: 71; left: 0; right: 0; bottom: 0; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--panel); color: var(--text); border-radius: 26px 26px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateY(105%); transition: transform .38s var(--ease); scrollbar-width: none; font: 400 15px/1.4 var(--sans); }
.m-sheet.on { transform: none; }
.m-sheet.tall { min-height: 60vh; }
.m-sheet button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.m-sheet .m-btn { border: 1px solid var(--line); padding: 0 13px; }
.m-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 12px; }
.m-sheet h3 { margin: 0; font: 600 20px/1.25 var(--sans); text-wrap: balance; }
.m-sh-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.m-sh-top .m-x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); }
.m-menu { display: grid; gap: 2px; }
.m-menu-i { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; text-align: left; font-size: 15px; color: var(--text); text-decoration: none; }
.m-menu-i small { margin-left: auto; color: var(--muted); font-size: 13px; }
.m-menu-i i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); }
.m-menu-i i .m-ic { width: 18px; height: 18px; }
.m-pc-cv { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 14px -16px 0; padding: 0 16px; }
.m-pc-cv img { width: 200px; aspect-ratio: 4 / 5; height: auto; border-radius: 14px; object-fit: cover; flex: none; background: var(--sunken); }
.m-pc-meta { display: grid; gap: 10px; margin-top: 14px; }
.m-pc-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.m-pc-row > .m-ic { color: var(--muted); }
.m-pc-row.err { color: var(--st-error); }
.m-pc-row.err .m-ic { color: var(--st-error); }
.m-pc-cap { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--sunken); font-size: 14px; line-height: 1.45; max-height: 160px; overflow-y: auto; color: var(--muted); white-space: pre-line; }
.m-pc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.m-pc-stats div { padding: 10px 8px; border-radius: 12px; background: var(--sunken); display: grid; min-width: 0; }
.m-pc-stats b { font-size: 16px; font-weight: 600; }
.m-pc-stats small { font-size: 11.5px; color: var(--muted); }
.m-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.m-acts.one { grid-template-columns: 1fr; }
.m-acts .m-btn { height: 46px; border-radius: 14px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .m-view *, .m-sheet, .m-scrim { transition: none !important; animation: none !important; } }
.m-sheet .m-menu-i { padding: 10px 6px; width: 100%; }
.m-view .m-btn.sq { width: 32px; padding: 0; flex: none; }
.m-msg .acts { flex-wrap: nowrap; }
.m-group .m-grow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.m-group .m-stack { align-self: flex-start; margin-top: 2px; }
.m-tasks { display: grid; gap: 2px; margin-top: 12px; }
.m-task { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.m-task:last-child { border-bottom: 0; }
.m-task .pf .m-ic { width: 18px; height: 18px; }
.m-task .w { flex: 1; min-width: 0; display: grid; }
.m-task .w b { font-weight: 500; font-size: 15px; }
.m-task .w small { color: var(--muted); font-size: 12.5px; }
.m-group .m-ava .m-ic { width: 16px; height: 16px; }

.m-bars i { background: color-mix(in srgb, var(--bar, var(--pf-ig)) 45%, var(--sunken)); }
.m-bars i.mx { background: var(--bar, var(--pf-ig)); }
html.m4 .m-kpis[style*="--bar:var(--pf-th)"] .m-bars i { background: color-mix(in srgb, var(--text) 30%, var(--sunken)); }
.m-tp.wide { width: 220px; }
.m-tp.wide .cvw { aspect-ratio: 16 / 9; }
.m-tp .cvw .txt { position: absolute; inset: 0; padding: 10px; font-size: 11.5px; line-height: 1.3; color: var(--muted); background: linear-gradient(160deg, var(--accent-soft), var(--sunken)); overflow: hidden; }
.m-tp .one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-gridv .m-plats { padding: 4px 16px 12px; }
.m-grid.tall .m-gt { aspect-ratio: 9 / 16; }
.m-gt { display: block; color: #fff; }
.m-av.pf { background: var(--pfc); }
.m-av.pf > span .m-ic { width: 26px; height: 26px; color: var(--text); }
.m-yt { display: flex; gap: 12px; align-items: flex-start; color: var(--text); text-decoration: none; }
.m-yt .th { width: 148px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--sunken); flex: none; }
.m-yt .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-yt .w { min-width: 0; display: grid; gap: 4px; }
.m-yt b { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-yt small { color: var(--muted); font-size: 12.5px; }
.m-txt { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.m-txt img { width: 64px; aspect-ratio: 4 / 5; border-radius: 10px; object-fit: cover; flex: none; }
.m-txt .w { min-width: 0; display: grid; gap: 6px; }
.m-txt .tx { font-size: 14.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.m-txt small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.m-txt small .m-ic { width: 13px; height: 13px; }
