main > .container {
    padding: 70px 15px 20px;
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer > .container {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
    .nav li > form > button.logout {
        display:block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

.tgmsg-page__header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.tgmsg-page__header h1,
.tgmsg-form-page h1 {
    font-size: 28px;
    margin: 0;
}

.tgmsg-compose__main {
    max-width: 960px;
}

.tgmsg-field {
    margin-bottom: 16px;
}

.tgmsg-contact-list {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-top: 8px;
    max-height: 360px;
    overflow: auto;
    padding: 10px;
}

.tgmsg-contact-group + .tgmsg-contact-group {
    border-top: 1px solid #e9ecef;
    margin-top: 12px;
    padding-top: 12px;
}

.tgmsg-contact-group h2 {
    color: #6c757d;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.tgmsg-contact-option {
    align-items: center;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #212529;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin: 0 0 6px;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.tgmsg-contact-option:hover,
.tgmsg-contact-option.is-selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .12);
}

.tgmsg-contact-option__main,
.tgmsg-contact-name,
.tgmsg-contact-view-heading,
.tgmsg-avatar-form {
    align-items: center;
    display: flex;
    gap: 10px;
}

.tgmsg-contact-option__main {
    min-width: 0;
}

.tgmsg-contact-option__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tgmsg-contact-option small {
    color: #6c757d;
}

.tgmsg-contact-name__text {
    min-width: 0;
}

.tgmsg-hint-icon {
    align-items: center;
    background: #eef4ff;
    border: 1px solid #cfe2ff;
    border-radius: 50%;
    color: #0056b3;
    cursor: help;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    line-height: 1;
    margin-left: 4px;
    vertical-align: text-top;
    width: 18px;
}

.tgmsg-hint-icon:focus {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .2);
    outline: none;
}

.tgmsg-selected-contact {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin: 4px 0 14px;
    padding: 10px 12px;
}

.tgmsg-selected-contact__label {
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.tgmsg-selected-contact__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tgmsg-selected-contact__body small {
    color: #6c757d;
}

.tgmsg-avatar {
    align-items: center;
    aspect-ratio: 1;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    color: #495057;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 700;
    justify-content: center;
    object-fit: cover;
    overflow: hidden;
    text-transform: uppercase;
}

.tgmsg-avatar--xs {
    font-size: 11px;
    height: 22px;
    width: 22px;
}

.tgmsg-avatar--sm {
    font-size: 13px;
    height: 32px;
    width: 32px;
}

.tgmsg-avatar--md {
    font-size: 16px;
    height: 44px;
    width: 44px;
}

.tgmsg-avatar--lg {
    font-size: 22px;
    height: 72px;
    width: 72px;
}

.tgmsg-avatar-form {
    align-items: flex-start;
    margin-bottom: 16px;
}

.tgmsg-avatar-form__fields {
    flex: 1;
}

.tgmsg-chip-row {
    margin: 12px 0 18px;
}

.tgmsg-chip-row__label {
    color: #495057;
    font-weight: 700;
    margin-bottom: 6px;
}

.tgmsg-chip {
    background: #e9f5ff;
    border: 1px solid #b8ddff;
    border-radius: 6px;
    color: #0056b3;
    margin: 0 6px 6px 0;
    padding: 5px 9px;
}

.tgmsg-chip--contact {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    vertical-align: middle;
}

.tgmsg-chip--template {
    background: #f1f3f5;
    border-color: #dee2e6;
    color: #343a40;
}

.tgmsg-template-contact-picker {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
}

.tgmsg-template-contact-toolbar {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1fr) auto auto;
}

.tgmsg-template-contact-summary {
    color: #495057;
    white-space: nowrap;
}

.tgmsg-template-contact-hint,
.tgmsg-template-contact-empty {
    color: #6c757d;
    margin-top: 8px;
}

.tgmsg-template-contact-list {
    border-top: 1px solid #e9ecef;
    margin-top: 12px;
    max-height: 440px;
    overflow: auto;
    padding-top: 4px;
}

.tgmsg-template-contact-group {
    border-bottom: 1px solid #e9ecef;
    padding: 8px 0;
}

.tgmsg-template-contact-group:last-child {
    border-bottom: 0;
}

.tgmsg-template-contact-group summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 8px;
    font-weight: 700;
}

.tgmsg-template-contact-group summary small {
    background: #f1f3f5;
    border-radius: 999px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 7px;
}

.tgmsg-template-contact-group__actions {
    display: flex;
    gap: 8px;
    margin: 4px 0 8px 18px;
}

.tgmsg-template-contact-group__actions .btn {
    padding: 0;
}

.tgmsg-template-contact-options {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    padding-left: 18px;
}

.tgmsg-template-contact-option {
    align-items: flex-start;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    margin: 0;
    min-width: 0;
    padding: 8px;
}

.tgmsg-template-contact-option:hover,
.tgmsg-template-contact-option:focus-within {
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .12);
}

.tgmsg-template-contact-option input {
    margin-top: 3px;
}

.tgmsg-template-contact-option__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tgmsg-template-contact-option__text strong,
.tgmsg-template-contact-option__text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tgmsg-template-contact-option__text small {
    color: #6c757d;
}

.tgmsg-html-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin: -8px 0 18px;
    padding: 10px 12px 6px;
}

.tgmsg-html-panel__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tgmsg-html-tag {
    background: #fff;
    border-color: #ced4da;
    color: #212529;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.25;
    margin: 0;
    min-width: 34px;
}

.tgmsg-html-tag:hover,
.tgmsg-html-tag:focus {
    background: #e9f5ff;
    border-color: #80bdff;
    color: #0056b3;
}

.tgmsg-plain-html-warning {
    background: #fff8e1;
    border: 1px solid #ffe08a;
    border-radius: 6px;
    color: #7a5a00;
    margin: -8px 0 16px;
    padding: 8px 10px;
}

.tgmsg-plain-html-warning[hidden] {
    display: none;
}

.tgmsg-parse-mode-list {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
}

.tgmsg-parse-mode-list label {
    align-items: center;
    display: flex;
    font-weight: 400;
    gap: 6px;
    margin: 0;
}

.tgmsg-parse-mode-list input[type="radio"] {
    margin: 0;
    position: static;
}

.tgmsg-form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(180px, 240px) 1fr;
}

.tgmsg-attachment-preview {
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding: 8px;
}

.tgmsg-attachment-preview[hidden],
.tgmsg-attachment-warning[hidden] {
    display: none;
}

.tgmsg-attachment-preview__image {
    border-radius: 4px;
    flex: 0 0 auto;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.tgmsg-attachment-preview__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.tgmsg-attachment-preview__body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tgmsg-attachment-preview__body small,
.tgmsg-attachment-warning {
    color: #6c757d;
}

.tgmsg-attachment-warning {
    margin-top: 6px;
}

.tgmsg-filter-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 12px;
}

.tgmsg-filter-form {
    align-items: flex-start;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(140px, .8fr) auto;
}

.tgmsg-filter-form .form-group {
    margin-bottom: 0;
}

.tgmsg-filter-form__actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.tgmsg-raw-error {
    background: rgba(255, 255, 255, .75);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 4px;
    margin: 8px 0 0;
    padding: 8px;
    white-space: pre-wrap;
}

.tgmsg-history-text {
    max-width: 360px;
    white-space: pre-wrap;
}

.tgmsg-drag-column {
    text-align: center;
    width: 42px;
}

.tgmsg-drag-handle {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #6c757d;
    cursor: grab;
    display: inline-flex;
    font-size: 18px;
    height: 28px;
    justify-content: center;
    line-height: 1;
    user-select: none;
    width: 28px;
}

.tgmsg-drag-handle:hover,
.tgmsg-drag-handle:focus {
    background: #e9f5ff;
    border-color: #b8ddff;
    color: #0056b3;
}

.tgmsg-sortable-row.is-dragging {
    opacity: .45;
}

.tgmsg-reorder-status {
    color: #6c757d;
    min-height: 22px;
    padding-top: 8px;
}

.tgmsg-reorder-status--success {
    color: #218838;
}

.tgmsg-reorder-status--error {
    color: #c82333;
}

.tgmsg-reorder-status--saving {
    color: #6c757d;
}

@media(max-width: 991px) {
    .tgmsg-filter-form,
    .tgmsg-form-grid,
    .tgmsg-template-contact-toolbar {
        grid-template-columns: 1fr;
    }
}
