/* Статистика каналов IRC — компактная мобильная статистика, Air, 1.3.0. Только модуль. */
.rcch{--rcch-line:var(--line,rgba(135,145,161,.22));--rcch-accent:var(--accent,#4c89b3);--rcch-muted:var(--muted,var(--text-muted,#9096a3));--rcch-surface:var(--surface,rgba(120,127,139,.045));color:inherit;font:inherit;min-width:0;max-width:100%;display:grid;gap:12px;margin:0 0 24px}
.rcch *, .rcch *::before,.rcch *::after{box-sizing:border-box}
/* Только внутренняя страница канала — главная /ircstat/ сохраняет обычный сайдбар. */
.layout:has(.rcch--channel),body:has(.rcch--channel) .container.layout{grid-template-columns:minmax(0,1fr)!important}
.layout:has(.rcch--channel) > .sidebar,body:has(.rcch--channel) .layout > .sidebar{display:none!important}
.layout:has(.rcch--channel) > .layout__main{width:100%;min-width:0}
.rcch-card{min-width:0;background:var(--card-bg,var(--rcch-surface));border:1px solid var(--rcch-line);border-radius:7px;padding:15px}
.rcch-hero{display:flex;align-items:center;gap:13px;padding:16px 18px;border:1px solid var(--rcch-line);border-radius:7px;background:var(--card-bg,var(--rcch-surface));min-width:0}
.rcch-hero-icon,.rcch-channel-icon{display:grid;place-items:center;flex:0 0 auto;color:var(--rcch-accent);background:color-mix(in srgb,var(--rcch-accent) 11%,transparent);border-radius:7px}
.rcch-hero-icon{width:43px;height:43px;font-size:20px}
.rcch-eyebrow{display:block;font-size:.71em;font-weight:700;letter-spacing:.055em;color:var(--rcch-accent);margin-bottom:3px}
.rcch-hero h1{font-family:inherit;font-size:1.32em;margin:0 0 5px;font-weight:700;line-height:1.25;color:inherit}
.rcch-hero p{margin:0;color:var(--rcch-muted);line-height:1.4;font-size:.89em}
.rcch-section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:5px}
.rcch-section-heading h2{margin:0;font:inherit;font-size:1.15em;font-weight:700}.rcch-section-heading>span{color:var(--rcch-muted);font-size:.87em}
.rcch-channels{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:10px}
.rcch-channel{display:flex;align-items:center;gap:12px;color:inherit!important;text-decoration:none!important;transition:border-color .15s ease,background .15s ease}
.rcch-channel:hover{border-color:var(--rcch-accent);background:color-mix(in srgb,var(--rcch-accent) 6%,transparent);color:inherit!important}
.rcch-channel-icon{width:39px;height:39px;font-size:17px}.rcch-channel-body{display:grid;gap:3px;min-width:0;flex:1}
.rcch-channel-body strong{font-size:1.01em;color:inherit}.rcch-channel-body>span{color:var(--rcch-muted);font-size:.89em;line-height:1.4}
.rcch-channel-body small{color:var(--rcch-muted);font-size:.78em}.rcch-channel-body small .fa{margin-right:4px}.rcch-channel-arrow{color:var(--rcch-accent);font-size:19px}
.rcch-link-back{color:var(--rcch-accent);font-size:.87em;font-weight:600;text-decoration:none}.rcch-link-back:hover{text-decoration:underline}.rcch-link-back .fa{margin-right:6px}
.rcch-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.rcch-stat{display:grid;gap:4px;padding:11px 13px}.rcch-stat>span{color:var(--rcch-muted);font-size:.79em}.rcch-stat .fa{color:var(--rcch-accent);margin-right:4px}.rcch-stat strong{font-size:1.36em;line-height:1.2;font-weight:700}
.rcch-note{display:flex;flex-wrap:wrap;align-items:center;gap:3px 7px;color:var(--rcch-muted);font-size:.79em}.rcch-note .fa{color:var(--rcch-accent)}
.rcch-alert{padding:13px;color:#b37542;background:rgba(216,136,70,.07);border:1px solid rgba(216,136,70,.28);border-radius:7px}
/* Содержимое источника Eggdrop: типографика сайта, но значительно компактнее. */
.rcch-report{padding:13px 15px;overflow:hidden;font-family:inherit;font-size:.88em;line-height:1.46;overflow-wrap:anywhere}
.rcch-report h1,.rcch-report h2,.rcch-report h3,.rcch-report h4,.rcch-report h5{font-family:inherit;color:inherit;font-weight:700;letter-spacing:normal;line-height:1.3;margin:14px 0 8px}
.rcch-report h1{font-size:1.19em}.rcch-report h2{font-size:1.15em}.rcch-report h3{font-size:1.09em}.rcch-report h4,.rcch-report h5{font-size:1.04em}
.rcch-report h2:not(:first-child),.rcch-report h3:not(:first-child){border-top:1px solid var(--rcch-line);padding-top:13px}
.rcch-report p{margin:6px 0;line-height:1.48}.rcch-report a{color:var(--rcch-accent);overflow-wrap:anywhere}
.rcch-report .rcch-table-scroll{width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;margin:7px 0 13px;border:1px solid var(--rcch-line);border-radius:6px}
.rcch-report table{border-collapse:collapse;border-spacing:0;font:inherit;color:inherit;width:100%;max-width:100%;min-width:0!important;table-layout:auto;background:transparent!important}
.rcch-report td,.rcch-report th{color:inherit!important;background:transparent!important;height:auto!important;min-height:0!important;min-width:0!important;padding:5px 7px;border-bottom:1px solid var(--rcch-line);vertical-align:middle;text-align:left;white-space:normal;overflow-wrap:break-word;word-break:normal}
.rcch-report th{font-weight:700;background:color-mix(in srgb,var(--rcch-accent) 8%,transparent)!important}
.rcch-report tr:nth-child(2n)>td{background:rgba(120,135,160,.035)!important}
.rcch-report img{max-width:100%;height:auto;object-fit:contain;vertical-align:middle;border-radius:3px}
.rcch-report blockquote{border-left:3px solid var(--rcch-accent);margin:7px 0;padding:6px 9px;background:rgba(125,140,161,.06)}
.rcch-report pre{white-space:pre-wrap;overflow-wrap:anywhere;background:rgba(125,140,161,.06);padding:9px;border-radius:5px}
.rcch-report font,.rcch-report span,.rcch-report center{font-family:inherit}.rcch-report center{text-align:center}
/* Пересобранная активность за 31 день: вместо 31 широкой ячейки — компактная диаграмма. */
.rcch-activity-chart{width:100%;max-width:100%;padding:10px 9px 5px;background:color-mix(in srgb,var(--rcch-accent) 3%,transparent);border:1px solid var(--rcch-line);border-radius:7px;margin:9px 0 14px}
.rcch-chart-bars{display:grid;grid-template-columns:repeat(var(--rcch-count),minmax(0,1fr));gap:3px;min-width:0;height:172px;align-items:end}
.rcch-chart-bar{min-width:0;height:100%;display:flex;flex-direction:column;align-items:center;gap:2px}
.rcch-chart-value{font-size:clamp(8px,.8vw,11px);line-height:1.1;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--rcch-muted)}
.rcch-chart-track{flex:1;min-height:25px;width:100%;display:flex;align-items:end;overflow:hidden}
.rcch-chart-fill{width:100%;min-height:2px;display:block;border-radius:3px 3px 0 0;background:var(--rcch-accent);opacity:.8;transition:opacity .15s}
.rcch-chart-bar:hover .rcch-chart-fill{opacity:1}
.rcch-chart-date{font-size:clamp(7px,.73vw,10px);line-height:1.2;text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--rcch-muted);overflow:hidden;max-width:100%}
.rcch-chart-caption{margin:7px 0 0!important;font-size:.8em;color:var(--rcch-muted);text-align:right}
.rcch-empty{text-align:center;padding:26px;color:var(--rcch-muted)}
@media(max-width:760px){.rcch{gap:10px}.rcch-hero{padding:13px;gap:10px}.rcch-hero-icon{width:35px;height:35px;font-size:17px}.rcch-card{padding:12px}.rcch-stat-grid{gap:6px}.rcch-stat{padding:9px}.rcch-stat strong{font-size:1.2em}.rcch-report{padding:10px;font-size:.86em}.rcch-report td,.rcch-report th{padding:4px 6px}.rcch-chart-bars{height:135px;gap:2px}.rcch-chart-date:not(.rcch-chart-date-show),.rcch-chart-value:not(.rcch-chart-value-show){visibility:hidden}.rcch-chart-value{font-size:8px}.rcch-channel{gap:9px}.rcch-channel-icon{width:35px;height:35px}}
@media(max-width:420px){.rcch-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.rcch-stat:last-child:nth-child(odd){grid-column:span 2}.rcch-hero h1{font-size:1.17em}.rcch-chart-bars{gap:1px;height:120px}.rcch-chart-date{font-size:7px}.rcch-chart-value{font-size:7px}}

/* 1.2: таблицы отчётов Eggdrop не сдавливаются по буквам. Если таблица
   не распознана как набор карточек, она прокручивается в своём контейнере. */
.rcch-report .rcch-table-scroll{min-width:0;max-width:100%;}
.rcch-report .rcch-table-scroll table{width:max-content;min-width:100%!important;max-width:none!important;table-layout:auto;}
.rcch-report .rcch-table-scroll :is(td,th){word-break:normal;overflow-wrap:break-word;}
.rcch-report .rcch-table-scroll td img{max-width:74px;max-height:74px;width:auto;height:auto;}
@media(max-width:760px){
  .rcch{gap:10px;min-width:0;max-width:100%}
  .rcch-report{font-size:.97em;padding:9px;overflow:hidden}
  .rcch-report .rcch-table-scroll:not(.rcch-table-scroll--cards){overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;}
  .rcch-report .rcch-table-scroll:not(.rcch-table-scroll--cards) table{width:max-content;min-width:580px!important;max-width:none!important;}
  .rcch-report .rcch-table-scroll--cards{border:0;overflow:visible;margin:8px 0 12px;}
  .rcch-report .rcch-table-scroll--cards table,
  .rcch-report .rcch-table-scroll--cards :is(tbody,thead,tfoot){display:block;width:100%;min-width:0!important;max-width:100%!important;}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-head{display:none!important;}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px;
    position:relative;padding:12px 13px;margin:0 0 9px;border:1px solid var(--rcch-line);
    border-radius:8px;background:var(--card-bg,var(--rcch-surface));min-width:0;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item:nth-child(even)>td{background:transparent!important}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th){
    display:block;border:0!important;padding:0!important;min-width:0!important;min-height:0;
    background:transparent!important;overflow-wrap:break-word!important;word-break:normal!important;
    white-space:normal;font:inherit;line-height:1.35;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th)::before{
    content:attr(data-rcch-label);display:block;margin:0 0 3px;color:var(--rcch-muted);
    font-size:.78em;line-height:1.3;font-weight:500;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th)[data-rcch-label="№"]{
    position:absolute;top:9px;right:12px;color:var(--rcch-muted);font-size:.83em;text-align:right;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-label="№"]::before{content:"№ ";display:inline;}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th)[data-rcch-label*="Ник"],
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th)[data-rcch-label*="Пользоват"]{
    grid-column:1 / -1;padding-right:40px!important;font-weight:700;color:inherit;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th)[data-rcch-label*="фраз"],
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th)[data-rcch-label*="Фраз"]{
    grid-column:1 / -1;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item img{max-width:65px;max-height:65px;object-fit:cover;border-radius:6px;}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item a{word-break:normal;overflow-wrap:break-word;}
  .rcch-report .rcch-table-scroll--cards tr:not(.rcch-table-head):not(.rcch-table-item){display:block;padding:7px 10px;}
  .rcch-report .rcch-table-scroll--cards tr:not(.rcch-table-head):not(.rcch-table-item)>td{display:block;}
}
@media(max-width:380px){
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item{gap:7px 9px;padding:10px}
}

/* 1.3: максимально плотная таблица-карточка на телефоне.
 * Настоящие изображения сохраняются на компьютере, на телефоне — только ссылка. */
.rcch-report .rcch-photo-mobile{display:none}
.rcch-report .rcch-photo-desktop{display:contents}
@media(max-width:760px){
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    column-gap:12px;row-gap:3px;padding:8px 10px;
    margin:0 0 5px;border-radius:6px;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th){
    font-size:.87em;line-height:1.24;min-width:0!important;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th)::before{
    display:inline;margin:0 4px 0 0;font-size:.85em;
    color:var(--rcch-muted);font-weight:400;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="rank"]{
    position:absolute;top:9px;left:10px;right:auto;
    padding:0!important;font-size:.79em!important;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="rank"]::before{
    content:"№ ";display:inline;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="nick"]{
    grid-column:1/-1;grid-row:1;min-height:21px!important;
    padding:1px 100px 2px 27px!important;font-weight:700;font-size:1em;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="nick"]::before{content:none!important}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="phrase"]{
    grid-column:1/-1;display:block;padding-top:3px!important;
    margin-top:2px;border-top:1px solid var(--rcch-line)!important;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="phrase"]::before{
    content:"Фраза: ";
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="photo"]{
    grid-column:2;grid-row:1;justify-self:end;align-self:start;
    position:relative;z-index:1;max-width:104px;text-align:right;
    padding:1px 0!important;font-size:.85em;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="photo"]::before{display:none!important}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item [data-rcch-role="photo"] img,
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item .rcch-photo-desktop{display:none!important}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item .rcch-photo-mobile{
    display:inline!important;font-size:inherit;white-space:nowrap;
    color:var(--rcch-accent)!important;text-decoration:none;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item .rcch-photo-mobile:hover{text-decoration:underline}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th):not([data-rcch-role]){
    display:flex;align-items:baseline;justify-content:flex-start;gap:3px;white-space:normal;
  }
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>:is(td,th):not([data-rcch-role])::before{
    flex:0 1 auto;min-width:0;
  }
}
@media(max-width:380px){
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item{padding:7px 9px;gap:3px 7px}
  .rcch-report .rcch-table-scroll--cards tr.rcch-table-item>[data-rcch-role="rank"]{left:9px;top:8px}
}

/* 1.4 — единый компактный мобильный список для всех пользователей.
   Генерируется на сервере из всех строк источника, даже с пропущенными TD.
   На ПК остаётся исходная таблица Eggdrop. */
.rcch-active-users-mobile{display:none}
.rcch-report .rcch-report-heading{font:inherit;font-size:1.05em;font-weight:700;line-height:1.35;margin:12px 0 6px!important;padding:4px 0 6px;border-bottom:1px solid var(--rcch-line);color:inherit}
@media(max-width:760px){
  .rcch-report .rcch-active-users-desktop{display:none!important}
  .rcch-report .rcch-active-users-mobile{display:block!important;margin:4px 0 10px;min-width:0}
  .rcch-report .rcch-mobile-user{padding:8px 4px 9px;border-bottom:1px solid var(--rcch-line);min-width:0;margin:0;background:transparent;border-radius:0;line-height:1.25;font-family:inherit}
  .rcch-report .rcch-mobile-user:first-child{padding-top:4px}
  .rcch-report .rcch-mobile-user:last-child{border-bottom:0}
  .rcch-report .rcch-mobile-user__top{display:flex;align-items:center;gap:7px;min-width:0;margin:0 0 5px}
  .rcch-report .rcch-mobile-user__rank{display:inline-grid;place-items:center;flex:0 0 auto;min-width:21px;height:21px;border-radius:4px;background:color-mix(in srgb,var(--rcch-accent) 12%,transparent);font-weight:600;color:var(--rcch-accent);font-size:.81em}
  .rcch-report .rcch-mobile-user__nick{font-size:.99em;line-height:1.23;font-weight:700;min-width:0;overflow-wrap:anywhere}
  .rcch-report .rcch-mobile-user__photo{margin-left:auto;white-space:nowrap;flex:0 0 auto;color:var(--rcch-accent)!important;font-size:.85em;text-decoration:none}
  .rcch-report .rcch-mobile-user__photo:hover{text-decoration:underline}
  .rcch-report .rcch-mobile-user__metrics{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:6px;row-gap:3px;min-width:0;color:var(--rcch-muted);font-size:.82em;font-variant-numeric:tabular-nums;line-height:1.3}
  .rcch-report .rcch-mobile-user__metrics span{display:inline;min-width:0;margin:0;padding:0}
  .rcch-report .rcch-mobile-user__metrics span:not(:last-child)::after{content:'·';margin-left:6px;color:var(--rcch-muted)}
  .rcch-report .rcch-mobile-user__metrics b{font-weight:650;color:inherit}
  .rcch-report .rcch-mobile-user__quote{font-size:.82em;color:var(--rcch-muted);line-height:1.35;margin:3px 0 0;overflow-wrap:anywhere}
  .rcch-report .rcch-mobile-user__quote::before{content:'Фраза: ';color:var(--rcch-muted)}
  .rcch-report .rcch-mobile-user__quote:empty{display:none}
  .rcch-report{overflow:hidden}
}
@media(max-width:390px){
  .rcch-report .rcch-mobile-user{padding:7px 1px 8px}
  .rcch-report .rcch-mobile-user__top{gap:5px}
  .rcch-report .rcch-mobile-user__metrics{font-size:.8em;column-gap:5px}
  .rcch-report .rcch-mobile-user__metrics span:not(:last-child)::after{margin-left:5px}
}

/* 1.9: реальные фотографии без ссылки, инициалы — когда снимка нет. */
.rcch-report .rcch-user-avatar{width:27px;height:27px;min-width:27px;min-height:27px;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;vertical-align:middle;border-radius:50%;background:color-mix(in srgb,var(--rcch-accent) 15%,transparent);color:var(--rcch-accent);font-size:10px;font-weight:750;line-height:1;letter-spacing:.015em;white-space:nowrap;flex:none}
.rcch-report .rcch-user-avatar img{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;display:block;object-fit:cover;border-radius:50%;}
.rcch-report .rcch-table-scroll .rcch-user-avatar{margin-right:6px}
.rcch-report .rcch-mobile-user__top .rcch-user-avatar{margin:0;width:24px;height:24px;min-width:24px;min-height:24px}
@media(max-width:760px){
 .rcch-report .rcch-mobile-user__top{margin-bottom:4px}
 .rcch-report .rcch-mobile-user__nick{overflow-wrap:anywhere}
 /* Фото и текст не должны находиться в виде ссылки даже при старых стилях. */
 .rcch-report .rcch-photo-mobile{display:none!important}
}

/* 1.9.1: аватар находится только в колонке «Фото юзера». */
.rcch-report td[data-rcch-role="photo"] .rcch-user-avatar{margin-right:0}
@media(max-width:760px){
 .rcch-report .rcch-mobile-user__avatar-field{display:flex;align-items:center;gap:8px;margin-top:5px;font-size:.8em;color:var(--rcch-muted)}
 .rcch-report .rcch-mobile-user__avatar-field .rcch-user-avatar{width:24px;height:24px;min-width:24px;min-height:24px;margin:0}
}
