:root {
    --color-page: #dee3e9;
    --color-surface: #fff;
    --color-surface-muted: hsl(0, 0%, 96%);
    --color-border: #ddd;
    --color-border-strong: #c9cce0;
    --color-text: #333;
    --color-text-muted: #666;
    --color-primary: hsl(231, 48%, 48%);
    --color-primary-dark: hsl(231, 48%, 40%);
    --color-primary-link: hsl(221, 69%, 47%);
    --color-focus: #23a1fb;
    --shadow-soft: 0 1px 3px rgba(0,0,0,.22), 0 0 1px rgba(0,0,0,.08);
    --shadow-panel: 0 8px 24px rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.08);
    --radius: 5px;
    --space-1: .35rem;
    --space-2: .55rem;
    --space-3: .8rem;
    --space-4: 1rem;
}

* {
    box-sizing: border-box;
}

html, textarea {
    font-family: sans-serif;
    font-size: 16px;
    line-height: 1.5em;
}
body {
    background-color: var(--color-page);
    background-image: url(bg.png);
    background-attachment: fixed;
    color: var(--color-text);
    margin: 0;
}
h1, h2, h3 {
    margin-top: 0;
}
h1 {
    font-size: 1.2em;
    margin-bottom: 0;
}

img {
    border: 0;
    vertical-align: middle;
}

a {
    text-decoration: none;
    color: var(--color-primary-link);
    transition: color .15s ease, background-color .15s ease;
}
a:hover {
    text-decoration: underline;
}

button, select {
    background: #eee;
    color: #000;
    border: 1px solid var(--color-border);
}
input, textarea {
    background: var(--color-surface);
    color: #000;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
button {
    border-radius: 4px;
    cursor: pointer;
    min-height: 34px;
    padding: .4em .75em;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
button:hover {
    background: #e5e7f5;
    border-color: var(--color-border-strong);
}
button:active {
    transform: translateY(1px);
}
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}
input:focus, textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(73, 86, 181, .14);
}

form {
    margin: 0;
}

table {
    background-color: #f9f9f9;
    border-collapse: collapse;
    border-color: #ccc;
    width: 100%;
}

thead {
    background-color: #ddd;
}

td, th {
    padding: 5px 10px;
    border-color: #ccc;
}

#loginForm input {
    padding: 2px 5px;
}

.module {
    position: relative;
    margin: .7em 0;
    padding: var(--space-3);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius);
}

.wrapper {
    margin: 0 auto;
    max-width: 1000px;
    position: relative;
}
.home {
    margin: 0 auto;
    max-width: 340px;
}

#top {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 3px 9px rgba(0,0,0,.3), 0 0 1px rgba(0,0,0,.1);
    min-height: 44px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}
#top a {
    color: #ddeeff;
}
#top .wrapper {
    min-height: 44px;
    padding: 6px 8px;
}
#top h1 {
    display: flex;
    align-items: center;
    gap: .35em;
    min-height: 32px;
    overflow: hidden;
    white-space: nowrap;
}
#top h1 img {
    max-height: 32px;
}
#menu {
    position: absolute;
    top: 6px;
    right: 8px;
    text-align: right;
    min-height: 32px;
}
#menu a.selected {
    color: hsl(60, 80%, 50%);
}
#menu #contactLink {
    display: none;
}

#notificationZone {
    top: 40px;
    width: 295px;
    max-height: min(320px, calc(100vh - 70px));
    right: 0;
    color: #333;
    margin: 0;
    text-align: left;
    font-size: small;
    overflow: auto;
}
#notificationZone a {
    display: block;
    background: #eee;
    padding: .55em .7em;
    margin: 5px 0;
    color: initial;
    border-radius: 4px;
}
#notificationZone a:hover {
    background: #e6e8f8;
    text-decoration: none;
}

#profilParam {
    top: 40px;
    width: 160px;
    right: 0;
    color: #333;
    margin: 0;
    text-align: left;
}
#profilParam > div {
    text-align: center;
}
#profilParam a {
    color: initial;
}
#profilParam ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
#profilParam li a {
    display: block;
    padding: .35em .2em;
}
#big_profil {
    background: #ccc;
}
#profil, .msg-profil img, .contact img, .group img, .msg form > img {
    border-radius: 50%;
}

body > .wrapper {
    margin-top: 52px;
    padding: 0 10px 12px;
}

#loginForm input, #regForm input, #pwd_form input {
    width: 100%;
    padding: .6em .65em;
}
#loginForm h3 {
    margin-bottom: .8em;
}
#loginForm p, #regForm p, #pwd_form p {
    margin: .65em 0;
}
.btn_contener {
    text-align: right;
}
.btn_contener button, #newMessage button {
    background: var(--color-primary);
    border-color: var(--color-primary-dark);
    color: #fff;
    font-weight: bold;
}
.btn_contener button:hover, #newMessage button:hover {
    background: var(--color-primary-dark);
}

#lang {
    text-align: center;
}
#lang a {
    display: inline-block;
    padding: .15em .25em;
}
#footer {
    color: #222;
    font-size: .95em;
    margin: 1.2em 0 2em;
}
#footer .wrapper {
    padding: 0 8px;
}
#footer img {
    border-radius: 2px;
    max-width: 190px;
}

#regForm {
    display: none;
}

#main {
    display:inline-block;
    vertical-align:top;
    width:640px;
    margin-right: 10px;
    overflow: auto;
}

.msg:first-child {
    margin-top: 0;
}

#side {
    display:inline-block;
    vertical-align:top;
    width:320px;
}
#side .module {
    margin: 0;
    max-height: calc(100vh - 64px);
    overflow: auto;
}

.profilDialog {
    position: absolute;
    width: 120px;
    height: 120px;
    text-align: center;
    z-index: 8;
}
.profilDialog img {
    background: white;
    box-shadow: 0px 4px 8px rgba(0,0,0,.3), 0px 0px 1px rgba(0,0,0,.1);
    border-radius: unset;
}

.optionDialog, .statDialog, .dialog {
    position: absolute;
    background: white;
    padding: 10px;
    border: solid 1px #ccc;
    border-radius: var(--radius);
}

.optionDialog {
    max-width: 270px;
    top: 10px;
    right: 0;
    box-shadow: var(--shadow-panel);
    line-height: 1.5em;
    z-index: 8;
}

.statDialog {
    box-shadow: var(--shadow-panel);
    z-index: 8;
}

.dialog {
    box-shadow: var(--shadow-panel);
    z-index: 9;
    display: none;
}
.statDialog:before {
    content: " ";
    position: absolute;
    left: -16px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #fff;
    pointer-events: none;
}
.buttonZone {
    text-align: right;
}
.dialog .buttonZone {
    margin-top: 10px;
}

.anchormsg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    background-color: rgba(0,0,0,.5);
    z-index: 10;
}
.anchormsg .msg {
    max-width: 600px;
    margin-top: 10px;
    margin-left: calc(50% - 300px);
}
.anchormsg .box {
    max-width: 300px;
    margin-top: 10px;
    margin-left: calc(50% - 150px);
    padding: 10px;
    background: white;
    box-shadow: 0px 1px 3px rgba(0,0,0,.3), 0px 0px 1px rgba(0,0,0,.1);
    border-radius: 5px;
}
.anchormsg .box input {
    width: calc(100% - 10px);
    padding: 5px;
}

#uploadZone {
    text-align: center;
    min-height: 0;
}
#uploadZone:not(:empty) {
    background: #f7f7fb;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius);
    margin-bottom: .5em;
    padding: .5em;
}

.msg {
    position: relative;
    padding: .65em 0 0 0;
    clear: both;
}
.msg-head {
    min-height: 42px;
    padding: 0 2.2em 0 1em;
    position: relative;
    line-height: 1.3em;
}
.msg-profil {
    float: left;
    margin-right: .5em;
    background: transparent;
}
.msg-name {
    color: #3B5998;
    font-weight: bold;
}
.msg-time {
    color: var(--color-text-muted);
    font-size: small;
    height: 1.6em;
    overflow: hidden;
/*
    position: absolute;
    top: 0px;
    right: 30px;
*/
}
.msg .option {
    position: absolute;
    top: 0;
    right: 10px;
    border-radius: 50%;
    padding: 4px;
}
.msg .option:hover, .contact .option:hover, .group .option:hover {
    background: #eef0fb;
    text-decoration: none;
}
.msg-body {
    padding: .2em 1em .65em 1em;
    word-wrap: break-word;
}
.mine .msg-body {
    height: 2em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-foot {
    text-align: center;
    padding: 0 10px;
}
.msg-foot img {
    width: 100%;
}
.msg-foot audio, .msg-foot video {
    width: 100%;
}
.msg button {
    background-color: #f9f9f9;
    color: #666;
    border:0;
}

.comments {
    padding-top: .5em;
    background-color: var(--color-surface-muted);
    border-top: solid 1px #ebebeb;
    font-size: small;
}
.morecomment {
    padding-left: 10px;
}
.comments .msg-time {
    font-size: smaller;
    font-weight: normal;
}
.comment {
    word-wrap: break-word;
}
.deletecomment {
    position: absolute;
    right: .7em;
    top: .1em;
    opacity: .75;
}
.deletecomment:hover {
    opacity: 1;
}

.msg form, .msg input {
    background-color: hsl(0, 0%, 96%);
}
.msg form {
    padding: .5em 1em;
    border-radius: 0 0 var(--radius) var(--radius);
}
.msg input {
    border:0;
    margin: 0;
    padding: 5px 10px;
    width: calc(100% - 20px - 74px);
}
.msg .likebox {
    position: absolute;
    right: 10px;
    bottom: 10px;
}
.msg .like {
    padding-right: 5px;
}

#newMessage {
    margin: 0;
}
#newMessage textarea {
    min-height: 82px;
    padding: .65em;
    width: 100%;
    border: 0;
    resize: vertical;
}
#newMessage .buttonZone {
    align-items: center;
    display: flex;
    gap: .5em;
    justify-content: flex-end;
    padding-top: .45em;
}
#newMessage label {
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 36px;
}
#newMessage label:hover {
    background: #eef0fb;
}

.contact, .group {
    clear: both;
    border-top: solid 1px #eee;
    position: relative;
    padding: .55em .5em;
    min-height: 52px;
    height: auto;
    line-height: 1.3em;
}
.contact:hover, .group:hover {
    background: #f7f8ff;
}
.unread::before, .online::after {
    content: attr(data-new);
    position: absolute;
    top: 5px;
    width: 16px;
    height: 16px;
    color: white;
    font-size: smaller;
    text-align: center;
    border-radius: 50%;
}
.unread::before {
    left: 5px;
    background: red;
    line-height: 1.2em;
}
#menu .unread::before, .online::after {
    top: -3px;
    left: unset;
    right: -10px;
    line-height: 1.4em;
}
.online::after {
    background: #009900;
}

.contact a, .group a {
    display: block;
    text-decoration: none;
}
.contact .option, .group .option {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 4px;
    border-radius: 50%;
}
.contact .option img, .group .option img {
    border-radius: unset;
}

.contact .view {
    color: #999;
    font-size: small;
}
.connected .msg-time, .connected .view, .connected td {
    color: green;
}

#newContact, #newGroup {
    box-shadow: 0px 2px 4px rgba(0,0,0,.3), 0px 0px 1px rgba(0,0,0,.1);
}
#newContact input, #newGroup input {
    padding: .55em .6em;
    width: 100%;
}
#keypad {
    display: none;
    position: fixed;
    bottom:0;
    right:0;
    padding:.2em .5em;
    background-color:#ccc;
    box-shadow: 0px -1px 2px #999;
    text-align:left;
    z-index: 11;
}
#keypad button {
    margin: .3em .2em;
    padding: .2em .5em;
    font-size:1.2em;
}

.clear {
    clear: both;
}

@media (max-width:1000px) {
    #main {
        width: calc(65% - 15px);
    }
    #side {
        width: 35%;
    }
}

@media (max-width:699px) {
    #side, #main {
        width: 100%;
        margin-right: 0;
        margin-top: 90px;
    }
    #side {
        display: none;
    }
    #side .module {
        max-height: unset;
    }
    #menu #contactLink {
        display: inline-block;
    }
    #main {
        display: block;
    }
    .msg-foot video {
        max-height: 70vh;
    }
}

@media (max-width:499px) {
    #top h1 {
        max-width: calc(100vw - 155px);
    }
    #nav {
        position: fixed;
        top: 44px;
        left: 0;
        right: -5px;
        padding: .45em 10px .45em 0;
        background: #fff;
        box-shadow: 0px 3px 9px rgba(0,0,0,.3), 0px 0px 1px rgba(0,0,0,.1);
    }
    #nav a {
        color: #333;
    }
    #nav a.selected {
        color: hsl(210, 100%, 50%);
    }
    body > .wrapper {
        margin-top: 82px;
    }
    .anchormsg .msg {
        width: calc(100% - 20px);
        margin: 10px 10px;
    }
    #notificationZone {
        position: fixed;
        left: 8px;
        right: 8px;
        width: auto;
    }
    #profilParam {
        width: 180px;
    }
    .home {
        max-width: 100%;
    }
    .module {
        margin: .55em 0;
    }
    #newMessage .buttonZone {
        flex-wrap: wrap;
    }
    #newMessage button {
        flex: 1 1 100%;
    }
}
