/* ===== Homeserver-Design für Roundcube Elastic ===== */
:root{--hs-bg:#0a0f1d;--hs-bg2:#0e1528;--hs-panel:#111a2e;--hs-panel2:#16213a;--hs-line:rgba(255,255,255,.08);--hs-ink:#eef2fb;--hs-soft:#c3cce0;--hs-muted:#8592ad;
 --hs-accent:#38bdf8;--hs-accent2:#a78bfa;--hs-grad:linear-gradient(135deg,#2dd4bf,#38bdf8 55%,#a78bfa);--hs-r:14px}
html:not(.dark-mode){--hs-bg:#eef2f8;--hs-bg2:#f6f8fc;--hs-panel:#ffffff;--hs-panel2:#f2f5fb;--hs-line:rgba(16,24,48,.09);--hs-ink:#121a2e;--hs-soft:#34405a;--hs-muted:#66728c;--hs-accent:#0284c7}
body,input,select,textarea,button,.btn{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif!important}
body{background:var(--hs-bg)!important;color:var(--hs-ink)}

/* Linke Leiste */
#layout-menu{background:linear-gradient(180deg,#0f1a33,#0a0f1d)!important;border-right:1px solid var(--hs-line)}
html:not(.dark-mode) #layout-menu{background:linear-gradient(180deg,#14223f,#0e1730)!important}
#layout-menu .popover-header,#layout-menu .menu a,#layout-menu .special-buttons a{color:#c3cce0!important}
#layout-menu .menu a{margin:4px 8px;border-radius:12px;transition:background .15s}
#layout-menu .menu a:hover{background:rgba(255,255,255,.06)!important}
#layout-menu .menu a.selected{background:rgba(255,255,255,.10)!important;color:#fff!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
#layout-menu .menu a.compose{background:var(--hs-grad)!important;color:#fff!important;box-shadow:0 8px 22px -8px rgba(56,189,248,.7)}
#layout-menu #logo{filter:drop-shadow(0 6px 18px rgba(56,189,248,.35))}

/* Spalten */
#layout-sidebar,#layout-list,#layout-content{background:var(--hs-bg2)!important;border-color:var(--hs-line)!important}
#layout-list{background:var(--hs-panel)!important}
.header,#layout-sidebar .header,#layout-list .header,#layout-content .header{background:transparent!important;border-bottom:1px solid var(--hs-line)!important;color:var(--hs-ink)!important}
.header .header-title{font-weight:700;letter-spacing:-.01em}
.footer{background:transparent!important;border-top:1px solid var(--hs-line)!important}

/* Ordnerliste */
#folderlist-content li a,.treelist li a{border-radius:10px;margin:2px 8px;color:var(--hs-soft)!important}
.treelist li.selected>a,#folderlist-content li.selected>a{background:linear-gradient(90deg,rgba(56,189,248,.18),rgba(167,139,250,.10))!important;color:var(--hs-ink)!important;box-shadow:inset 3px 0 0 var(--hs-accent)}
.treelist li a .unreadcount,.listing .unreadcount{background:var(--hs-grad)!important;color:#fff!important;border-radius:99px!important;font-weight:700}

/* Nachrichtenliste */
#messagelist tbody tr td{border-color:var(--hs-line)!important}
#messagelist tbody tr{transition:background .12s}
#messagelist tbody tr:hover td{background:rgba(56,189,248,.06)!important}
#messagelist tbody tr.selected td,#messagelist tbody tr.focused td{background:linear-gradient(90deg,rgba(56,189,248,.16),rgba(167,139,250,.08))!important}
#messagelist tbody tr.unread .subject a,#messagelist tbody tr.unread span.subject{font-weight:700;color:var(--hs-ink)!important}
#messagelist .msgicon.status.unread:before,#messagelist tr.unread .flag span:before{color:var(--hs-accent)!important}
#messagelist .fromto,#messagelist .date{color:var(--hs-muted)!important}

/* Suche, Eingaben, Knöpfe */
.searchbar,.input-group,.form-control,input.form-control,select.custom-select,textarea{border-radius:12px!important;border-color:var(--hs-line)!important;background:var(--hs-panel2)!important;color:var(--hs-ink)!important}
.form-control:focus{border-color:var(--hs-accent)!important;box-shadow:0 0 0 3px rgba(56,189,248,.18)!important}
.btn,.button{border-radius:12px!important}
.btn-primary,.button.mainaction,button.mainaction,.formbuttons .btn.mainaction{background:var(--hs-grad)!important;border:0!important;color:#fff!important;font-weight:650;box-shadow:0 8px 22px -10px rgba(56,189,248,.8)}
.toolbar a.button,.toolbar .button{border-radius:12px!important;color:var(--hs-soft)!important}
.toolbar a.button:hover{background:rgba(56,189,248,.08)!important;color:var(--hs-ink)!important}

/* Nachricht lesen */
#messagecontframe,.content.frame-content{background:var(--hs-bg2)!important}
#message-header{background:var(--hs-panel)!important;border-radius:var(--hs-r);margin:12px;padding:14px!important;border:1px solid var(--hs-line)}
#message-header .subject{font-size:1.35rem!important;font-weight:750;letter-spacing:-.02em}
.message-partheaders,.message-part{border-radius:var(--hs-r)}
.popupmenu,.popover,.ui-dialog{border-radius:16px!important;border:1px solid var(--hs-line)!important;box-shadow:0 24px 60px -20px rgba(0,0,0,.6)!important}

/* Anmeldeseite */
body.task-login{background:radial-gradient(60vw 50vh at 15% 15%,rgba(45,212,191,.18),transparent 70%),radial-gradient(60vw 50vh at 85% 10%,rgba(167,139,250,.18),transparent 70%),#0a0f1d!important}
body.task-login #layout-content{background:transparent!important}
body.task-login #login-form{background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.10);border-radius:24px;padding:32px 28px 24px;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);box-shadow:0 30px 80px -30px rgba(0,0,0,.8);max-width:400px;margin:0 auto}
body.task-login #login-form .input-group-text{background:transparent!important;border:0!important;color:#8592ad!important}
body.task-login #login-form input{background:rgba(255,255,255,.06)!important;color:#eef2fb!important;border:1px solid rgba(255,255,255,.12)!important}
body.task-login #login-form .formbuttons button{width:100%;padding:12px;font-size:1rem}
body.task-login #login-footer{color:#8592ad!important}
body.task-login #logo{filter:drop-shadow(0 10px 30px rgba(56,189,248,.45))}

/* Scrollbalken */
::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:rgba(133,146,173,.35);border-radius:10px}::-webkit-scrollbar-track{background:transparent}

/* Feinschliff */
#layout-menu .menu a{margin:3px 4px!important;font-size:.72rem}
#layout-menu .menu a .inner{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.floating-action-buttons a.button,.floating-action-buttons .button{background:var(--hs-grad)!important;border:0!important;color:#fff!important;border-radius:18px!important;box-shadow:0 12px 30px -10px rgba(56,189,248,.8)!important}
.message-part div.pre,.message-part pre{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif!important;font-size:.95rem;line-height:1.55}
#layout-menu .popover-header img,#logo{border-radius:14px}

/* Feinschliff */
#layout-menu .menu a{margin:3px 4px!important;font-size:.72rem}
#layout-menu .menu a .inner{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.floating-action-buttons a.button,.floating-action-buttons .button{background:var(--hs-grad)!important;border:0!important;color:#fff!important;border-radius:18px!important;box-shadow:0 12px 30px -10px rgba(56,189,248,.8)!important}
.message-part div.pre,.message-part pre{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif!important;font-size:.95rem;line-height:1.55}
#layout-menu .popover-header img,#logo{border-radius:14px}

/* iPhone: unten nichts hinter dem Home-Balken verstecken */
@media (max-width: 768px){
  .footer,#layout-list .footer,#layout-content .footer,#layout-sidebar .footer{padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 18px)!important;height:auto!important;min-height:calc(48px + env(safe-area-inset-bottom, 0px))}
  .floating-action-buttons{bottom:calc(env(safe-area-inset-bottom, 0px) + 78px)!important}
  #layout-menu .special-buttons{padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 16px)}
  #messagelist-content,.scroller{padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 20px)}
  #layout-content .formbuttons,#layout-content .footer{padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 18px)!important}
}

/* Viren-Hinweis unter der Mail */
.hs-virenhinweis{display:flex;align-items:center;gap:10px;margin:26px 18px 18px;padding:11px 14px;border-radius:12px;font-size:.85rem;
  color:var(--hs-muted);background:rgba(52,211,153,.08);border:1px solid rgba(52,211,153,.22)}
.hs-virenhinweis.warn{background:rgba(251,113,133,.10);border-color:rgba(251,113,133,.35);color:#fb7185}
.hs-schild{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,#34d399,#2dd4bf);color:#fff;font-weight:800;font-size:.8rem;flex-shrink:0}
.hs-virenhinweis.warn .hs-schild{background:#fb7185}
/* Anhänge als moderne Kacheln */
#attachment-list li,.attachmentslist li{border-radius:12px!important;background:var(--hs-panel2)!important;border:1px solid var(--hs-line)!important}
#message-objects,.message-partheaders{border-radius:12px}
#message-objects,#attachment-list,.message-partheaders,div.attachmentslist,#messagebody .attachmentslist{background:transparent!important;border:0!important}
#attachment-list,.attachmentslist{padding:0 18px!important}
/* Handy: untere Leiste mit Antworten / Weiterleiten / Löschen gleichmäßig */
.content-frame-navigation .buttons{display:flex;justify-content:center;gap:4px}
.content-frame-navigation .buttons a.button{min-width:64px}
.content-frame-navigation a.button.delete{color:#fb7185!important}

/* ===== Schreiben: schlicht wie die iPhone-Mail-App ===== */
body.action-compose #layout-content,.task-mail.action-compose .content{background:var(--hs-bg2)!important}
#compose-headers,#compose-headers .form-group,.compose-headers .form-group{margin:0!important}
.compose-headers .form-group.row,#compose-headers .form-group.row{display:flex;align-items:center;padding:6px 14px!important;border-bottom:1px solid var(--hs-line)!important}
.compose-headers .col-form-label,#compose-headers label.col-form-label{color:var(--hs-muted)!important;font-weight:500;font-size:.95rem;flex:0 0 76px;max-width:76px;padding:0!important}
.compose-headers .form-control,.compose-headers .input-group,.compose-headers .recipient-input,
.compose-headers input.form-control,.compose-headers select.custom-select,#compose-subject{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;color:var(--hs-ink)!important;font-size:1rem;padding-left:0!important}
.compose-headers .recipient-input ul.recipient-input,.compose-headers .recipient-input{background:transparent!important;border:0!important}
.compose-headers .input-group-append a,.compose-headers .input-group-append .input-group-text,.compose-headers .input-group-append span{background:transparent!important;border:0!important;color:var(--hs-accent)!important;box-shadow:none!important}
.compose-headers .recipient-input li.recipient{background:rgba(56,189,248,.14)!important;border:1px solid rgba(56,189,248,.3)!important;border-radius:99px!important;color:var(--hs-ink)!important;padding:2px 10px!important}
#compose-subject{font-weight:600}
/* Schreibfeld */
#composebodycontainer,.editor-wrapper{border:0!important;background:transparent!important;margin:0!important}
#composebody,textarea#composebody,.editor-wrapper textarea{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--hs-ink)!important;
  font-family:-apple-system,BlinkMacSystemFont,Inter,"Segoe UI",sans-serif!important;font-size:1.05rem!important;line-height:1.55;padding:16px 16px 40px!important;min-height:55vh!important;resize:none}
#composebody::placeholder{color:var(--hs-muted)}
.editor-toolbar,.editor-wrapper .editor-toolbar{background:transparent!important;border:0!important;border-bottom:1px solid var(--hs-line)!important;border-radius:0!important}
.editor-toolbar a,.editor-toolbar .mce-i{color:var(--hs-muted)!important}
/* Seitenleiste (Anhänge/Optionen) und ihr Klapp-Griff */
#layout-sidebar.sidebar-right,.action-compose #layout-sidebar{background:var(--hs-panel)!important}
a.sidebar-toggle,.layout-sidebar-toggle,#compose-options-toggle,.sidebar-toggle{background:var(--hs-panel2)!important;border:1px solid var(--hs-line)!important;color:var(--hs-muted)!important;border-radius:0 12px 12px 0!important;opacity:.85}
/* Senden-Knopf unten hervorheben */
.content-frame-navigation a.button.send,.formbuttons .btn.send,.footer a.send{color:var(--hs-accent)!important;font-weight:700}
.content-frame-navigation a.button.send:before{background:var(--hs-grad);-webkit-background-clip:text;background-clip:text;color:transparent!important}
/* Beschriftung neben dem Feld (auch auf dem Handy) */
.compose-headers .form-group.row,#compose-headers .form-group.row{flex-wrap:nowrap!important;min-height:52px}
.compose-headers .form-group.row>label,.compose-headers .form-group.row>.col-form-label{flex:0 0 72px!important;max-width:72px!important;margin:0!important}
.compose-headers .form-group.row>div{flex:1 1 auto!important;max-width:none!important;width:auto!important;padding:0!important}
#composebody{min-height:50vh!important}
.editor-toolbar{opacity:.6}
/* Senden-Knopf (Desktop) gut lesbar */
.formbuttons .btn.send,.formbuttons button.send{color:#fff!important;-webkit-text-fill-color:#fff!important}
.formbuttons .btn.send:before{color:#fff!important;-webkit-text-fill-color:#fff!important;background:none!important}
#composebody::placeholder{color:var(--hs-muted)!important;opacity:1}
/* Umschalter zum Formatierungs-Editor im Schreibfeld ausblenden (schlichtes Schreiben wie am iPhone) */
#composebodycontainer .editor-toolbar,.html-editor>.editor-toolbar,.editor-toolbar{display:none!important}
#composebody{padding-top:14px!important}

/* Patchlog nach Updates */
.hs-patchlog{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;padding:20px;background:rgba(5,8,18,.6);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);animation:hsfade .25s ease}
@keyframes hsfade{from{opacity:0}to{opacity:1}}
.hs-patchlog-karte{width:min(440px,100%);max-height:80vh;overflow:auto;background:var(--hs-panel);border:1px solid var(--hs-line);border-radius:22px;padding:22px 22px 18px;box-shadow:0 30px 80px -25px rgba(0,0,0,.7);color:var(--hs-ink)}
.hs-patchlog-kopf{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.hs-patchlog-logo{width:46px;height:46px;border-radius:14px;flex-shrink:0;background:url(logo.svg) center/cover}
.hs-patchlog-klein{color:var(--hs-muted);font-size:.8rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.hs-patchlog h2{margin:2px 0 0;font-size:1.3rem;font-weight:750;letter-spacing:-.02em;background:var(--hs-grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.hs-patchlog ul{margin:6px 0 18px;padding:0;list-style:none}
.hs-patchlog li{position:relative;padding:9px 0 9px 26px;border-bottom:1px solid var(--hs-line);font-size:.95rem;line-height:1.45;color:var(--hs-soft)}
.hs-patchlog li:last-child{border-bottom:0}
.hs-patchlog li:before{content:"✦";position:absolute;left:4px;top:9px;color:var(--hs-accent)}
.hs-patchlog-ok{width:100%;padding:12px;border:0;border-radius:14px;background:var(--hs-grad);color:#fff;font-weight:700;font-size:1rem;cursor:pointer;box-shadow:0 10px 26px -10px rgba(56,189,248,.8)}
/* „Angemeldet bleiben“ auf der Anmeldeseite */
body.task-login #login-form .form-check,body.task-login #login-form .persistent-login,body.task-login #login-form label[for="_ifpl"]{color:#c3cce0!important}
body.task-login #login-form input[type=checkbox]{accent-color:#38bdf8;width:18px;height:18px;vertical-align:middle;margin-right:8px}

/* v.0.1.1: Link zur Registrierung unter dem Anmeldeformular */
.hs-registrieren{margin:18px 0 0;text-align:center;font-size:.92rem;color:var(--hs-muted,#8592ad)}
.hs-registrieren a{color:#38bdf8;font-weight:600;text-decoration:none}
.hs-registrieren a:hover{text-decoration:underline}
/* „Ich bleibe eingeloggt“: ohne weißen Balken, wie ein Schalter auf Glas */
body.task-login #login-form tr:has(input[type=checkbox]) td,
body.task-login #login-form tr:has(input[type=checkbox]) .input-group{background:transparent!important;border:0!important;box-shadow:none!important}
body.task-login #login-form tr:has(input[type=checkbox]) label{font-size:.95rem}
