/* Muffet lab override: Kohana::find_file resolves this file before
   modules/user/media/css/user.css. Keeps only theme-independent functional
   and structural rules; visual unification lives in theme.css */

.user .page-container {
    background: transparent;
}

.vcard dl:first-child {
    margin-top: 0;
}

.widget .login-fields {
    margin-bottom: 0;
}

/* Stay Signed in checkbox: shared by the login page and the sidebar login widget */
body.User-login .checkbox,
.widget .checkbox {
    display: flex;
    align-items: center;
    min-height: 32px;
    margin: 0;
    padding-left: 0;
}

body.User-login .checkbox label,
.widget .checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    line-height: 16px;
    font-weight: 400;
    color: var(--ml-muted);
    cursor: pointer;
}

body.User-login .checkbox label input,
.widget .checkbox label input {
    position: static;
    float: none;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ml-accent);
    cursor: pointer;
}

body.User-login .checkbox label:hover,
body.User-login .checkbox label:has(input:checked),
.widget .checkbox label:hover,
.widget .checkbox label:has(input:checked) {
    color: var(--ml-accent);
}

body.User-login .checkbox label:has(input:checked),
.widget .checkbox label:has(input:checked) {
    font-weight: 600;
}

form .captcha {
    display: block;
}

.message-unread {
    font-weight: bold;
}

.buddy_sent a {
    float: right;
}

.list-group .list-group-item .list-group-chevron {
    color: #BBB;
    float: right;
    margin-top: 5px;
}

.list-group-chevron + .badge {
    margin-right: 10px;
}

.btn-sm .fa,
.btn-xs .fa {
    font-size: 13px;
}

#form-picture {
    height: auto;
}

/* Birthday: three selects on one row (structural only; the look lives in theme.css) */
.dob-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dob-fields > div {
    flex: 1 1 0;
    min-width: 0;
}

.dob-fields select {
    width: 100%;
}

/* User & messages */

/* Shared account surfaces. user.css loads later, so these selectors
   intentionally include the route-specific body class. */
body.User .window-shadow,
body.Message .window-shadow {
    border-color: var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

body.User .panel-default > .panel-heading,
body.Message .panel-default > .panel-heading {
    padding: 18px 22px;
    background: var(--ml-surface);
    border-bottom: 1px solid var(--ml-border);
}

body.User .panel-default > .panel-heading .panel-title,
body.Message .panel-default > .panel-heading .panel-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
    text-transform: none;
    color: var(--ml-ink);
}

body.User .panel .panel-body {
    padding: 24px;
}

body.User .panel .panel-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    background: #fcfcff;
    border-top: 1px solid var(--ml-border);
}

body.User .panel .panel-footer > .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
}

body.User .panel .panel-footer .col-sm-6 {
    width: auto;
    padding: 0;
}

body.User .panel .panel-footer .form-actions-right {
    margin-left: auto;
}

/* Bootstrap's btn-info has no theme definition; match the soft-purple info style (profile status badges etc.) */
.btn-info {
    color: var(--ml-accent);
    background: #f2f0ff;
    border: 1px solid #d8d2ff;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    color: var(--ml-accent);
    background: #e9e5ff;
    border-color: var(--ml-accent);
}

/* text-align cannot move block-level buttons, so push them right with margin
   (still correct when inline-block). Register markup puts panel-footer and
   form-actions-right on one element; both structures are covered */
body.User .panel .panel-footer .form-actions-right .btn,
body.User .panel .panel-footer.form-actions-right .btn {
    margin-left: auto;
}

body.User .panel .panel-footer .btn {
    margin: 0;
}

/* Profile and account navigation */
body.User .nav-pills.nav-stacked {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 10px;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

body.User .nav-pills.nav-stacked > li {
    float: none;
    width: auto;
    margin: 0;
}

body.User .nav-pills.nav-stacked > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--ml-muted);
}

body.User .nav-pills.nav-stacked > li > a:hover,
body.User .nav-pills.nav-stacked > li > a:focus-visible {
    background: #f2f0ff;
    color: var(--ml-accent);
}

body.User .nav-pills.nav-stacked > li.active > a,
body.User .nav-pills.nav-stacked > li.active > a:hover,
body.User .nav-pills.nav-stacked > li.active > a:focus {
    background: var(--ml-button-gradient);
    box-shadow: 0 7px 18px rgba(109, 94, 244, .18);
    color: #fff;
}

body.User-edit #content-body > .row,
body.User-password #content-body > .row,
body.User-photo #content-body > .row {
    margin-bottom: 24px;
}

/* Upload instructions use the same micro-label style as the other account hints. */
body.User-photo #photo-tab blockquote {
    margin: 16px 0 0;
    padding: 12px 14px;
    background: #f8f7ff;
    border: 1px solid #e5e0ff;
    border-left: 3px solid var(--ml-accent);
    border-image: none;
    border-radius: 8px;
}

body.User-photo #photo-tab blockquote small.muted {
    display: block;
    font-family: var(--ml-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .03em;
    line-height: 1.5;
    color: var(--ml-muted);
}

body.User-photo #photo-tab blockquote small.muted + small.muted {
    margin-top: 4px;
}

body.User-photo #photo-tab blockquote strong {
    font-weight: 600;
    color: var(--ml-accent);
}

/* Account form labels and integrated icon fields */
body.User-edit .form-horizontal .control-label,
body.User-reset_password .form-horizontal .control-label,
body.User-confirm_reset_password .form-horizontal .control-label,
body.User-register .form-horizontal .control-label {
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--ml-muted);
}

body.User-password .password-form .control-label,
body.User-photo .control-label {
    display: block;
    margin: 0 0 8px;
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
}

body.User .has-error .control-label {
    color: #dc2626;
}

body.User .input-group {
    display: flex;
    width: 100%;
    max-width: 560px;
}

body.User .input-group .form-control {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

body.User .input-group-addon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin-right: -1px;
    padding-right: 14px;
    padding-left: 14px;
    background: #f8f7ff;
    border-color: var(--ml-control-border);
    border-radius: 8px 0 0 8px;
    color: var(--ml-accent);
}

body.User .input-group > .form-control:last-child {
    border-radius: 0 8px 8px 0;
}

body.User-edit .input-group:has(textarea) {
    display: block;
    max-width: none;
}

body.User-edit .form-horizontal .form-group {
    margin-bottom: 22px;
}

/* Gender options: the two .radio blocks sit in a flex .input-group,
   so they need their own row gap and chip styling. */
body.User-edit .form-horizontal .input-group:has(> .radio) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: none;
}

body.User-edit .form-horizontal .radio {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin: 0;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--ml-control-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

body.User-edit .form-horizontal .radio:hover {
    border-color: #d8d2ff;
    background: #f8f7ff;
}

body.User-edit .form-horizontal .radio:has(input:checked) {
    background: #f2f0ff;
    border-color: var(--ml-accent);
}

body.User-edit .form-horizontal .radio input[type="radio"] {
    position: static;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ml-accent);
}

/* The input lives inside the label, so reset Bootstrap's 20px indent
   and space the control from its text with flex instead. */
body.User-edit .form-horizontal .radio label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-family: var(--ml-font);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ml-ink);
    cursor: pointer;
}

/* Birthday: let month/day/year share the field column evenly instead of
   being squeezed by col-sm-3's 25% width and 15px grid padding. */
body.User-edit .form-horizontal .col-sm-9:has(> .col-sm-3) {
    display: flex;
    gap: 10px;
}

body.User-edit .form-horizontal .col-sm-9:has(> .col-sm-3) > .col-sm-3 {
    float: none;
    flex: 1 1 0;
    width: auto;
    padding: 0;
}

body.User-edit .form-horizontal .col-sm-9:has(> .col-sm-3) select {
    width: 100%;
    height: 44px;
    min-height: 44px;
    font-size: 14px;
}

/* Register page follows the User-edit account form system; its markup differs
   (radio is div.radio > label > input; DOB is .dob-fields > div),
   so it gets its own adaptation */
body.User-register .form-horizontal [role="radiogroup"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.User-register .form-horizontal .radio {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin: 0;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--ml-control-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

body.User-register .form-horizontal .radio:hover {
    border-color: #d8d2ff;
    background: #f8f7ff;
}

body.User-register .form-horizontal .radio:has(input:checked) {
    background: #f2f0ff;
    border-color: var(--ml-accent);
}

/* Bootstrap's .radio assumes input is a label sibling (absolute + negative
   indent); here the input sits inside the label, so reset and let flex align */
body.User-register .form-horizontal .radio label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 0;
    font-family: var(--ml-font);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ml-ink);
    cursor: pointer;
}

body.User-register .form-horizontal .radio input[type="radio"] {
    position: static;
    float: none;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ml-accent);
}

/* Birthday: three equal selects on one row (.select-caret is added in the view) */
body.User-register .dob-fields {
    display: flex;
    gap: 10px;
}

body.User-register .dob-fields > div {
    flex: 1 1 0;
    min-width: 0;
}

body.User-register .dob-fields select {
    width: 100%;
    font-size: 14px;
}

/* Register captcha: input and image share a row. Markup is
   .col-sm-8.captcha-field with direct input + span.captcha-image (no nested
   .row), same spec as the Contact page */
body.User-register .captcha-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

body.User-register .captcha-field .form-control {
    /* col-sm-8 content is only ~250px (280 minus Bootstrap's 15px sides):
       image 132px + 12px gap leaves ~106px, so flex-basis must stay below it
       or wrapping breaks; it grows to the 240px cap on wide viewports */
    flex: 1 1 100px;
    min-width: 100px;
    max-width: 240px;
    width: auto;
}

body.User-register .captcha-image {
    display: inline-flex;
    flex: 0 0 auto;
}

body.User-register .captcha-image img {
    display: block;
    width: auto;
    height: 44px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

body.User-edit .form-horizontal textarea.form-control {
    min-height: 180px;
    resize: vertical;
}

/* Bootstrap floats .form-control inside .input-group; clear it so the hint
   sits below the textarea instead of overlapping its box. */
body.User-edit .form-horizontal .input-group:has(textarea) .help-block {
    clear: both;
    margin-top: 0;
    padding-top: 9px;
}

body.User .panel .help-block,
body.User .panel .charleft {
    margin-top: 7px;
    font-family: var(--ml-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .03em;
    line-height: 1.5;
    color: var(--ml-muted);
}

body.User .form-control:focus {
    background: #fff;
}

/* Profile card, identity and statistics */
body.User-view #content-body > .row.vcard {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin: 0;
}

/* Bootstrap's clearfix pseudo-elements become flex items and eat the gaps. */
body.User-view #content-body > .row.vcard::before,
body.User-view #content-body > .row.vcard::after {
    display: none;
}

body.User-view #content-body > .row.vcard > .col-md-9 {
    width: calc(75% - 12px);
    padding: 28px;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

body.User-view #content-body > .row.vcard > .col-sidebar-right {
    width: calc(25% - 12px);
    padding: 0;
    border: 0;
}

body.User-view .vcard > .col-md-9 > .row {
    margin-right: 0;
    margin-left: 0;
}

/* Give the left nav enough room so labels stay on one line. */
body.User-view .vcard > .col-md-9 > .row > .col-md-3 {
    width: 32%;
}

body.User-view .vcard > .col-md-9 > .row > .col-md-9 {
    width: 68%;
}

body.User-view .vcard-avatar {
    max-width: 220px;
    margin: 0 auto 22px;
    padding: 16px;
    background: #f8f7ff;
    border: 1px solid #e5e0ff;
    border-radius: 16px;
}

body.User-view .vcard-avatar img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(18, 20, 43, .08);
}

body.User-view .vcard .col-md-3:not(.col-sidebar-right) > .list-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

body.User-view .vcard .col-md-3:not(.col-sidebar-right) > .list-group .list-group-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    background: #fcfcff;
    border: 1px solid var(--ml-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ml-muted);
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}

body.User-view .vcard .col-md-3:not(.col-sidebar-right) > .list-group .list-group-item:hover,
body.User-view .vcard .col-md-3:not(.col-sidebar-right) > .list-group .list-group-item:focus-visible {
    background: #f2f0ff;
    border-color: #d8d2ff;
    color: var(--ml-accent);
    transform: translateX(2px);
}

body.User-view .vcard .list-group-chevron {
    float: none;
    margin-left: auto;
    color: #a5aabc;
    transition: color .15s;
}

body.User-view .vcard .col-md-3:not(.col-sidebar-right) > .list-group .list-group-item:hover .list-group-chevron,
body.User-view .vcard .col-md-3:not(.col-sidebar-right) > .list-group .list-group-item:focus-visible .list-group-chevron {
    color: var(--ml-accent);
}

body.User-view .vcard-names {
    margin: 4px 0 24px;
}

body.User-view .vcard-names > span {
    display: block;
    margin-bottom: 8px;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.03em;
    color: var(--ml-ink);
}

body.User-view .vcard-names > em {
    display: block;
    margin: 0;
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 500;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ml-accent);
}

body.User-view .vcard-details {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 0;
    border: 0;
}

body.User-view .vcard-details > .col-md-7 {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

body.User-view .vcard-details > .col-md-5 {
    flex: 0 0 auto;
    width: auto;
}

body.User-view .vcard-details time[itemprop="birthDate"] {
    white-space: nowrap;
}

body.User-view .vcard-details dl {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 16px;
    line-height: 1.6;
}

body.User-view .vcard-details dt {
    display: flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    background: #f2f0ff;
    border-radius: 8px;
    color: var(--ml-accent);
}

body.User-view .vcard-details dd {
    flex: 1 1 auto;
    min-width: 0;
    /* 20px text line centered against the 32px icon (row uses flex-start). */
    margin: 6px 0 0;
    overflow: visible;
    color: var(--ml-muted);
    overflow-wrap: anywhere;
}

body.User-view .vcard-details .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.User-view .vcard-details .tagcloud span {
    padding: 2px 9px;
    background: #f2f0ff;
    border-radius: 999px;
    font-family: var(--ml-mono);
    font-size: 11px;
    color: var(--ml-accent);
}

body.User-view .vcard-details + hr {
    margin: 24px 0 20px;
    border-top: 1px solid var(--ml-border);
}

body.User-view .bio p {
    margin: 0;
    color: var(--ml-muted);
    line-height: 1.9;
    white-space: pre-line;
}

body.User-view .col-sidebar-right > .list-group {
    overflow: hidden;
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

body.User-view .col-sidebar-right > .list-group .list-group-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    padding: 18px 20px;
    background: var(--ml-surface);
    border: 0;
    border-bottom: 1px solid var(--ml-border);
    color: inherit;
    text-decoration: none;
    transition: background-color .15s;
}

body.User-view .col-sidebar-right > .list-group .list-group-item:last-child {
    border-bottom: 0;
}

body.User-view .col-sidebar-right > .list-group .list-group-item:hover,
body.User-view .col-sidebar-right > .list-group .list-group-item:focus-visible {
    background: #f2f0ff;
}

body.User-view .col-sidebar-right .list-group-item-heading {
    grid-column: 1;
    grid-row: 1;
    float: none;
    margin: 0;
    font-family: var(--ml-mono);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ml-ink);
    transition: color .15s;
}

body.User-view .col-sidebar-right > .list-group .list-group-item:hover .list-group-item-heading,
body.User-view .col-sidebar-right > .list-group .list-group-item:focus-visible .list-group-item-heading {
    color: var(--ml-accent);
}

body.User-view .col-sidebar-right .list-group-item-text {
    grid-column: 1;
    grid-row: 2;
    margin: 4px 0 0;
    font-family: var(--ml-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ml-muted);
}

body.User-view .col-sidebar-right .list-group-item h3 {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    float: none !important;
    width: 34px;
    height: 34px;
    margin: 0;
    background: #f2f0ff;
    border-radius: 9px;
    color: var(--ml-accent);
    transition: background-color .15s, color .15s, transform .15s;
}

body.User-view .col-sidebar-right > .list-group .list-group-item:hover h3,
body.User-view .col-sidebar-right > .list-group .list-group-item:focus-visible h3 {
    background: var(--ml-accent);
    color: #fff;
    transform: translateX(2px);
}

body.User-view .col-sidebar-right .panel-info,
body.User #content-body .list-all.panel {
    overflow: hidden;
    border-color: var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

body.User-view .col-sidebar-right .panel-info > .panel-heading,
body.User #content-body .list-all.panel > .panel-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 17px 20px;
    background: var(--ml-surface);
    border-bottom: 1px solid var(--ml-border);
}

body.User #content-body .list-all .panel-heading .col-md-6 {
    float: none;
    width: auto;
    padding: 0;
}

body.User #content-body .list-all .panel-heading .col-md-6:first-child {
    flex: 1 1 auto;
}

body.User #content-body .list-all .panel-heading .col-md-6:last-child {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

body.User #content-body .list-all .panel-heading .btn {
    margin: 0;
}

body.User #content-body .list-all .panel-heading .clearfix {
    display: none;
}

body.User #content-body .list-all .panel-heading h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

/* Friend requests and lists */
body.User #content-body .list-all .friend-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 20px;
    background: var(--ml-surface);
    border-bottom: 1px solid var(--ml-border);
}

body.User #content-body .list-all .friend-item:last-child {
    border-bottom: 0;
}

body.User #content-body .list-all .friend-item:hover {
    background: #fcfcff;
}

body.User #content-body .friend-item > [class*="col-md-"] {
    float: none;
    width: auto;
    padding: 0;
}

body.User #content-body .friend-item > [class*="col-md-"]:first-child {
    flex: 0 0 92px;
}

body.User #content-body .friend-item > [class*="col-md-"]:nth-child(2) {
    flex: 1 1 320px;
    min-width: 0;
}

body.User #content-body .friend-item img {
    display: block;
    width: 80px;
    height: 80px;
    border: 1px solid var(--ml-border);
    border-radius: 12px;
}

body.User #content-body .friend-item a:not(.btn):not(.action-view) {
    color: var(--ml-muted);
    overflow-wrap: anywhere;
}

body.User #content-body .friend-item .action-view {
    font-weight: 600;
}

body.User #content-body .friend-item > [class*="col-md-"]:last-child .btn {
    margin: 0 4px 6px 0;
}

body.User #content-body .friend-item .action-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border-radius: 8px;
    color: #dc2626;
}

body.User #content-body .friend-item .action-delete:hover {
    background: #fef2f2;
}

/* Message lists and DataTables 2 controls */
body.Message-inbox #content-body .content {
    padding: 24px;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

body.Message-inbox .bulk-actions {
    min-width: 0;
    margin: 0 0 20px;
    padding: 16px;
    background: #f8f7ff;
    border: 1px solid #e5e0ff;
    border-radius: var(--ml-radius);
}

body.Message-inbox .bulk-actions .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0;
}

body.Message-inbox .bulk-actions .form-group {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
}

body.Message-inbox .bulk-actions select.form-control {
    width: 210px;
}

body.Message-inbox .bulk-actions .btn {
    width: auto;
}

body.Message-inbox .bulk-actions .form-actions-right {
    margin-left: auto;
}

body.Message-inbox .dt-container {
    width: 100%;
}

body.Message-inbox .dt-container .dt-layout-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    margin: 0 0 16px;
}

/* Bootstrap's .row clearfix pseudo-elements become flex items and add a
   phantom 14px gap before the first and after the last toolbar cell. */
body.Message-inbox .dt-container .dt-layout-row::before,
body.Message-inbox .dt-container .dt-layout-row::after {
    content: none;
    display: none;
}

body.Message-inbox .dt-container .dt-layout-row:last-child {
    margin: 16px 0 0;
}

body.Message-inbox .dt-container .dt-layout-row > .dt-layout-cell:not(.dt-layout-full) {
    width: auto;
    padding: 0;
}

body.Message-inbox .dt-container .dt-length {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ml-muted);
}

body.Message-inbox .dt-container .dt-length select {
    width: auto;
    min-width: 76px;
    height: 38px;
    min-height: 38px;
    padding: 6px 10px;
}

body.Message-inbox .dt-container .dt-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

body.Message-inbox .dt-container .dt-search input {
    width: 230px;
    height: 38px;
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 8px;
}

body.Message-inbox div.dt-container div.dt-layout-row div.dt-layout-full {
    display: block;
    float: none;
    width: 100%;
    padding: 0;
    overflow-x: auto;
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
}

body.Message-inbox .dt-container .dt-layout-table {
    display: block;
    width: 100%;
}

body.Message-inbox #user-message-inbox {
    min-width: 680px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
}

body.Message-inbox #user-message-inbox .dt-empty {
    padding: 26px 16px;
    background: var(--ml-surface);
    text-align: center;
    color: var(--ml-muted);
}

body.Message-inbox #user-message-inbox > thead > tr > th {
    padding: 14px 16px;
    background: #f8f7ff;
    border-bottom: 1px solid var(--ml-border);
    font-family: var(--ml-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
    white-space: nowrap;
}

body.Message-inbox #user-message-inbox > tbody > tr > td {
    padding: 14px 16px;
    border-color: var(--ml-border);
    vertical-align: middle;
}

body.Message-inbox #user-message-inbox.table-striped > tbody > tr:nth-of-type(odd) {
    background: #fcfcff;
}

body.Message-inbox #user-message-inbox > tbody > tr:hover {
    background: #f7f5ff;
}

body.Message-inbox #user-message-inbox a:not(.btn) {
    overflow-wrap: anywhere;
}

body.Message-inbox #user-message-inbox .message-unread,
body.Message-inbox #user-message-inbox .message-unread a {
    font-weight: 700;
    color: var(--ml-accent);
}

body.Message-inbox #user-message-inbox .message-read,
body.Message-inbox #user-message-inbox .message-read a,
body.Message-inbox #user-message-inbox .message-draft,
body.Message-inbox #user-message-inbox .message-draft a {
    color: var(--ml-muted);
}

body.Message-inbox #user-message-inbox .action-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #dc2626;
    opacity: .7;
}

body.Message-inbox #user-message-inbox .action-delete:hover,
body.Message-inbox #user-message-inbox .action-delete:focus-visible {
    background: #fef2f2;
    opacity: 1;
}

body.Message-inbox .dt-container .dt-info {
    padding-top: 0;
    color: var(--ml-muted);
}

body.Message-inbox .dt-container .dt-paging .pagination {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The li is only a wrapper: the real button is the inner <a>/<span>,
   otherwise Bootstrap's .pagination > li > a borders stack on top of ours. */
body.Message-inbox .dt-container .dt-paging .pagination > li.dt-paging-button {
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    line-height: 1;
}

body.Message-inbox .dt-container .dt-paging .pagination > li > a,
body.Message-inbox .dt-container .dt-paging .pagination > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--ml-border);
    border-radius: 8px;
    background: #fff;
    color: var(--ml-muted);
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

body.Message-inbox .dt-container .dt-paging .pagination > li > a:hover,
body.Message-inbox .dt-container .dt-paging .pagination > li > a:focus {
    border-color: #d8d2ff;
    background: #f2f0ff;
    color: var(--ml-accent);
    text-decoration: none;
}

body.Message-inbox .dt-container .dt-paging .pagination > li.active > a,
body.Message-inbox .dt-container .dt-paging .pagination > li > a.current,
body.Message-inbox .dt-container .dt-paging .pagination > li.active > a:hover {
    background: var(--ml-button-gradient);
    border-color: transparent;
    color: #fff;
}

body.Message-inbox .dt-container .dt-paging .pagination > li.disabled > a,
body.Message-inbox .dt-container .dt-paging .pagination > li.disabled > a:hover,
body.Message-inbox .dt-container .dt-paging .pagination > li > a[aria-disabled="true"] {
    background: #f8f9fc;
    border-color: var(--ml-border);
    color: #b0b5c4;
    cursor: not-allowed;
}

/* Message editor */
body.Message-compose form.message-form {
    margin: 0;
    padding: 28px;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

body.Message-compose form.message-form .form-group {
    margin: 0 0 20px;
}

body.Message-compose form.message-form .control-label {
    display: block;
    margin: 0 0 8px;
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
}

body.Message-compose form.message-form .has-error .control-label {
    color: #dc2626;
}

body.Message-compose form.message-form .input-group {
    display: flex;
    width: auto;
    max-width: 340px;
}

body.Message-compose form.message-form .input-group-addon {
    display: flex;
    align-items: center;
    flex: 0 0 112px;
    width: 112px;
    padding-right: 14px;
    padding-left: 14px;
    background: #f8f7ff;
    border-color: var(--ml-control-border);
    border-radius: 8px 0 0 8px;
    font-family: var(--ml-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ml-muted);
}

body.Message-compose form.message-form .input-group .form-control {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border-radius: 0 8px 8px 0;
}

body.Message-compose form.message-form .checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 32px;
    margin: 0;
}

body.Message-compose form.message-form .checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    line-height: 16px;
    color: var(--ml-muted);
    cursor: pointer;
}

body.Message-compose form.message-form .checkbox label input {
    position: static;
    float: none;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ml-accent);
    cursor: pointer;
}

body.Message-compose form.message-form .checkbox label:hover,
body.Message-compose form.message-form .checkbox label:has(input:checked) {
    color: var(--ml-accent);
}

body.Message-compose form.message-form .checkbox label:has(input:checked) {
    font-weight: 600;
}

body.Message-compose form.message-form > .row:last-of-type {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 28px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--ml-border);
}

body.Message-compose form.message-form > .row:last-of-type .col-sm-6 {
    width: auto;
    padding: 0;
}

body.Message-compose form.message-form > .row:last-of-type .form-actions-right {
    margin-left: auto;
}

body.Message-compose form.message-form > .row:last-of-type .btn {
    margin: 0;
}

/* Related message routes currently expose a placeholder rather than a list. */
body.Message-outbox #content-body .content,
body.Message-drafts #content-body .content,
body.Message-list #content-body .content {
    padding: 54px 24px;
    background: var(--ml-surface);
    border: 1px dashed #d8d2ff;
    border-radius: var(--ml-radius);
    text-align: center;
}

body.Message-outbox #content-body .content p,
body.Message-drafts #content-body .content p,
body.Message-list #content-body .content p {
    margin: 0;
    font-family: var(--ml-mono);
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--ml-muted);
}

/* Responsive */

@media (max-width: 991px) {
    body.User-edit #content-body > .row > .col-md-3,
    body.User-password #content-body > .row > .col-md-3,
    body.User-photo #content-body > .row > .col-md-3 {
        margin-bottom: 20px;
    }

    body.User-view #content-body > .row.vcard {
        display: block;
    }

    body.User-view #content-body > .row.vcard > .col-md-9,
    body.User-view #content-body > .row.vcard > .col-sidebar-right,
    body.User-view .vcard > .col-md-9 > .row > .col-md-3,
    body.User-view .vcard > .col-md-9 > .row > .col-md-9 {
        width: 100%;
    }

    body.User-view #content-body > .row.vcard > .col-sidebar-right {
        margin-top: 20px;
    }

    body.User-view .col-sidebar-right > .list-group {
        display: flex;
    }

    body.User-view .col-sidebar-right > .list-group .list-group-item {
        flex: 1 1 0;
        border-right: 1px solid var(--ml-border);
        border-bottom: 0;
    }

    body.User-view .col-sidebar-right > .list-group .list-group-item:last-child {
        border-right: 0;
    }
}

@media (max-width: 767px) {
    body.User .panel .panel-body {
        padding: 20px;
    }

    body.User .panel .panel-footer,
    body.User .panel .panel-footer > .row {
        padding-right: 20px;
        padding-left: 20px;
    }

    body.User-edit .form-horizontal .form-group {
        display: block;
    }

    body.User-edit .form-horizontal .control-label,
    body.User-reset_password .form-horizontal .control-label,
    body.User-confirm_reset_password .form-horizontal .control-label {
        float: none;
        width: auto;
        margin: 0 0 8px;
    }

    body.User-edit .form-horizontal .form-group > [class*="col-"] {
        width: 100%;
        padding: 0;
    }

    body.User-edit .form-horizontal .col-sm-9 > .col-sm-3 {
        float: left;
        width: 33.3333%;
        padding-right: 8px;
        padding-left: 0;
    }

    body.User-view #content-body > .row.vcard > .col-md-9 {
        padding: 20px;
    }

    body.User-view .vcard > .col-md-9 > .row {
        display: block;
    }

    body.User-view .vcard-avatar {
        width: 180px;
    }

    body.User-view .vcard .col-md-3 > .list-group {
        margin-bottom: 26px;
    }

    body.User-view .vcard-names > span {
        font-size: 30px;
    }

    body.User-view .vcard-details {
        display: block;
    }

    body.User-view .vcard-details .row {
        margin: 0;
    }

    body.User-view .vcard-details .col-md-7,
    body.User-view .vcard-details .col-md-5 {
        width: 100%;
        padding: 0;
    }

    body.User-view .col-sidebar-right > .list-group {
        display: block;
    }

    body.User-view .col-sidebar-right > .list-group .list-group-item {
        border-right: 0;
        border-bottom: 1px solid var(--ml-border);
    }

    body.User #content-body .list-all .panel-heading .col-md-6:last-child {
        width: 100%;
        justify-content: flex-start;
    }

    body.User #content-body .list-all .friend-item {
        padding: 18px;
    }

    body.Message-inbox #content-body .content {
        padding: 16px;
    }

    body.Message-inbox .bulk-actions {
        padding: 14px;
    }

    body.Message-inbox .bulk-actions .row {
        align-items: stretch;
    }

    body.Message-inbox .bulk-actions .form-group {
        width: 100%;
    }

    body.Message-inbox .bulk-actions select.form-control,
    body.Message-inbox .bulk-actions .btn {
        width: 100%;
    }

    body.Message-inbox .bulk-actions .form-actions-right {
        margin-left: 0;
    }

    body.Message-inbox .dt-container .dt-layout-row {
        align-items: stretch;
        flex-direction: column;
    }

    body.Message-inbox .dt-container .dt-search input {
        width: 100%;
        min-width: 0;
    }

    body.Message-inbox .dt-container .dt-paging {
        overflow-x: auto;
    }

    body.Message-compose form.message-form {
        padding: 20px;
    }

    body.Message-compose form.message-form .input-group {
        width: 100%;
        max-width: none;
    }

    body.Message-compose form.message-form > .row:last-of-type .col-sm-6,
    body.Message-compose form.message-form > .row:last-of-type .form-actions-right {
        width: 100%;
        margin-left: 0;
    }

    body.Message-compose form.message-form > .row:last-of-type .btn {
        display: block;
        width: 100%;
    }
}
