/* Структура профиля: отдельные зоны вместо случайного переноса общего flex-ряда.
   Цвета и эффекты остаются в теме; здесь только геометрия и читаемость. */
.pf{--pf-space:24px;gap:20px;width:100%;max-width:1440px;margin-inline:auto}
.pf .pf-cover{height:clamp(160px,20vw,240px)}
.pf .pf-cover .p-switch,.pf .pf-cover .p-banner-edit{max-width:calc(50% - 22px);min-height:36px;white-space:normal;line-height:1.35}
.pf .pf-cover .p-switch svg,.pf .pf-cover .p-banner-edit svg{flex-shrink:0}
.pf .pf-head{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  grid-template-areas:"avatar identity actions" ". details details";
  align-items:end;gap:16px 24px;margin-top:-52px;
  padding:0 var(--pf-space) 24px;
}
.pf .pf-ava{grid-area:avatar;align-self:start}
.pf .pf-id{grid-area:identity;min-width:0;padding:54px 0 0;gap:12px}
.pf .pf-name-row{gap:8px 10px;min-width:0}
.pf .pf-name{font-size:clamp(24px,2.4vw,32px);line-height:1.25;max-width:100%;overflow-wrap:anywhere}
.pf .pf-sub{gap:8px;min-width:0}
.pf .pf-sub .p-at{max-width:100%;min-width:0}
.pf .pf-sub .p-at span{overflow:hidden;text-overflow:ellipsis}
.pf .pf-pres{line-height:1.5}
.pf .pf-details{grid-area:details;display:grid;gap:12px;min-width:0}
.pf .pf-bio-h{margin:0;max-width:72ch;line-height:1.65}
.pf .pf-bio-h .text p{margin:0}
.pf .pf-metarow{gap:10px 16px;min-width:0}
.pf .pf-metarow .soc-chips{flex-wrap:wrap;min-width:0}
.pf .pf-since{line-height:1.5;flex-wrap:wrap}
.pf .pf-addbio{min-height:28px;line-height:1.5}
.pf .pf-actions{grid-area:actions;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0;max-width:360px;min-width:0}
.pf .pf-actions>.btn{min-height:42px;justify-content:center;white-space:normal;text-align:center;line-height:1.35}
.pf .pf-actions:has(.pf-acts){width:360px;max-width:100%}
.pf .pf-acts{max-width:none;gap:8px}
.pf .pf-act{min-height:64px;border-radius:12px}
.pf .pf-hero .pf-stats{margin:0 var(--pf-space) 24px;padding:8px 0;border-radius:14px}
.pf .pf-hero .pf-stat{padding:10px 8px;gap:6px}
.pf .pf-hero .pf-stat span{line-height:1.4;letter-spacing:normal;white-space:normal;overflow-wrap:normal}
.pf .pf-grid{grid-template-columns:minmax(240px,280px) minmax(0,1fr);gap:20px}
.pf .pf-grid.solo{grid-template-columns:minmax(0,1fr)}
.pf .pf-side,.pf .pf-main{gap:16px}
.pf .pf-side{position:static}
.pf .pf-card{padding:18px;border-radius:16px;gap:14px}
.pf .pf-tabs{position:static;min-height:46px;align-items:center}
.pf .pf-tabs a{display:flex;align-items:center;justify-content:center;min-height:36px;line-height:1.4}
.pf .pf-h{line-height:1.5;min-width:0;flex-wrap:wrap}
.pf .pf-h>svg{flex-shrink:0}
.pf .pf-ach{flex-wrap:wrap;overflow:visible;margin:0;padding:0;gap:8px}
.pf .pf-badge{max-width:100%;white-space:normal}
.pf .pf-stories{padding:2px 0 4px}

@media(max-width:1100px){
  .pf .pf-head{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"avatar identity" ". details" ". actions"}
  .pf .pf-actions{justify-content:flex-start;max-width:100%;width:100%}
  .pf .pf-actions:has(.pf-acts){width:100%;max-width:440px}
  .pf .pf-grid{grid-template-columns:240px minmax(0,1fr)}
}
@media(max-width:800px){
  .pf .pf-grid{grid-template-columns:minmax(0,1fr)}
  .pf .pf-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
}
@media(max-width:560px){
  .pf{--pf-space:16px;gap:16px}
  .pf .pf-head{grid-template-columns:minmax(0,1fr);grid-template-areas:"avatar" "identity" "details" "actions";gap:16px;margin-top:-40px;padding-bottom:20px}
  .pf .pf-id{padding:0;gap:10px}
  .pf .pf-name{font-size:26px}
  .pf .pf-cover .p-switch,.pf .pf-cover .p-banner-edit{top:12px}
  .pf .pf-actions{display:flex;flex-wrap:wrap;gap:8px}
  .pf .pf-actions>.btn:not(.icon-only){flex:1 1 120px;min-width:0}
  .pf .pf-actions:has(.pf-acts){max-width:none}
  .pf .pf-act{min-height:60px;font-size:11px;padding:8px 2px}
  .pf .pf-hero .pf-stats{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-flow:row;margin:0 var(--pf-space) 16px;padding:8px 0!important;gap:0!important}
  .pf .pf-hero .pf-stat{min-width:0!important;padding:8px 3px!important;border-radius:0!important}
  .pf .pf-hero .pf-stat span{min-height:2.8em;font-size:10px!important;letter-spacing:normal!important;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
  .pf.pc-market .pf-hero .pf-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pf.pc-market .pf-hero .pf-stat:nth-child(3){border-inline-start:0!important}
  .pf.pc-market .pf-hero .pf-stat:nth-child(n+3){border-top:1px solid var(--line)!important}
  .pf .pf-grid,.pf .pf-side,.pf .pf-main{gap:14px}
  .pf .pf-side{grid-template-columns:minmax(0,1fr)}
  .pf .pf-card{padding:16px}
  .pf .pf-tabs{width:100%;border-radius:12px}
  .pf .pf-tabs a{flex:1 0 auto;padding-inline:12px}
}
@media(max-width:400px){
  .pf.pc-forum .pf-hero .pf-stats{grid-template-columns:repeat(6,minmax(0,1fr))}
  .pf.pc-forum .pf-hero .pf-stat{grid-column:span 2}
  .pf.pc-forum .pf-hero .pf-stat:nth-child(n+4){grid-column:span 3;border-top:1px solid var(--line)!important}
  .pf.pc-forum .pf-hero .pf-stat:nth-child(4){border-inline-start:0!important}
}

/* Рабочие разделы: предсказуемые колонки, ровные показатели и доступное меню. */
.a-layout,.set-layout{gap:24px}
.a-layout>*,.set-layout>*{min-width:0}
.set-layout{max-width:1440px;margin-inline:auto}
.a-layout .page-root>.stack{gap:24px}
.a-layout .tiles{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));grid-auto-rows:1fr;gap:16px;align-items:stretch}
.a-layout .tiles.stagger{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))}
.a-layout .tile{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;min-width:0;padding:20px;border-radius:14px;animation:none;transform:none}
.a-layout .tile .k{min-height:2.8em;line-height:1.4;font-size:13px}
.a-layout .tile .v{margin-top:8px;line-height:1.25;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.a-layout .tile .d{margin-top:6px;line-height:1.5}
.a-layout .tile.rv{opacity:1;animation:none;transform:none}
.a-layout .toolbar{gap:12px;align-items:center}
.a-layout .toolbar>.inp{max-width:100%;min-height:40px}
.a-layout .toolbar>.btn{min-height:40px}
.a-layout .tscroll{max-width:100%;overscroll-behavior-inline:contain}
.a-layout .t th,.a-layout .t td{padding:14px 16px;vertical-align:middle}
.set-body .panel{border-radius:16px}
.set-body .grid2{gap:20px;align-items:start}
@media(min-width:861px){
  .set-nav{top:calc(var(--top-h,106px) + 16px);max-height:calc(100dvh - var(--top-h,106px) - 32px);overflow-y:auto;scrollbar-width:thin}
}
@media(min-width:761px){
  .a-layout .a-side{padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--surface);gap:20px}
  .a-layout .a-side a{min-height:40px}
}
@media(max-width:560px){
  .a-layout,.set-layout{gap:16px}
  .a-layout .page-root>.stack{gap:20px}
  .a-layout .tiles,.a-layout .tiles.stagger{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .a-layout .tile{padding:14px;min-height:116px}
  .a-layout .tile .v{font-size:20px}
  .a-layout .toolbar>.inp{flex:1 1 140px;min-width:0}
  .set-body .grid2{gap:16px}
}

/* Channel information: neutral surfaces and compact, circular actions. */
.chp-wrap .chp{background:#101415;color:#eef2f1}
.chp-wrap .chp-in{gap:18px;padding:16px 18px calc(24px + env(safe-area-inset-bottom))}
.chp-wrap .chp-hero.gava{height:132px;border-radius:16px;border:0;box-shadow:none}
.chp-wrap .chp-id{padding:0 8px 4px;gap:10px}
.chp-wrap .chp-ava{margin-top:-34px}
.chp-wrap .chp-ava .ch-ava,.chp-wrap .chp-ava .gava{width:72px!important;height:72px!important;box-shadow:0 0 0 4px #101415!important}
.chp-wrap .chp-id h2{font-size:23px;font-weight:600;letter-spacing:-.025em}
.chp-wrap .chp-pill{border:0;background:none;color:#99a5a2;padding:2px 4px;font-size:12px}
.chp-wrap .chp-pill.acc{color:#99a5a2;background:none;border:0}
.chp-wrap .chp-pill.link{color:#65c9aa}
.chp-wrap .chp-acts{gap:8px;padding:4px 0 10px}
.chp-wrap .chp-act,.chp-wrap .chp-act.on{border:0;background:none;box-shadow:none;border-radius:12px;padding:4px 0;gap:9px;min-height:76px}
.chp-wrap .chp-act:hover{background:#ffffff05}
.chp-wrap .chp-act-i,.chp-wrap .chp-act.on .chp-act-i{width:44px;height:44px;border-radius:50%;background:#252e2d;color:#d9e2df}
.chp-wrap .chp-act.on .chp-act-i{color:#77d3b5;background:#263d35}
.chp-wrap .chp-act span:last-child{font-size:11px;font-weight:400;color:#a4afac}
.chp-wrap .chp-sec{border:0;border-radius:16px;background:#192020;padding:8px}
.chp-wrap .chp-lbl{font-size:10px;font-weight:500;letter-spacing:.09em;color:#8f9c98}
.chp-wrap .chp-about{padding:10px 10px 14px;font-size:14px;line-height:1.6}
.chp-wrap .chp-row{padding:12px 10px;gap:12px}
.chp-wrap .chp-ico{background:none;color:#98aaa4;width:26px;height:30px;border-radius:0}
.chp-wrap .chp-rt b{font-size:13px;font-weight:500;overflow-wrap:anywhere}
.chp-wrap .chp-rt small{font-size:11px;line-height:1.5}
.chp-wrap .chp-meta{font-size:10px;line-height:1.7;padding:8px 10px;color:#8a9792}
.chp-wrap .chp-tiles{gap:0;border-block:1px solid #ffffff0c;padding:12px 0}
.chp-wrap .chp-tile{border:0;border-radius:0;background:none;padding:8px 2px;gap:4px}
.chp-wrap .chp-tile+.chp-tile{border-inline-start:1px solid #ffffff0c}
.chp-wrap .chp-tile svg{color:#97aba2;width:16px;height:16px}
.chp-wrap .chp-tile b{font-size:17px;font-weight:500}
.chp-wrap .chp-tile small{font-size:10px}
.chp-wrap .chp-tile:hover{background:#ffffff04}
.chp-wrap .chp-ib{background:#101415b3;box-shadow:none;border:0;border-radius:50%}
/* Profile effects decorate the cover; identity and controls remain on an opaque surface. */
.pf .pf-hero{background:#101715}
.pf .pf-hero>.pfx{inset:0 0 auto;width:100%;height:clamp(160px,20vw,240px);max-height:240px;z-index:2;opacity:.38;object-fit:cover;pointer-events:none;border-radius:0;-webkit-mask-image:linear-gradient(#000 30%,transparent 100%);mask-image:linear-gradient(#000 30%,transparent 100%)}
.pf .pf-head,.pf .pf-stats{position:relative;z-index:3}
.pf .pf-hero .pf-stats{background:#141d19}
.pf .pf-cover .p-switch,.pf .pf-cover .p-banner-edit{z-index:4}
@media(max-width:560px){.chp-wrap .chp-in{padding:12px 12px calc(24px + env(safe-area-inset-bottom))}.chp-wrap .chp-hero.gava{height:116px}.chp-wrap .chp-id h2{font-size:22px}.chp-wrap .chp-act-i,.chp-wrap .chp-act.on .chp-act-i{width:42px;height:42px}}

.chp-wrap .chp-id{margin-top:-28px}.chp-wrap .chp-ava{margin-top:0;background:#101415;box-shadow:none;padding:3px;border-radius:24px}
.chp-wrap .chp-hero.gava{min-height:0}

/* Channel management opens one focused section at a time. */
.cs-dialog{background:#111718!important;border:1px solid #ffffff10!important;border-radius:24px!important;box-shadow:0 24px 80px #0006!important;max-width:480px!important;gap:18px!important;padding:22px!important;max-height:calc(100dvh - 32px)!important;overflow:auto;overscroll-behavior:contain}
.cs-dialog h2{font-size:20px;letter-spacing:-.02em}.cs-dialog .cs-look{background:none;border:0;padding:0}.cs-dialog .cs-menu{display:flex;flex-direction:column;gap:4px}.cs-menu>button{appearance:none;width:100%;display:flex;align-items:center;gap:12px;padding:15px 10px;text-align:start;color:#edf1ef;background:none;border:0;border-radius:12px;min-height:54px;cursor:pointer;font:inherit}.cs-menu>button:hover{background:#ffffff06}.cs-menu>button>span:first-child{color:#a4b5ae;flex-shrink:0}.cs-menu>button>span:nth-child(2){display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}.cs-menu b{font-size:14px;font-weight:500;overflow-wrap:anywhere}.cs-menu small{font-size:11px;color:#899a92}.cs-menu>button>svg:last-child{width:16px;height:16px;color:#81928b;flex-shrink:0;margin-inline-start:auto}.cs-back{display:block;appearance:none;border:0;background:none;color:#92b7a8;padding:8px 0;text-align:start;font:inherit;font-size:12px;cursor:pointer}.cs-dialog .cs-perms{display:flex;flex-direction:column;gap:0;margin-block:12px}.cs-dialog .cs-perms .check{padding:13px 0;border-bottom:1px solid #ffffff09;min-height:44px}.cs-dialog .cs-manager{display:flex;flex-direction:column;gap:14px}.cs-dialog .cs-menu .ava{flex-shrink:0}.cs-dialog .cs-menu input{min-width:0}.cs-dialog .btn{box-shadow:none}.cs-dialog .cs-look-h{font-size:14px}.cs-dialog .cs-look .hint{font-size:11px}.cs-dialog [data-admin-search]{min-height:44px}.cs-dialog button:focus-visible{outline:2px solid #6dd5b2;outline-offset:3px}
@media(max-width:560px){.cs-dialog{width:calc(100vw - 24px)!important;margin:auto!important;padding:18px!important;border-radius:22px!important}.cs-dialog .row{flex-wrap:wrap}.cs-dialog .cs-menu>button{padding-inline:4px}.cs-dialog .cs-look .row{gap:10px}}

/* Stable composer above wallpaper, message dates and content. */
.mc>.ch-compose,.mc.has-bg>.ch-compose{position:relative;z-index:8;isolation:isolate;flex-shrink:0;display:flex;align-items:flex-end;gap:6px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:#101718!important;border-top:1px solid #ffffff09;box-shadow:none}
.mc.has-bg>.ch-datepill{position:absolute!important;top:70px;z-index:4;pointer-events:none}
.mc .ch-msgs{min-height:0;overflow-x:hidden}
.ch-compose .cc-field{min-width:0;align-items:flex-end;background:#202927;border:1px solid #ffffff0b;border-radius:23px;padding:3px 4px 3px 14px;box-shadow:none;overflow:hidden}
.ch-compose .cc-field:focus-within{border-color:#658f7e;box-shadow:none}
.ch-compose .cc-field textarea{min-width:0;width:100%;min-height:38px;max-height:140px;font-size:16px;line-height:22px;padding:8px 0;overflow-y:auto;overscroll-behavior:contain;color:#edf2ef}
.ch-compose .cc-field textarea::placeholder{color:#82928a}
.mc .ch-compose .cc-btn,.mc .ch-compose .cc-mic,.mc .ch-compose .cc-send,.mc .ch-compose .cc-emo{width:44px;height:44px;min-width:44px;min-height:44px;border:0;border-radius:50%;box-shadow:none;flex-shrink:0;color:#acbcb3;background:none;margin:0;transform:none}
.mc .ch-compose .cc-attach{border:0;background:none}
.mc .ch-compose .cc-mic{background:#26372f;color:#d4e7dc}
.mc .ch-compose.ready .cc-send,.mc .ch-compose.editing .cc-send{background:#64cfa3;color:#0b2418;box-shadow:none}
.mc .ch-compose .cc-emo{width:38px;min-width:38px;color:#a1b4a8}
.ch-compose svg{width:21px;height:21px}
.ch-compose.recording .cc-plus{display:none}
.mc .ch-compose .cc-mic.rec{background:#64cfa3;color:#0b2418;animation:none}
.ch-compose .cc-rec{height:44px;border-radius:22px;background:#202927;border:1px solid #d7797930;gap:6px}
.ch-compose .cc-rec-x{color:#e39191!important}
.ch-compose .cc-rec-hint{font-size:11px;white-space:nowrap}
.ch-compose button:focus-visible,.ch-compose .cc-attach:focus-visible{outline:2px solid #7edbb0;outline-offset:2px}
.mc>.emo-panel{bottom:calc(var(--composer-h,70px) + 8px);max-height:min(360px,55dvh);z-index:20;background:#141d19;border:1px solid #ffffff14;box-shadow:0 12px 35px #0005;border-radius:18px}
body.in-chat.kb-open .mc>.ch-compose{padding-bottom:8px}
@media(max-width:380px){.mc>.ch-compose,.mc.has-bg>.ch-compose{padding-inline:6px;gap:2px}.mc .ch-compose .cc-field{padding-inline-start:10px}.mc .ch-compose .cc-emo{width:32px;min-width:32px}.ch-compose .cc-rec-hint{display:none}}
