/* AWD NARROW POSTS 20261106 */
@media only screen and (max-width: 768px) {
    body.section-viewtopic .post[id^="p"] > .inner {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    body.section-viewtopic .post[id^="p"] > .inner > .corners-top {
        order: -2;
    }

    body.section-viewtopic .post[id^="p"] > .inner > .postprofile {
        order: -1;
        display: block;
        float: none;
        clear: both;
        width: 100%;
        min-width: 0;
        min-height: 0;
        box-sizing: border-box;
        margin: 5px 0 10px;
        padding: 0 0 8px;
        border-right: 0;
        border-left: 0;
        border-bottom: 1px solid #d1d1d1;
        overflow-wrap: anywhere;
    }

    body.section-viewtopic .post[id^="p"] > .inner > .postbody {
        float: none;
        clear: both;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }

    body.section-viewtopic .post[id^="p"] > .inner > .back2top {
        order: 1;
    }

    body.section-viewtopic .post[id^="p"] > .inner > .corners-bottom {
        order: 2;
    }
}

/* AWD NARROW LAYOUT V2 */
@media only screen and (max-width: 768px) {
    /* Навигация: убрать сжатие плавающих блоков */
    #phpbb .navbar > .inner {
        display: flow-root;
    }
    #phpbb .navbar ul.linklist {
        display: flex;
        flex-wrap: wrap;
        float: none;
        clear: both;
        width: auto;
        min-width: 0;
        margin-left: 0;
        text-align: left;
    }
    #phpbb .navbar ul.linklist > li {
        float: none;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        text-align: left;
        overflow-wrap: break-word;
    }
    #phpbb .navbar ul.navlinks > li:first-child {
        flex: 0 0 100%;
        width: 100%;
    }
    #phpbb #navbar {
        height: auto;
        display: flow-root;
    }

    /* Вкладки главной: перенос целых вкладок */
    #phpbb #ctabs {
        min-width: 0;
        height: auto;
        margin-left: 0;
    }
    #phpbb #ctabs ul {
        display: flex;
        flex-wrap: wrap;
    }
    #phpbb #ctabs li {
        display: block;
        flex: 1 1 130px;
        min-width: 0;
    }
    #phpbb #ctabs a {
        display: block;
        float: none;
        width: auto;
    }
    #phpbb #ctabs a span {
        white-space: normal;
    }

    /* Списки: название, счётчики, последнее сообщение */
    #phpbb ul.topiclist > li > dl {
        display: flex;
        flex-wrap: wrap;
        min-width: 0;
    }
    #phpbb ul.topiclist > li > dl > dt {
        float: none;
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding-right: 8px;
        overflow-wrap: break-word;
    }
    #phpbb ul.topiclist > li > dl > dd {
        float: none;
        min-width: 0;
        box-sizing: border-box;
        border-left: 0;
    }
    #phpbb ul.topiclist > li.row > dl > dd.posts,
    #phpbb ul.topiclist > li.row > dl > dd.topics,
    #phpbb ul.topiclist > li.row > dl > dd.views {
        flex: 0 1 auto;
        width: auto;
        padding: 4px 12px 4px 0;
        text-align: left;
    }
    #phpbb ul.topiclist > li.row > dl > dd.lastpost {
        flex: 0 0 100%;
        width: 100%;
        padding: 6px 0;
        overflow-wrap: anywhere;
    }
    #phpbb ul.topiclist > li.row > dl > dd dfn {
        position: static;
        width: auto;
        font-style: normal;
        margin-right: 4px;
    }
    #phpbb ul.topiclist > li.header > dl > dd {
        display: none;
    }
    #phpbb ul.topiclist a.subforum {
        white-space: normal;
    }

    /* Кнопки сообщения отдельной строкой */
    #phpbb.section-viewtopic .postbody > ul.profile-icons {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        float: none;
        width: 100%;
        box-sizing: border-box;
        margin: 0 0 10px;
        gap: 5px;
    }
    #phpbb.section-viewtopic .postbody > ul.profile-icons > li {
        float: none;
        flex-shrink: 0;
    }
    #phpbb.section-viewtopic .postbody > h3 {
        clear: both;
    }

    /* Таблицы: целые слова, прокрутка внутри таблицы */
    #phpbb.section-viewtopic .postbody .content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #phpbb.section-viewtopic .postbody .content table th,
    #phpbb.section-viewtopic .postbody .content table td {
        word-break: normal;
        overflow-wrap: normal;
    }
}
