/* ===== Quiz24Share custom styles (on top of the Quiz24 AdminBSB theme) ===== */

/* ---------- visible input boxes (theme default is a hairline underline) ---------- */
.qs-login-card .form-control,
.qs-composer-text,
.qs-link-input .form-control,
.qs-conv-search .form-control {
    background: #fafbfd !important;
    background-image: none !important;
    border: 1.5px solid #c8d0e0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    padding: 10px 14px !important;
    height: auto !important;
    color: #333 !important;
    font-size: 14px !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}

/* ================================================================
   Quiz24 Share — modern top-navigation layout (2026 refresh)
   ================================================================ */
:root {
    --qs-primary: #6d4aff;
    --qs-primary-dark: #5232d6;
    --qs-accent: #15b89a;
    --qs-ink: #182033;
    --qs-muted: #768096;
    --qs-line: #e9eaf2;
    --qs-surface: rgba(255, 255, 255, .94);
    --qs-bg: #f5f6fb;
    --qs-shadow: 0 16px 45px rgba(39, 31, 78, .08);
}

html { min-height: 100%; background: var(--qs-bg); }
body.qs-app-shell {
    min-height: 100vh;
    padding: 0 !important;
    margin: 0;
    color: var(--qs-ink);
    background:
        radial-gradient(circle at 85% 0%, rgba(109, 74, 255, .10), transparent 29rem),
        radial-gradient(circle at 8% 35%, rgba(21, 184, 154, .07), transparent 25rem),
        var(--qs-bg);
    font-family: IRANSans, Tahoma, sans-serif;
}

.qs-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    border-bottom: 1px solid rgba(226, 226, 239, .82);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 8px 30px rgba(30, 28, 60, .055);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.qs-nav-container {
    width: min(100% - 40px, 1240px);
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
}

.qs-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--qs-ink);
    text-decoration: none !important;
    flex: 0 0 auto;
}
.qs-brand-mark {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--qs-primary), #9b70ff);
    box-shadow: 0 9px 22px rgba(109, 74, 255, .28);
}
.qs-brand-mark .material-icons { font-size: 23px; }
.qs-brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.qs-brand-copy strong { font: 800 18px/1.1 Arial, sans-serif; letter-spacing: -.3px; }
.qs-brand-copy small { margin-top: 4px; color: var(--qs-muted); font-size: 10px; }

.qs-main-nav.navbar-collapse {
    display: flex !important;
    align-items: center;
    gap: 5px;
    flex: 1;
    padding: 0;
    border: 0;
    box-shadow: none;
}
.qs-nav-link {
    position: relative;
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 13px;
    color: #555f73;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.qs-nav-link:hover { color: var(--qs-primary); background: #f1edff; text-decoration: none; transform: translateY(-1px); }
.qs-nav-link.active { color: var(--qs-primary); background: #eeeaff; font-weight: 700; }
.qs-nav-link.active:after {
    content: "";
    position: absolute;
    right: 16px;
    left: 16px;
    bottom: -17px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--qs-primary);
}
.qs-nav-link .material-icons { font-size: 20px; }
.qs-nav-badge {
    position: static;
    min-width: 21px;
    height: 21px;
    padding: 2px 6px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: #ff4d79;
    border: 2px solid #fff;
    border-radius: 99px;
    font-size: 10px;
    line-height: 1;
}

.qs-profile-menu { position: relative; flex: 0 0 auto; }
.qs-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    padding: 6px 8px 6px 11px;
    border: 1px solid var(--qs-line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .7);
    color: var(--qs-ink);
    text-align: right;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.qs-profile-trigger:hover, .qs-profile-menu.open .qs-profile-trigger { border-color: #d8d0ff; box-shadow: 0 8px 20px rgba(64, 49, 123, .10); }
.qs-profile-trigger img { width: 39px; height: 39px; border-radius: 12px; object-fit: cover; background: #eeeaff; }
.qs-profile-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.qs-profile-copy strong { max-width: 125px; overflow: hidden; color: var(--qs-ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.qs-profile-copy small { margin-top: 2px; color: var(--qs-muted); font-size: 10px; }
.qs-profile-chevron { color: #949bad; font-size: 18px; transition: transform .2s ease; }
.qs-profile-menu.open .qs-profile-chevron { transform: rotate(180deg); }
.qs-profile-dropdown.dropdown-menu {
    right: auto;
    left: 0;
    width: 250px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--qs-line);
    border-radius: 17px;
    box-shadow: 0 20px 55px rgba(31, 25, 63, .15);
}
.qs-profile-dropdown-head { display: flex; align-items: center; gap: 11px; padding: 8px 7px 14px; border-bottom: 1px solid var(--qs-line); }
.qs-profile-dropdown-head img { width: 43px; height: 43px; border-radius: 13px; object-fit: cover; }
.qs-profile-dropdown-head div { display: flex; flex-direction: column; }
.qs-profile-dropdown-head strong { color: var(--qs-ink); font-size: 12px; }
.qs-profile-dropdown-head small { margin-top: 3px; color: var(--qs-muted); font-size: 10px; }
.qs-logout-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #e34b65;
    text-align: right;
    transition: background .2s ease;
}
.qs-logout-btn:hover { background: #fff0f3; color: #d53b56; }
.qs-logout-btn .material-icons { margin: 0; font-size: 19px; }
.qs-mobile-toggle { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--qs-line); border-radius: 12px; background: #fff; color: var(--qs-primary); }

.qs-page-content { min-height: calc(100vh - 132px); }
.qs-content-container { width: min(100% - 40px, 1180px); margin: 0 auto; padding: 34px 0 48px !important; }
.qs-footer { width: min(100% - 40px, 1180px); margin: 0 auto; padding: 17px 0 22px; display: flex; justify-content: space-between; border-top: 1px solid var(--qs-line); color: #969cad; font-size: 10px; }

body.qs-app-shell .block-header { margin: 0 0 24px; padding: 0 3px; }
body.qs-app-shell .block-header h2 { margin: 0 0 7px; color: var(--qs-ink); font-size: 23px; font-weight: 800; }
body.qs-app-shell .block-header small { color: var(--qs-muted) !important; font-size: 12px; }
body.qs-app-shell .card {
    overflow: visible;
    border: 1px solid rgba(230, 230, 240, .85);
    border-radius: 20px;
    background: var(--qs-surface);
    box-shadow: var(--qs-shadow);
}
body.qs-app-shell .card .header { padding: 21px 23px 15px; border-bottom: 1px solid #f0eff6; }
body.qs-app-shell .card .header h2 { color: var(--qs-ink); font-size: 15px; font-weight: 700; }
body.qs-app-shell .card .body { padding: 22px; }

#feedComposer, #chatComposer { overflow: hidden; border: 1px solid #e2ddff; box-shadow: 0 18px 45px rgba(74, 53, 154, .10); }
#feedComposer:before, #chatComposer:before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--qs-primary), #9a73ff, var(--qs-accent)); }
.qs-composer-text { min-height: 84px; padding: 14px 16px !important; border: 1px solid var(--qs-line) !important; border-radius: 14px !important; background: #fafafe !important; box-shadow: none !important; transition: border-color .2s ease, background .2s ease; }
.qs-composer-text:focus { border-color: #b7a9ff !important; background: #fff !important; }
.qs-composer-actions { padding-top: 5px; border-top: 0; }
.qs-btn { min-height: 40px; padding: 8px 15px; border-radius: 12px; }
.qs-btn-outline { border-color: var(--qs-line); color: #626b7e; background: #f8f8fb; }
.qs-btn-outline:hover { border-color: #cabfff; color: var(--qs-primary); background: #f2efff; }
.qs-btn-send { padding: 9px 22px; border: 0; background: linear-gradient(135deg, var(--qs-primary), #8a62ff); box-shadow: 0 9px 20px rgba(109, 74, 255, .24); }

.qs-post { overflow: hidden !important; transition: transform .25s ease, box-shadow .25s ease; }
.qs-post:hover { transform: translateY(-2px); box-shadow: 0 20px 48px rgba(39, 31, 78, .11) !important; }
.qs-post-header { padding-bottom: 15px; border-bottom: 1px solid #f2f1f6; }
.qs-avatar { width: 46px; height: 46px; padding: 2px; border: 2px solid #e5dfff; border-radius: 15px; background: #fff; }
.qs-avatar-lg { width: 50px; height: 50px; border-radius: 15px; }
.qs-post-author { color: var(--qs-ink); font-weight: 700; }
.qs-post-body { padding: 18px 2px 3px; color: #343b4d; font-size: 13px; line-height: 2.05; }
.qs-file-card { border-color: var(--qs-line); border-radius: 13px; background: #fafafe; }
.qs-link-chip { border-color: #ddd5ff; border-radius: 99px; color: var(--qs-primary); background: #f3f0ff; }
.qs-feed-toolbar, .qs-chat-toolbar { border: 1px solid #e2dcff; border-radius: 15px; background: rgba(250, 248, 255, .95); box-shadow: 0 12px 30px rgba(65, 48, 129, .10); }

.qs-conv-list { overflow: hidden; border: 1px solid #f0eff5; border-radius: 15px; }
.qs-conv-item + .qs-conv-item { border-color: #f0eff5; }
.qs-conv-item a { padding: 14px 15px; transition: background .2s ease, transform .2s ease; }
.qs-conv-item a:hover { background: #f5f2ff; transform: translateX(-2px); }
.qs-conv-name { color: var(--qs-ink); font-weight: 700; }
.qs-conv-preview { margin-top: 5px; color: var(--qs-muted) !important; }
.qs-conv-search .form-control { border-radius: 13px !important; background: #f8f8fc !important; }

.qs-chat-header { padding: 13px 15px !important; border: 1px solid var(--qs-line); border-radius: 18px; background: rgba(255,255,255,.82); box-shadow: var(--qs-shadow); }
.qs-chat-card { overflow: hidden !important; }
.qs-chat-body { background: linear-gradient(rgba(249,249,253,.93), rgba(249,249,253,.93)), radial-gradient(circle, #dcd7ef 1px, transparent 1px); background-size: auto, 20px 20px; }
.qs-bubble { border: 1px solid #ebe9f3; border-radius: 17px 17px 5px 17px; box-shadow: 0 6px 16px rgba(34, 31, 57, .06); }
.qs-msg-mine .qs-bubble { border-color: #d9d0ff; background: linear-gradient(135deg, #eeeaff, #e8e2ff); }
.qs-msg-other .qs-bubble { border-radius: 17px 17px 17px 5px; background: #fff; }

.qs-anon-page { background: radial-gradient(circle at 70% 10%, rgba(109,74,255,.22), transparent 28rem), linear-gradient(145deg, #f7f5ff, #eef6f8); }
.qs-login-card { overflow: hidden; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; box-shadow: 0 24px 65px rgba(53, 39, 102, .16); }
.qs-login-card .header { padding: 27px 24px; background: linear-gradient(135deg, #f4f0ff, #f9f8ff); }
.qs-login-card .header h4 { font-size: 18px; font-weight: 800; }
.qs-login-card input.form-control { height: 47px; padding: 0 14px; border: 1px solid var(--qs-line); border-radius: 12px; background: #fafafe; box-shadow: none; }
.qs-login-card .btn-lg { height: 47px; border-radius: 12px; background: linear-gradient(135deg, var(--qs-primary), #8a62ff) !important; box-shadow: 0 10px 22px rgba(109,74,255,.23); }

@media (max-width: 900px) {
    .qs-nav-container { position: relative; width: min(100% - 24px, 1240px); min-height: 68px; gap: 10px; }
    .qs-brand-copy small, .qs-profile-copy, .qs-profile-chevron { display: none; }
    .qs-brand { margin-left: auto; }
    .qs-brand-mark { width: 39px; height: 39px; border-radius: 12px; }
    .qs-profile-trigger { min-width: 0; padding: 4px; border: 0; background: transparent; }
    .qs-profile-trigger img { width: 40px; height: 40px; border-radius: 12px; }
    .qs-mobile-toggle { display: grid; place-items: center; order: 2; }
    .qs-profile-menu { order: 3; }
    .qs-main-nav.navbar-collapse { display: none !important; }
    .qs-main-nav.navbar-collapse.in {
        position: absolute;
        top: 62px;
        right: 0;
        left: 0;
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 10px;
        border: 1px solid var(--qs-line);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 18px 45px rgba(31, 25, 63, .15);
    }
    .qs-nav-link { width: 100%; padding: 11px 13px; }
    .qs-nav-link.active:after { display: none; }
    .qs-content-container { width: min(100% - 24px, 1180px); padding-top: 24px !important; }
    .qs-footer { width: min(100% - 24px, 1180px); }
}

@media (max-width: 600px) {
    .qs-brand-copy strong { font-size: 16px; }
    .qs-profile-dropdown.dropdown-menu { position: fixed; top: 62px; right: 12px; left: 12px; width: auto; }
    body.qs-app-shell .block-header h2 { font-size: 20px; }
    body.qs-app-shell .card { border-radius: 17px; }
    body.qs-app-shell .card .body { padding: 16px; }
    .qs-composer-actions { align-items: stretch; gap: 10px; }
    .qs-btn-send { min-width: 90px; }
    .qs-msg { max-width: 94%; }
    .qs-footer { flex-direction: column; align-items: center; gap: 5px; }
}

/* Message time/read state lives inside the bubble at its lower-left edge. */
body.qs-app-shell .qs-msg .qs-bubble {
    position: relative;
    padding-bottom: 25px;
}
body.qs-app-shell .qs-msg .qs-msg-meta {
    position: absolute;
    left: 10px;
    bottom: 6px;
    margin: 0;
    direction: ltr;
    color: #8b91a0 !important;
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
}
body.qs-app-shell .qs-msg-mine .qs-msg-meta { color: #786ca8 !important; }
body.qs-app-shell .qs-msg .qs-msg-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
}
body.qs-app-shell .qs-msg-time { color: #8b91a0; }
body.qs-app-shell .qs-msg-ticks {
    color: #9ba2b0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
}
body.qs-app-shell .qs-msg-ticks.is-read { color: #19a974; }

/* Confirmation modal is horizontally RTL/right-aligned; only row contents are vertically centered. */
.qs-confirm-modal .modal-header {
    align-items: center;
    justify-content: flex-start;
    text-align: right;
}
.qs-confirm-modal .modal-title {
    align-items: center;
    justify-content: flex-start;
    text-align: right;
}
.qs-confirm-modal .modal-body { text-align: right; }
.qs-confirm-modal .modal-footer {
    align-items: center;
    justify-content: flex-start;
    text-align: right;
}
.qs-confirm-modal #qsConfirmOk,
.qs-confirm-modal #qsConfirmOk:hover,
.qs-confirm-modal #qsConfirmOk:focus,
.qs-confirm-modal #qsConfirmOk:active {
    align-items: center !important;
    justify-content: center !important;
}

/* Conversation header. */
body.qs-app-shell .qs-chat-header {
    min-height: 76px;
    padding: 12px 16px !important;
    gap: 11px;
}
body.qs-app-shell .qs-back-btn {
    width: 44px;
    height: 44px;
    margin: 0 0 0 2px;
    padding: 0;
    flex: 0 0 44px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #ded7ff;
    border-radius: 13px;
    color: var(--qs-primary);
    background: linear-gradient(135deg, #f5f2ff, #fff);
    text-decoration: none !important;
    box-shadow: 0 6px 15px rgba(78,58,153,.10);
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
body.qs-app-shell .qs-back-btn:hover,
body.qs-app-shell .qs-back-btn:focus {
    border-color: #bcaeff;
    color: #fff;
    background: linear-gradient(135deg, var(--qs-primary), #8c64ff);
    box-shadow: 0 9px 20px rgba(109,74,255,.22);
    transform: translateX(2px);
}
body.qs-app-shell .qs-back-btn .material-icons { margin: 0; font-size: 23px; line-height: 1; }
body.qs-app-shell .qs-chat-person { min-width: 0; }
body.qs-app-shell .qs-chat-person h2 {
    margin: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--qs-ink);
    line-height: 1.5;
}
body.qs-app-shell .qs-chat-person h2 > span { font-size: 17px; font-weight: 800; }
body.qs-app-shell .qs-chat-username {
    display: inline-block;
    color: var(--qs-muted) !important;
    font-size: 11px;
    font-weight: 500;
    direction: ltr;
    white-space: nowrap;
}

@media (max-width: 600px) {
    body.qs-app-shell .qs-chat-header { min-height: 68px; padding: 10px 12px !important; }
    body.qs-app-shell .qs-back-btn { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
    body.qs-app-shell .qs-chat-person h2 > span { font-size: 14px; }
    body.qs-app-shell .qs-chat-username { font-size: 9px; }
}

/* Disable the legacy AdminBSB animated underline inside modern composers. */
body.qs-app-shell #feedComposer .form-line,
body.qs-app-shell #chatComposer .form-line {
    position: static;
    border: 0 !important;
}
body.qs-app-shell #feedComposer .form-line::before,
body.qs-app-shell #feedComposer .form-line::after,
body.qs-app-shell #chatComposer .form-line::before,
body.qs-app-shell #chatComposer .form-line::after {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
}

/* Keep the feed composer visible while older posts scroll independently. */
body.qs-app-shell .qs-feed-column {
    height: calc(100vh - 235px);
    min-height: 560px;
    display: flex;
    flex-direction: column;
}
body.qs-app-shell .qs-feed-column #feedComposer {
    flex: 0 0 auto;
    margin-bottom: 18px;
}
body.qs-app-shell .qs-feed-column .qs-feed-toolbar { flex: 0 0 auto; }
body.qs-app-shell .qs-feed-column #feedList {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 3px 8px 24px;
    margin: 0 -8px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c8bcff transparent;
}
body.qs-app-shell .qs-feed-column #feedList::-webkit-scrollbar { width: 8px; }
body.qs-app-shell .qs-feed-column #feedList::-webkit-scrollbar-track { background: transparent; }
body.qs-app-shell .qs-feed-column #feedList::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: #c8bcff; background-clip: padding-box; }
body.qs-app-shell .qs-feed-column #feedList::-webkit-scrollbar-thumb:hover { background: #9f8dff; background-clip: padding-box; }
body.qs-app-shell .qs-feed-column #feedList > .qs-post:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
    body.qs-app-shell .qs-feed-column {
        height: calc(100dvh - 205px);
        min-height: 500px;
    }
    body.qs-app-shell .qs-feed-column #feedComposer { margin-bottom: 14px; }
}

/* Destructive confirmation modal. */
.qs-confirm-modal { direction: rtl; text-align: right; }
.qs-confirm-modal .modal-dialog { width: min(92%, 560px); margin: 12vh auto 30px; }
.qs-confirm-modal .modal-content { overflow: hidden; border: 0; border-radius: 20px; box-shadow: 0 26px 70px rgba(25,20,48,.28); }
    .qs-confirm-modal .modal-header {
        min-height: 50px;
        padding: 0px 24px 0px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        border: 0;
        background: linear-gradient(135deg, #fde7ff, #f8ddff);
    }
.qs-confirm-modal .modal-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #77139a;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}
.qs-confirm-modal .modal-title .material-icons { margin: 0; color: #8618a8; font-size: 25px; line-height: 1; }
.qs-confirm-modal .modal-body { padding: 28px 28px 18px; color: #6e7180; font-size: 13px; line-height: 1.9; text-align: center; }
.qs-confirm-modal .modal-body p { margin: 0; }
.qs-confirm-modal .modal-footer { padding: 13px 24px 22px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; text-align: center; }
.qs-confirm-modal .modal-footer::before,
.qs-confirm-modal .modal-footer::after { display: none; content: none; }
.qs-confirm-modal #qsConfirmOk,
.qs-confirm-modal #qsConfirmOk:hover,
.qs-confirm-modal #qsConfirmOk:focus,
.qs-confirm-modal #qsConfirmOk:active {
    min-width: 145px;
    min-height: 40px;
    margin: 0;
    padding: 5px 17px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    border: 0;
    border-radius: 11px;
    outline: 0;
    color: #fff !important;
    background: linear-gradient(135deg, #ff4e47, #ef3535) !important;
    font-family: inherit;
    line-height: 1 !important;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: 0 9px 20px rgba(239,53,53,.24);
}
    .qs-confirm-modal #qsConfirmOk .material-icons,
    .qs-confirm-modal #qsConfirmOk:hover .material-icons,
    .qs-confirm-modal #qsConfirmOk:focus .material-icons,
    .qs-confirm-modal #qsConfirmOk:active .material-icons {
        flex: 0 0 auto;
        margin: 0;
        color: #fff !important;
        font-size: 20px;
        line-height: 1;
        margin-bottom: 5px;
    }
.qs-confirm-modal #qsConfirmOk span { color: #fff !important; line-height: 1.3; }
.qs-confirm-modal .btn-link { min-height: 40px; margin: 0; padding: 5px 18px; border-radius: 11px; color: #565b68; font-family: inherit; text-decoration: none; }
.qs-confirm-modal .btn-link:hover,
.qs-confirm-modal .btn-link:focus { color: #343844; background: #f1f1f5; text-decoration: none; }

@media (max-width: 600px) {
    .qs-confirm-modal .modal-dialog { margin-top: 8vh; }
    .qs-confirm-modal .modal-footer { flex-direction: column; }
    .qs-confirm-modal #qsConfirmOk,
    .qs-confirm-modal .btn-link { width: 100%; }
}

/* Search within previous shares. */
body.qs-app-shell .qs-feed-search {
    position: relative;
    flex: 0 0 auto;
    height: 48px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    border: 1px solid #e1def0;
    border-radius: 14px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 7px 20px rgba(41,34,73,.05);
    transition: border-color .2s ease, box-shadow .2s ease;
}
body.qs-app-shell .qs-feed-search:focus-within { border-color: #b9abff; box-shadow: 0 8px 22px rgba(109,74,255,.10); }
body.qs-app-shell .qs-feed-search > .material-icons { margin-right: 15px; color: #9a91c0; font-size: 21px; }
body.qs-app-shell .qs-feed-search input {
    min-width: 0;
    height: 100%;
    flex: 1;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #343a4c;
    font-family: inherit;
    font-size: 12px;
    text-align: right;
}
body.qs-app-shell .qs-feed-search input::placeholder { color: #a2a7b5; }
body.qs-app-shell .qs-feed-search-clear { width: 38px; height: 38px; margin-left: 5px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #9299aa; }
body.qs-app-shell .qs-feed-search-clear:hover { color: var(--qs-primary); background: #f0ecff; }
body.qs-app-shell .qs-feed-search-clear .material-icons { font-size: 18px; }
body.qs-app-shell .qs-feed-search-empty .body { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--qs-muted); }
body.qs-app-shell .qs-feed-search-empty .material-icons { color: #a99aff; font-size: 38px; }
body.qs-app-shell .qs-feed-search-empty strong { color: #555d70; font-size: 13px; }
body.qs-app-shell .qs-feed-search-empty span { font-size: 11px; }

/* Keep destructive toolbar actions white in every Bootstrap state. */
body.qs-app-shell #feedDeleteSelected,
body.qs-app-shell #feedDeleteSelected:hover,
body.qs-app-shell #feedDeleteSelected:focus,
body.qs-app-shell #feedDeleteSelected:active,
body.qs-app-shell #chatDeleteSelected,
body.qs-app-shell #chatDeleteSelected:hover,
body.qs-app-shell #chatDeleteSelected:focus,
body.qs-app-shell #chatDeleteSelected:active {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 7px;
    color: #fff !important;
    background: linear-gradient(135deg, #ff4f48, #ef3535) !important;
    line-height: 1 !important;
    text-decoration: none !important;
}
body.qs-app-shell #feedDeleteSelected .material-icons,
body.qs-app-shell #chatDeleteSelected .material-icons { display: inline-block; flex: 0 0 auto; color: #fff !important; line-height: 1 !important; }

/* Compact feed/messages and restore normal page scrolling. */
body.qs-app-shell .qs-feed-column {
    height: auto;
    min-height: 0;
    display: block;
}
body.qs-app-shell .qs-feed-column #feedComposer { margin-bottom: 14px; }
body.qs-app-shell .qs-feed-column #feedList {
    min-height: 0;
    overflow: visible;
    padding: 0;
    margin: 0;
}

body.qs-app-shell .qs-post { margin-bottom: 14px; }
body.qs-app-shell .qs-post .body { padding: 15px 18px; }
body.qs-app-shell .qs-post-header { padding-bottom: 10px; gap: 8px; }
body.qs-app-shell .qs-post .qs-avatar { width: 40px; height: 40px; border-radius: 12px; }
body.qs-app-shell .qs-post-author { font-size: 13px; }
body.qs-app-shell .qs-post-header .small { font-size: 10px; }
body.qs-app-shell .qs-post-body { padding: 11px 2px 0; font-size: 12px; line-height: 1.85; }
body.qs-app-shell .qs-post .qs-files,
body.qs-app-shell .qs-post .qs-links { margin-top: 8px; }
body.qs-app-shell .qs-post .qs-file-card {
    min-height: 56px;
    margin-bottom: 6px;
    padding: 6px 9px;
}
body.qs-app-shell .qs-post .qs-file-type { font-size: 25px; }
body.qs-app-shell .qs-post .qs-file-action { width: 33px; height: 33px; }
body.qs-app-shell .qs-post .qs-file-name { font-size: 12px; }

body.qs-app-shell .qs-conv-item a { min-height: 66px; padding: 10px 12px; gap: 11px; }
body.qs-app-shell .qs-conv-item .qs-avatar-lg { width: 43px; height: 43px; border-radius: 13px; }
body.qs-app-shell .qs-conv-name { font-size: 12px; }
body.qs-app-shell .qs-conv-preview { margin-top: 3px; font-size: 10px; }
body.qs-app-shell .qs-conv-meta { font-size: 10px; }

body.qs-app-shell .qs-msg { margin-bottom: 7px; }
body.qs-app-shell .qs-bubble { padding: 8px 11px; }
body.qs-app-shell .qs-msg-body { font-size: 12px; line-height: 1.75; }
body.qs-app-shell .qs-msg .qs-file-card { min-height: 52px; padding: 5px 8px; }
body.qs-app-shell .qs-msg-meta { margin-top: 2px; font-size: 9px; }

@media (max-width: 768px) {
    body.qs-app-shell .qs-feed-column { height: auto; min-height: 0; }
    body.qs-app-shell .qs-post .body { padding: 13px 14px; }
}

.qs-login-card .form-control:focus,
.qs-composer-text:focus,
.qs-link-input .form-control:focus,
.qs-conv-search .form-control:focus {
    border-color: #691bc7 !important;
    box-shadow: 0 0 0 3px rgba(105, 27, 199, 0.12) !important;
    outline: none !important;
}

.qs-login-card .form-control::placeholder,
.qs-composer-text::placeholder,
.qs-link-input .form-control::placeholder,
.qs-conv-search .form-control::placeholder {
    color: #9aa3b5;
}

/* neutralize the theme's underline inside boxed inputs */
.qs-login-card .form-line,
.qs-conv-search .form-line,
#feedComposer .form-line,
#chatComposer .form-line {
    border-bottom: none !important;
}

/* labels: static above the input (theme default is absolute/floating) */
.qs-login-card .form-label {
    position: static !important;
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

#feedComposer .form-group,
#chatComposer .form-group,
.qs-conv-search .form-group,
.qs-login-card .form-group {
    margin-bottom: 14px;
}

/* link input: boxed input + inner clear button (RTL-safe, no input-group) */
.qs-link-input { position: relative; margin-bottom: 10px; }
.qs-link-input .form-control { padding-left: 40px !important; direction: ltr; }
.qs-link-input .qs-remove-link {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #9aa3b5;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.qs-link-input .qs-remove-link:hover { color: #e91e63; }
.qs-link-input.has-error .form-control { border-color: #e91e63 !important; }

/* textarea sizing */
.qs-composer-text { min-height: 64px; line-height: 1.8; resize: vertical; }

/* login inputs: latin values read left-to-right */
.qs-login-card input.form-control { direction: ltr; text-align: left; }

/* ---------- login / anon pages ---------- */
.qs-anon-page {
    background: #f2f6fc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'IRANSans', Tahoma, Arial, sans-serif;
}

.qs-center-box { width: 100%; max-width: 440px; padding: 15px; }

.qs-login-card .header { border-bottom: 1px solid #eee; padding: 20px; }
.qs-login-card .header h4 { margin: 0; color: #691bc7; }
.qs-login-card .form-label { color: #555; }

.qs-error-icon { font-size: 56px; color: #e91e63; }

/* ---------- avatars ---------- */
.qs-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    background: #e0e0e0;
}

.qs-avatar-lg {
    width: 52px; height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
    flex-shrink: 0;
}

/* ---------- navbar badge ---------- */
.qs-nav-badge {
    position: absolute;
    top: 4px; left: 4px;
    background: #ff5252;
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    margin-left: 12px;
}

.navbar .navbar-nav > li > a { position: relative; }
.qs-menu-badge { margin-right: 8px; }
.qs-logout-btn {
    width: 100%;
    text-align: right;
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
}
.qs-logout-btn:hover { background: #f5f5f5; color: #691bc7; }
.qs-logout-btn .material-icons { vertical-align: middle; margin-left: 8px; font-size: 18px; }

/* ---------- composer buttons ---------- */
.qs-composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}
.qs-composer-left { display: flex; gap: 10px; }

.qs-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 22px;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
    user-select: none;
    line-height: 1.6;
}
.qs-btn .material-icons { font-size: 17px; }

.qs-btn-outline {
    background: #fff;
    color: #691bc7;
    border: 1.5px solid #d5d9e6;
}
.qs-btn-outline:hover {
    border-color: #691bc7;
    background: #f6effd;
}

.qs-btn-send {
    background: #691bc7;
    color: #fff;
    padding: 10px 26px;
    box-shadow: 0 3px 10px rgba(105, 27, 199, .35);
}
.qs-btn-send:hover { background: #5a17a8; box-shadow: 0 4px 14px rgba(105, 27, 199, .45); }

.qs-btn:disabled,
.qs-btn-send:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- composer ---------- */
.no-resize { resize: none; }

.qs-link-input { margin-bottom: 8px; }
.qs-link-input .input-group-addon { cursor: pointer; }

.qs-file-queue { margin-bottom: 6px; }

.qs-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #fafbfd;
}

.qs-file-row .qs-file-row-icon { color: #691bc7; font-size: 26px; }
.qs-file-row-info { flex: 1; min-width: 0; }
.qs-file-row-name {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 12px; direction: ltr; text-align: left;
}
.qs-file-row-size { white-space: nowrap; }
.qs-file-cancel { cursor: pointer; color: #999; }
.qs-file-cancel:hover { color: #e91e63; }

.qs-progress { height: 6px; border-radius: 3px; margin-top: 4px; margin-bottom: 0; }
.qs-upload-failed { border-color: #ffcdd2 !important; background: #ffebee !important; }

/* ---------- posts (feed) ---------- */
.qs-post { position: relative; }

/* post checkbox: compact icon in actions group */
.qs-post-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ccc;
    margin: 0;
    padding: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: color .2s, background .2s;
}
.qs-post-check:hover {
    color: #691bc7;
    background: rgba(105, 27, 199, 0.08);
}
.qs-msg-check {
    position: absolute;
    cursor: pointer;
    z-index: 2;
    color: #bbb;
}
.qs-post-check .material-icons { font-size: 18px; }
.qs-msg-check .material-icons { font-size: 22px; }

/* hide native checkbox completely */
.qs-post-check input[type="checkbox"],
.qs-msg-check input[type="checkbox"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

.qs-post-check:hover,
.qs-msg-check:hover { color: #691bc7; }
.qs-post-check:has(input:checked),
.qs-msg-check:has(input:checked) { color: #691bc7; }

.qs-feed-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(105, 27, 199, 0.12);
    padding: 10px 20px;
    margin-bottom: 20px;
    position: sticky;
    top: 70px;
    z-index: 5;
}
.qs-feed-toolbar span { font-weight: 500; color: #555; }

.qs-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.qs-post-author { font-weight: 500; font-size: 15px; }
.qs-post-header > div:not(.qs-post-actions) { flex: 1; min-width: 0; }

/* post action buttons: at the left end of the header (in RTL, left = end) */
.qs-post-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

/* delete button: icon-only, compact */
.qs-delete-btn {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #ccc !important;
    padding: 4px !important;
    line-height: 1 !important;
    cursor: pointer;
    border-radius: 50% !important;
    transition: color .2s, background .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    direction: ltr;
}
.qs-delete-btn:hover {
    color: #e91e63 !important;
    background: rgba(233, 30, 99, 0.08) !important;
}
.qs-delete-btn .material-icons {
    font-size: 20px;
    display: inline-block !important;
    width: auto !important;
    flex-shrink: 0;
}

.qs-post-body {
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 2;
    font-size: 14px;
}

/* ---------- links ---------- */
.qs-links { margin-top: 10px; }
.qs-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3e9fd;
    color: #691bc7;
    border-radius: 16px;
    padding: 5px 14px;
    margin: 0 0 6px 8px;
    font-size: 12px;
    direction: ltr;
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.qs-link-chip:hover { background: #691bc7; color: #fff; text-decoration: none; }
.qs-link-chip .material-icons { font-size: 15px; }

/* ---------- files ---------- */
.qs-files { margin-top: 10px; }

.qs-file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
    color: #555;
    text-decoration: none !important;
    background: #fafbfd;
    transition: all .2s;
}
.qs-file-card:hover { border-color: #691bc7; background: #f7f0fd; }
.qs-file-card > .material-icons:first-child { color: #691bc7; font-size: 28px; }
.qs-file-info { flex: 1; min-width: 0; text-align: right; }
.qs-file-name {
    font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    direction: ltr;
}
.qs-file-dl { color: #999 !important; }

.qs-video {
    width: 100%;
    max-height: 420px;
    border-radius: 6px;
    background: #000;
    margin-bottom: 8px;
    display: block;
}

.qs-help-list { list-style: none; padding: 0; margin: 0; }
.qs-help-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 13px;
}
.qs-help-list li:last-child { border-bottom: none; }
.qs-help-list .material-icons { color: #691bc7; font-size: 19px; }

/* ---------- conversations list ---------- */
.qs-conv-list { margin: 0; padding: 0; }

.qs-conv-item + .qs-conv-item { border-top: 1px solid #f2f2f2; }

.qs-conv-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 6px;
    text-decoration: none !important;
    color: #555;
    border-radius: 6px;
}
.qs-conv-item a:hover { background: #f7f0fd; }

.qs-conv-info { flex: 1; min-width: 0; }
.qs-conv-name { font-weight: 500; }
.qs-conv-preview {
    font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 260px;
}
.qs-conv-meta { text-align: left; }
.qs-conv-meta .badge { margin-bottom: 4px; }

/* ---------- chat ---------- */
.qs-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.qs-chat-header h2 { font-size: 18px; margin: 0; }
.qs-back-btn { margin-left: 0; }

.qs-chat-card { margin-bottom: 15px; }

.qs-chat-body {
    height: 55vh;
    min-height: 350px;
    overflow-y: auto;
    padding: 15px !important;
    background: #f2f6fc;
}

.qs-chat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
    justify-content: flex-end;
}

.qs-chat-empty {
    margin: auto;
    padding: 30px 20px;
    line-height: 2;
}

.qs-msg {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    position: relative;
    padding: 0 36px;
}
.qs-msg-mine { align-self: flex-start; align-items: flex-start; } /* right side in RTL */
.qs-msg-other { align-self: flex-end; align-items: flex-end; }

.qs-msg .qs-msg-check {
    position: absolute;
    top: 4px;
    left: auto;
    right: -32px;
    z-index: 3;
}

.qs-msg-mine .qs-msg-check {
    right: auto;
    left: -32px;
}

.qs-bubble {
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    word-break: break-word;
}
.qs-msg-mine .qs-bubble { background: #ede3fa; }
.qs-msg-body { white-space: pre-wrap; line-height: 1.9; font-size: 14px; }
.qs-bubble .qs-link-chip { margin-top: 6px; display: inline-flex; }
.qs-bubble .qs-file-card { background: #fff; margin-top: 8px; margin-bottom: 4px; }

.qs-msg-meta { margin-top: 4px; font-size: 11px; }

.qs-chat-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: 6px;
    padding: 6px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}
.qs-chat-toolbar span { font-weight: 500; }

#chatLoadMoreWrap { margin-bottom: 12px; }

/* ---------- navbar user dropdown ---------- */
.qs-user-dropdown > a {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 14px 12px !important;
    line-height: 1.4 !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 500;
}

.navbar .nav > li.qs-user-dropdown {
    display: flex;
    align-items: stretch;
}

/* prevent navbar brand and user from overlapping */
.navbar .navbar-brand {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

/* card polish */
.card {
    border-radius: 8px;
    overflow: hidden;
}

.card .header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card .header h2 .material-icons {
    font-size: 20px;
    color: #691bc7;
}

/* ---------- misc ---------- */
.ng-hide { display: none !important; }

@media (max-width: 768px) {
    .qs-msg { max-width: 92%; }
    .qs-feed-toolbar { top: 60px; }
    .qs-msg .qs-msg-check {
        right: -24px;
    }
    .qs-msg-mine .qs-msg-check {
        left: -24px;
    }
    .navbar .navbar-brand {
        max-width: 180px;
        font-size: 13px;
    }
}

/* Final cascade guards for the modern shell. */
body.qs-app-shell .qs-avatar { width: 46px; height: 46px; padding: 2px; border: 2px solid #e5dfff; border-radius: 15px; background: #fff; }
body.qs-app-shell .qs-avatar-lg { width: 50px; height: 50px; border-radius: 15px; }
body.qs-app-shell .qs-composer-text { min-height: 84px; padding: 14px 16px !important; border: 1px solid var(--qs-line) !important; border-radius: 14px !important; background: #fafafe !important; }
body.qs-app-shell .qs-btn { min-height: 40px; padding: 8px 15px; border-radius: 12px; }
body.qs-app-shell .qs-btn-send { padding: 9px 22px; border: 0; background: linear-gradient(135deg, var(--qs-primary), #8a62ff); box-shadow: 0 9px 20px rgba(109, 74, 255, .24); }
body.qs-app-shell .qs-link-chip { border-color: #ddd5ff; border-radius: 99px; color: var(--qs-primary); background: #f3f0ff; }
body.qs-app-shell .qs-file-card { border-color: var(--qs-line); border-radius: 13px; background: #fafafe; }
body.qs-app-shell .qs-bubble { border: 1px solid #ebe9f3; border-radius: 17px 17px 5px 17px; box-shadow: 0 6px 16px rgba(34, 31, 57, .06); }
body.qs-app-shell .qs-msg-mine .qs-bubble { border-color: #d9d0ff; background: linear-gradient(135deg, #eeeaff, #e8e2ff); }
body.qs-app-shell .qs-msg-other .qs-bubble { border-radius: 17px 17px 17px 5px; background: #fff; }

/* Header alignment fixes for the legacy Bootstrap/AdminBSB cascade. */
body.qs-app-shell .qs-main-nav { flex: 1 1 auto; justify-content: flex-start; }
body.qs-app-shell .qs-main-nav .qs-nav-link {
    width: auto !important;
    max-width: max-content;
    flex: 0 0 auto !important;
    justify-content: flex-start;
    white-space: nowrap;
}
body.qs-app-shell .qs-profile-dropdown form { margin: 0; }
body.qs-app-shell .qs-profile-dropdown .qs-logout-btn {
    width: 100%;
    min-height: 44px;
    margin: 8px 0 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #e34b65;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
}
body.qs-app-shell .qs-profile-dropdown .qs-logout-btn:hover { background: #fff0f3; color: #d53b56; }
body.qs-app-shell .qs-profile-dropdown .qs-logout-btn .material-icons { flex: 0 0 auto; margin: 0; font-size: 19px; }

body.qs-app-shell .qs-help-list li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 14px 0;
}
body.qs-app-shell .qs-help-list .material-icons { margin-top: 2px; color: var(--qs-primary); font-size: 20px; }
body.qs-app-shell .qs-help-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; line-height: 1.75; }
body.qs-app-shell .qs-help-copy span { color: var(--qs-muted); font-size: 11px; }
body.qs-app-shell .qs-help-copy strong { color: #3a4050; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 900px) {
    body.qs-app-shell .qs-main-nav.navbar-collapse.in .qs-nav-link { max-width: none; }
}

/* Feed help dialog and composer action alignment. */
body.qs-app-shell .qs-page-heading {
    min-height: 52px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}
body.qs-app-shell .qs-page-heading h2 { margin-left: 0; }
body.qs-app-shell .qs-page-heading > small { order: 3; flex: 1 0 100%; margin-top: -13px; }
body.qs-app-shell .qs-help-button {
    order: 2;
    height: 38px;
    margin-right: 2px;
    padding: 7px 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #ddd6ff;
    border-radius: 11px;
    background: rgba(255, 255, 255, .82);
    color: var(--qs-primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
body.qs-app-shell .qs-help-button:hover { background: #f0ecff; box-shadow: 0 7px 18px rgba(109,74,255,.13); transform: translateY(-1px); }
body.qs-app-shell .qs-help-button .material-icons { font-size: 19px; }
body.qs-app-shell .qs-help-sidebar { display: none !important; }

body.qs-app-shell .qs-composer-left { align-items: stretch; }
body.qs-app-shell .qs-composer-left .qs-add-link,
body.qs-app-shell .qs-composer-left .qs-add-file {
    box-sizing: border-box;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 15px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
}
body.qs-app-shell .qs-add-file input[type="file"] { display: none !important; }

.qs-help-modal { direction: rtl; text-align: right; }
.qs-help-modal .modal-dialog { width: min(92%, 520px); margin: 90px auto 30px; }
.qs-help-modal .modal-content { overflow: hidden; border: 0; border-radius: 21px; box-shadow: 0 25px 70px rgba(34,28,66,.22); }
.qs-help-modal .modal-header { position: relative; padding: 22px 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--qs-line); background: linear-gradient(135deg, #f3efff, #fbfaff); }
.qs-help-modal .modal-header .close { position: absolute; top: 16px; left: 18px; margin: 0; color: #7b8292; opacity: .75; }
.qs-help-modal .qs-modal-title-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--qs-primary), #9670ff); box-shadow: 0 8px 18px rgba(109,74,255,.24); }
.qs-help-modal .qs-modal-title-icon .material-icons { font-size: 22px; }
.qs-help-modal .modal-title { margin: 0; color: var(--qs-ink); font-size: 16px; font-weight: 800; }
.qs-help-modal .modal-header p { margin: 5px 0 0; color: var(--qs-muted); font-size: 11px; }
.qs-help-modal .modal-body { padding: 12px 25px 10px; }
.qs-help-modal .modal-footer { padding: 13px 24px 19px; border-top: 0; text-align: left; }
.qs-help-modal .qs-modal-close { padding: 9px 20px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--qs-primary), #8b63ff); font-family: inherit; box-shadow: 0 8px 18px rgba(109,74,255,.2); }

@media (max-width: 600px) {
    body.qs-app-shell .qs-page-heading > small { margin-top: -7px; }
    .qs-help-modal .modal-dialog { margin-top: 65px; }
}

/* Composer, selection bar and file cards. */
body.qs-app-shell .qs-composer-actions { direction: rtl; }
body.qs-app-shell .qs-btn-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-direction: row;
    line-height: 1;
}
body.qs-app-shell .qs-btn-send .material-icons { margin: 0; font-size: 20px; }

body.qs-app-shell .qs-feed-toolbar {
    min-height: 64px;
    padding: 10px 14px;
    gap: 10px;
    border: 1px solid #ded7ff;
    border-right: 4px solid var(--qs-primary);
    border-radius: 16px;
    background: linear-gradient(105deg, rgba(244,241,255,.98), rgba(255,255,255,.98));
    box-shadow: 0 14px 34px rgba(58,43,118,.11);
}
body.qs-app-shell .qs-feed-toolbar #feedSelectCount {
    margin-left: auto;
    padding: 7px 12px;
    border-radius: 10px;
    color: #4d426e;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(44,35,84,.06);
}
body.qs-app-shell #feedDeleteSelected,
body.qs-app-shell #chatDeleteSelected {
    min-height: 40px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 11px;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 7px 16px rgba(239,68,68,.20);
}
body.qs-app-shell #feedDeleteSelected .material-icons,
body.qs-app-shell #chatDeleteSelected .material-icons { margin: 0; font-size: 19px; line-height: 1; }
body.qs-app-shell #feedCancelSelect,
body.qs-app-shell #chatCancelSelect { min-height: 40px; padding: 8px 13px; border-radius: 10px; color: #6f7585; text-decoration: none; }
body.qs-app-shell #feedCancelSelect:hover,
body.qs-app-shell #chatCancelSelect:hover { color: var(--qs-primary); background: #ebe6ff; }

body.qs-app-shell .qs-file-card {
    min-height: 70px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
body.qs-app-shell .qs-file-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 11px;
    direction: ltr;
    color: inherit;
    text-decoration: none !important;
}
body.qs-app-shell .qs-file-type { order: 2; flex: 0 0 auto; color: var(--qs-primary); font-size: 29px; width: 30px !important;}
body.qs-app-shell .qs-file-info { min-width: 0; flex: 0 1 auto; text-align: right; }
body.qs-app-shell .qs-file-name { direction: ltr; text-align: right; color: #394052; font-weight: 600; }
body.qs-app-shell .qs-file-actions { margin-right: auto; display: flex; align-items: center; gap: 5px; direction: rtl; }
body.qs-app-shell .qs-file-action {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #8d95a6;
    text-decoration: none !important;
    cursor: pointer;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
body.qs-app-shell .qs-file-action:hover { color: var(--qs-primary); border-color: #ddd5ff; background: #f0ecff; transform: translateY(-1px); }
body.qs-app-shell .qs-file-action .material-icons { font-size: 20px; }

@media (max-width: 600px) {
    body.qs-app-shell .qs-feed-toolbar { align-items: stretch; flex-wrap: wrap; }
    body.qs-app-shell .qs-feed-toolbar #feedSelectCount { width: 100%; margin: 0; }
    body.qs-app-shell .qs-file-card { min-height: 64px; }
    body.qs-app-shell .qs-file-actions { gap: 2px; }
    body.qs-app-shell .qs-file-action { width: 34px; height: 34px; }
}

body.qs-app-shell #feedDeleteSelected .material-icons, body.qs-app-shell #chatDeleteSelected .material-icons {
    margin-bottom: 5px !important;
}

/* Final alignment override for the confirmation dialog. */
.qs-confirm-modal .modal-header {
    align-items: center;
    justify-content: flex-start;
    text-align: right;
}
.qs-confirm-modal .modal-title {
    align-items: center;
    justify-content: flex-start;
    text-align: right;
}
.qs-confirm-modal .modal-body { text-align: right; }
.qs-confirm-modal .modal-footer {
    align-items: center;
    justify-content: flex-start;
    text-align: right;
}
.qs-confirm-modal #qsConfirmOk,
.qs-confirm-modal #qsConfirmOk:hover,
.qs-confirm-modal #qsConfirmOk:focus,
.qs-confirm-modal #qsConfirmOk:active {
    align-items: center !important;
    justify-content: center !important;
}
