:root{
    --bg:#080c11;
    --sidebar:#0b1117;
    --panel:#10171e;
    --panel2:#151d25;
    --line:#27323d;
    --gold:#c89442;
    --gold2:#e0b66b;
    --text:#f2efe8;
    --muted:#929eaa;
    --danger:#e76772;
    --success:#68c88e;
}

*{box-sizing:border-box}

body{
    margin:0;
    min-height:100vh;
    background:
        radial-gradient(circle at 80% 0,rgba(200,148,66,.07),transparent 25%),
        var(--bg);
    color:var(--text);
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

a{color:inherit;text-decoration:none}
button,input,textarea{font:inherit}

.mail-layout{
    min-height:100vh;
    display:grid;
    grid-template-columns:260px 1fr;
}

.sidebar{
    position:relative;
    min-height:100vh;
    padding:22px 16px;
    background:var(--sidebar);
    border-right:1px solid #1f2933;
}

.brand{
    display:flex;
    flex-direction:column;
    align-items:center;
    margin-bottom:24px;
}

.stars{
    color:var(--gold);
    font-size:9px;
    letter-spacing:.5em;
}

.brand-title{
    margin-top:5px;
    font-family:Georgia,serif;
    font-size:27px;
    font-style:italic;
    font-weight:700;
}

.brand-title b{color:var(--gold2)}

.compose-btn{
    display:block;
    padding:12px;
    margin-bottom:18px;
    border:1px solid #aa772f;
    border-radius:9px;
    background:linear-gradient(90deg,#71501f,#a87329);
    text-align:center;
    font-size:13px;
    font-weight:900;
}

.nav{
    display:grid;
    gap:4px;
}

.nav a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:11px 12px;
    border-radius:8px;
    color:#9ba6b1;
    font-size:13px;
}

.nav a:hover,.nav a.active{
    background:#17212b;
    color:#fff;
}

.count{
    display:inline-flex;
    min-width:21px;
    height:21px;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:var(--gold);
    color:#160f05;
    font-size:10px;
    font-weight:900;
}

.sidebar-bottom{
    position:absolute;
    left:16px;
    right:16px;
    bottom:18px;
}

.account-box{
    display:flex;
    flex-direction:column;
    padding:12px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#0e151c;
}

.account-box strong{font-size:13px}
.account-box span{margin-top:2px;color:var(--gold2);font-size:11px}
.account-box a{margin-top:8px;color:#9da7b0;font-size:11px}

.main{
    min-width:0;
    padding:26px 30px;
}

.topbar{
    margin-bottom:20px;
}

.topbar h1{
    margin:0;
    font-size:29px;
}

.topbar span{
    color:var(--muted);
    font-size:12px;
}

.alert{
    padding:11px 12px;
    margin-bottom:14px;
    border-radius:8px;
    font-size:13px;
}

.alert.success{
    color:#c8f4d7;
    border:1px solid rgba(104,200,142,.35);
    background:rgba(104,200,142,.11);
}

.alert.error{
    color:#ffc2c7;
    border:1px solid rgba(231,103,114,.35);
    background:rgba(231,103,114,.11);
}

.mail-list{
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--panel);
}

.mail-row{
    display:grid;
    grid-template-columns:240px 1fr 145px;
    gap:16px;
    align-items:center;
    padding:14px 16px;
    border-bottom:1px solid #222c35;
}

.mail-row:last-child{border-bottom:0}
.mail-row:hover{background:#131c24}

.mail-row.unread{
    background:#151d24;
    box-shadow:inset 3px 0 0 var(--gold);
}

.mail-sender{
    display:flex;
    flex-direction:column;
    font-size:13px;
    font-weight:800;
}

.mail-sender small{
    color:var(--muted);
    font-size:10px;
    font-weight:500;
}

.mail-subject{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.mail-subject strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:13px;
}

.mail-subject span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:var(--muted);
    font-size:11px;
}

.mail-row time{
    color:var(--muted);
    font-size:10px;
    text-align:right;
}

.empty{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
    padding:50px 20px;
    color:var(--muted);
    text-align:center;
}

.compose-card,
.message-card{
    max-width:900px;
    padding:22px;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--panel);
}

.compose-card form{
    display:grid;
    gap:14px;
}

.compose-card label,
.auth-card label{
    display:grid;
    gap:6px;
    color:#bdc5cc;
    font-size:12px;
    font-weight:700;
}

input,textarea{
    width:100%;
    padding:11px 12px;
    border:1px solid #303d49;
    border-radius:8px;
    background:#0a1016;
    color:#fff;
    outline:none;
}

input:focus,textarea:focus{border-color:var(--gold)}

textarea{
    min-height:340px;
    resize:vertical;
}

.primary,.secondary,.danger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 13px;
    border-radius:8px;
    cursor:pointer;
    font-size:12px;
    font-weight:900;
}

.primary{
    border:1px solid #ac772e;
    background:linear-gradient(90deg,#72501e,#aa762b);
    color:#fff7e9;
}

.secondary{
    border:1px solid #35414d;
    background:#18212a;
    color:#fff;
}

.danger{
    border:1px solid #74373d;
    background:#472429;
    color:#ffd6d9;
}

.auto{width:auto}

.compose-actions,
.message-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
}

.message-head{
    display:flex;
    justify-content:space-between;
    gap:20px;
    padding-bottom:18px;
    border-bottom:1px solid #27313a;
}

.message-head h2{
    margin:0 0 7px;
    font-size:23px;
}

.message-meta{
    color:var(--muted);
    font-size:12px;
}

.message-head time{
    color:var(--muted);
    font-size:11px;
}

.message-body{
    min-height:250px;
    padding:28px 0;
    white-space:normal;
    line-height:1.7;
}

.message-actions{
    padding-top:17px;
    border-top:1px solid #27313a;
}

.contact-form{
    display:grid!important;
    grid-template-columns:1fr 1fr auto;
    gap:8px!important;
}

.compose-card.compact{margin-bottom:14px}

.contact-list{
    max-width:900px;
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--panel);
}

.contact-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:13px 15px;
    border-bottom:1px solid #222c35;
}

.contact-row:last-child{border-bottom:0}

.contact-row>div{
    display:flex;
    flex-direction:column;
}

.contact-row span{
    color:var(--muted);
    font-size:11px;
}

.auth-page{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:24px;
}

.auth-card{
    width:min(440px,100%);
    padding:30px;
    border:1px solid rgba(200,148,66,.35);
    border-radius:16px;
    background:#10171ef5;
    box-shadow:0 30px 90px rgba(0,0,0,.5);
}

.auth-brand{
    display:flex;
    flex-direction:column;
    align-items:center;
    margin-bottom:25px;
}

.auth-card h1{margin:0 0 8px}
.auth-card>p{color:var(--muted);font-size:13px}
.auth-card form{display:grid;gap:13px}

.auth-footer{
    margin-top:18px;
    color:var(--muted);
    font-size:12px;
    text-align:center;
}

.auth-footer a{color:var(--gold2)}

.address-field{
    display:grid;
    grid-template-columns:1fr auto;
    align-items:center;
}

.address-field input{
    border-radius:8px 0 0 8px;
}

.address-field span{
    height:100%;
    display:flex;
    align-items:center;
    padding:0 11px;
    border:1px solid #303d49;
    border-left:0;
    border-radius:0 8px 8px 0;
    background:#151d25;
    color:var(--gold2);
}

.protected-note{
    display:flex;
    flex-direction:column;
    gap:3px;
    margin-top:18px;
    padding:12px;
    border:1px solid #29343e;
    border-radius:8px;
    background:#0b1117;
}

.protected-note strong{font-size:12px}
.protected-note span{color:var(--gold2);font-size:12px}
.protected-note small{color:var(--muted);font-size:10px}

@media(max-width:850px){
    .mail-layout{grid-template-columns:1fr}

    .sidebar{
        min-height:auto;
        position:relative;
        border-right:0;
        border-bottom:1px solid #1f2933;
    }

    .brand{align-items:flex-start}

    .nav{
        display:flex;
        overflow:auto;
    }

    .compose-btn{width:max-content}

    .sidebar-bottom{
        position:static;
        margin-top:14px;
    }

    .mail-row{
        grid-template-columns:1fr;
        gap:4px;
    }

    .mail-row time{text-align:left}
}

@media(max-width:560px){
    .main{padding:20px 14px}
    .contact-form{grid-template-columns:1fr}
    .message-head{flex-direction:column}
}


/* Alte Zeit Mail v0.2 */
.recipient-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}
.compose-card small{
    color:var(--muted);
    font-size:10px;
    font-weight:500;
}
.attachments-box{
    padding:18px 0;
    border-top:1px solid #27313a;
}
.attachment-list{
    display:grid;
    gap:8px;
    margin-top:10px;
}
.attachment-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:10px 12px;
    border:1px solid #2b3641;
    border-radius:8px;
    background:#0c1319;
}
.attachment-item>div{
    display:flex;
    flex-direction:column;
}
.attachment-item span{
    color:var(--muted);
    font-size:10px;
}
.expired-label{
    color:#d98b91!important;
    font-weight:800;
}
@media(max-width:560px){
    .recipient-grid{grid-template-columns:1fr}
    .attachment-item{align-items:flex-start;flex-direction:column}
}


/* Alte Zeit Mail v0.3 */
.password-card{
    max-width:620px;
}
.account-box a + a{
    margin-top:4px;
}
