/* =====================================
   HARD MOBILE MODE / RUSFF
   ===================================== */

.mobile,
.mobile body,
.mobile #pun_wrap,
.mobile #pun,
.mobile #pun-index,
.mobile #pun-main,
.mobile .section,
.mobile .main,
.mobile .container {
  width:100%;
  max-width:100vw;
  min-width:0;
  box-sizing:border-box;
  padding: 0;
}

.mobile body{
  overflow-x:hidden;
}

.mobile .pp_modalopen {  display:none;}

/* ===== контейнер форума ===== */

.mobile #pun_wrap{
  width:100vw;
  max-width:100vw;
  overflow:hidden;
}

.mobile #pun {
    margin: 0px auto;}

.mobile .punbb {
    padding: 0;
    background: rgb(var(--c_lightgray_l));
    border-radius: 0px;
    outline: none;
}

/* ===== убиваем таблицы  ===== */

.mobile table,
.mobile tbody,
.mobile thead,
.mobile tr,
.mobile td,
.mobile th{
  display:block;
  width:100vw;
  min-width:0;
}


/* ===== хлебные крошки и лишние разделители ===== */

.mobile #pun-crumbs1,
.mobile #pun-break1,
.mobile #pun-break2{}


/* =====================================
   MOBILE APP MODE (HEADER + CHAT LIST)
===================================== */

/* ----- HEADER ----- */

/*.mobile #pun-title,
.mobile #pun-navlinks,
.mobile #pun-ulinks,*/
.mobile #pun-status{
  display:none !important;
}

.mobile .punbb:not(.punbb-admin) #pun-navlinks {
    margin-bottom: 10px;
    position: relative;
    top: 5px;
}


.mobile #pun-ulinks {
  display:none;
}

.mobile #header_table {
display:none;
}

.mobile #pun-announcement {
  display:none;
}


/* =====================================
   CATEGORY
===================================== */

.mobile .category h2,
.mobile #pun-stats h2 {
  display:none !important;
}

.mobile #pun-index .category .container {
    margin-bottom: 0px;
    padding: 0px;
    background: rgb(var(--c_darkgray));
    border-radius:0px;
}

.mobile #pun-index .category tr {
    display: grid;
    gap: 0;
    box-sizing: border-box;
    position: relative;
    align-items: center;
    padding: 0px 10px;
    margin: 0px auto;
    background: rgb(var(--c_lightgray));
    border-radius: 0px;
    border-bottom: 1px solid #ccc;
}

.mobile #pun-index tr div.icon {display:none;}

/* ===== НОВЫЕ СООБЩЕНИЯ ===== */

.mobile #pun-index  .category .icon::after{ /*.inew*/
  content:"";
  position:absolute;
  width:10px;
  height:10px;
  border-radius:50%;
  right:2px;
  bottom:2px;
  background:#4cff5a;
  animation:mobileNewBlink 1.2s infinite;
}

@keyframes mobileNewBlink{
  0%{opacity:1;}
  50%{opacity:.2;}
  100%{opacity:1;}
}


.mobile #pun-index .category .tclcon{
  display:flex;
  flex-direction:column;
  justify-content:center;
}

/* название форума */
.mobile #pun-index .category h3{
  margin:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mobile #pun-index .category tr h3 a {
    font: 400 20px / 100% var(--antquabi);
    color: rgb(var(--c_gnrl_2));
    letter-spacing: -1px;
    display: inline-block;
    text-transform: lowercase;
    padding-bottom: var(--2);
    margin-bottom: var(--4);
}

/* описание убираем */
.mobile .sumfor{
  display:none;
}

.mobile .tc2,
.mobile .tc3{
  display:none;
}

.mobile #pun-index .category tr .tcr {
    width: max-content;
    color: rgb(var(--dark) / .6);
}

.mobile #pun-index .tcr span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Применяем к ячейке с чатом */
.mobile #pun-index .tcr {
    display: grid;
    grid-template-columns: auto 1fr auto; /* Аватар | Название | Дата */
    grid-template-rows: auto auto; /* Две строки: название/дата и ник */
    gap: 4px 12px; /* Отступы между ячейками сетки */
    align-items: start;
    padding: 5px 16px 12px !important;
    border-bottom: 1px solid #f0f0f0;
    width:100vw;
}

/* Аватар - занимает две строки по высоте */
.mobile #pun-index .tcr .user-avatar {
    grid-row: span 2;
    align-self: center;
}

/* Стили для аватара */
.mobile #pun-index .user-avatar {
    height: 48px;
    vertical-align: middle;
}
.mobile #pun-index .tcr .avatar-image {
    display: block;
    width: 48px;
    height: 48px;
    background-size: cover;
    background-position: center;
}
.mobile #pun .user-avatar .isonline {display:none;}

/* Ссылка на чат (название) */
.mobile #pun-index .tcr .lastpost-link {
    grid-column: 2;
    grid-row: 1;
    font-size: 1.0625rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    align-self: center;
}

/* Дата - в правом верхнем углу */
.mobile #pun-index .tcr .lastpost .datetime {
grid-column: 3;
    grid-row: 1;
    font-size: 0.8rem;
    white-space: nowrap;
    margin-left: auto;
}

/* Контейнер с ником автора */
.mobile #pun-index .tcr .lastpost {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    gap: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex-direction: row-reverse;
    font-size: 0;
}

/* Никнейм автора */
.mobile #pun-index .tcr .byuser {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding-right: 5px;
    font-weight: bold;
    font-size: 1rem;
}

/* Убираем лишние br */
.mobile #pun-index .tcr br {
    display: none;
}

/* Альтернативный вариант для старых браузеров */
@supports not (display: grid) {
    .mobile #pun-index .tcr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }
    
    .mobile #pun-index .tcr .user-avatar {
        flex: 0 0 48px;
    }
    
    .mobile #pun-index .tcr .lastpost-link {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .mobile #pun-index .tcr .lastpost {
        flex: 0 0 100%;
        margin-left: 60px; /* Ширина аватара + отступ */
        margin-top: -8px;
    }
    
    .mobile #pun-index .tcr .lastpost .datetime {
        margin-left: auto;
    }
}