/* BSV Roundcube Extension 1.0.10 */

.bsv-extension-list .listing li a { display:block; padding:.65rem .9rem; text-decoration:none; }
.bsv-extension-list .listing li.selected > a { font-weight:600; }
.bsv-extension-content { padding:1rem 1.25rem 2rem; overflow:auto; height:100%; box-sizing:border-box; }
.bsv-extension-content h2 { margin-top:0; }
.bsv-status-table, .bsv-rules-table { width:100%; max-width:64rem; border-collapse:collapse; }
.bsv-status-table th, .bsv-status-table td, .bsv-rules-table th, .bsv-rules-table td { padding:.45rem .65rem; text-align:left; border-bottom:1px solid var(--border-color,#ddd); }
.bsv-code-textarea, .bsv-css-textarea, .bsv-rule-textarea { width:100%; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.bsv-code-textarea { min-height:16rem; }
.bsv-css-textarea { min-height:18rem; }
.bsv-rule-textarea { min-height:12rem; }
.bsv-asset-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem; margin:1rem 0; }
.bsv-asset-card { border:1px solid var(--border-color,#ddd); border-radius:.4rem; padding:1rem; }
.bsv-asset-card img { display:block; max-width:100%; max-height:130px; margin:.75rem auto; }
.bsv-placeholder-note, .bsv-note { max-width:60rem; padding:1rem; border:1px solid var(--border-color,#ddd); border-radius:.4rem; }
.bsv-form-row { max-width:40rem; margin:.75rem 0; }
.bsv-form-row > label { display:block; margin-bottom:.25rem; font-weight:600; }
.bsv-checkbox-row > label { font-weight:400; }
.bsv-rules-page { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; }
.bsv-rules-sticky { flex:0 0 auto; }
.bsv-rule-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; margin:1rem 0 .75rem; }
.bsv-rule-add-form { display:flex; align-items:center; gap:.5rem; flex:1 1 36rem; max-width:48rem; margin:0; }
.bsv-rule-add-form input { flex:1 1 auto; min-width:12rem; }
.bsv-rule-remove-button { flex:0 0 auto; margin-left:.35rem; }
.bsv-rules-scroll { flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; }
.bsv-rules-scroll .bsv-rule-remove-form { margin:0; }
.bsv-rules-table { margin:.25rem 0 0; }
.bsv-rules-table .selection { width:2.5rem; }
.bsv-rule-status.effective { font-weight:600; }
.bsv-rule-status.overridden { font-weight:600; text-decoration:line-through; }
.bsv-domain-suggestions { max-width:64rem; overflow-wrap:anywhere; }

.bsv-copy-heading { display:flex; align-items:center; gap:.65rem; max-width:64rem; }
.bsv-copy-heading h3 { margin-right:0; }
.bsv-copy-button { display:inline-flex; align-items:center; gap:.35rem; flex:0 0 auto; }
.bsv-copy-icon { width:1rem; height:1rem; fill:currentColor; }
.bsv-suggestion-textarea { width:100%; max-width:64rem; min-height:8rem; height:10rem; overflow:auto; resize:vertical; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; box-sizing:border-box; }
.bsv-global-spam-save { margin-top:1rem; }
.bsv-global-spam-separator { max-width:64rem; margin:1.5rem 0; border:0; border-top:1px solid var(--border-color,#ddd); }

@media screen and (max-width:768px) {
    .bsv-rule-toolbar { align-items:stretch; }
    .bsv-rule-add-form { flex:1 1 100%; max-width:none; }
    .bsv-rule-remove-button { margin-left:0; }
}

/* Stabiles dreispaltiges Layout der BSV-Einstellungsseiten. */
@media screen and (min-width: 769px) {
    body.bsv-settings-layout #layout-sidebar {
        flex: 0 0 22rem;
        width: 22rem;
        min-width: 22rem;
        max-width: 22rem;
    }

    body.bsv-settings-layout #layout-list {
        flex: 0 0 31rem;
        width: 31rem;
        min-width: 31rem;
        max-width: 31rem;
    }

    body.bsv-settings-layout #layout-content {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }
}

/* Passwortänderung */
.bsv-password-fields { width:100%; max-width:42rem; }
.bsv-password-fields .bsv-form-row { width:100%; max-width:none; box-sizing:border-box; }
.bsv-password-fields .form-control { width:100%; box-sizing:border-box; }
.bsv-required { color: #c0392b; font-weight: 700; }
.bsv-password-meter { width:100%; max-width:42rem; margin:1.25rem 0; box-sizing:border-box; }
.bsv-password-meter-track { width:100%; height:1.8rem; box-sizing:border-box; background:#e9ecef; border-radius:.35rem; overflow:hidden; }
.bsv-password-meter-bar { height:100%; width:0; box-sizing:border-box; transition:width .18s ease, background-color .18s ease; }
.bsv-password-meter-bar.policy-failed, .bsv-password-meter-bar.strength-0 { background: #c0392b; }
.bsv-password-meter-bar.password-mismatch, .bsv-password-meter-bar.strength-1 { background: #e67e22; }
.bsv-password-meter-bar.strength-2 { background: #f1c40f; color: #222; }
.bsv-password-meter-bar.strength-3 { background: #7cb342; }
.bsv-password-meter-bar.strength-4 { background: #27ae60; }
.bsv-password-status { min-height: 1.5rem; margin-top: .45rem; font-weight: 600; }
.bsv-password-policy-list .bsv-policy-value { min-width: 12rem; }
.bsv-policy-indicator { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: 1.1rem; font-weight: 700; }
.bsv-policy-indicator.passed { color: #218739; }
.bsv-policy-indicator.failed { color: #c0392b; }
.bsv-policy-neutral { color: #6c757d; }

.bsv-password-required-note, .bsv-password-unavailable { max-width:42rem; margin:0 0 1rem; padding:1rem; border:1px solid var(--border-color,#ddd); border-radius:.4rem; }


/* Erzwungener Passwortwechsel: bewusst ohne Roundcube-Navigation. */
.bsv-forced-password-page {
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    min-height:100vh;
    height:100vh;
    overflow:auto;
    padding:1rem;
    box-sizing:border-box;
}

.bsv-forced-password-panel {
    width:100%;
    max-width:48rem;
    margin:auto;
    padding:1.5rem;
    box-sizing:border-box;
}

/* Spam-/Kein-Spam-Toolbar.
 * Die Icon-Erzeugung bleibt bewusst an die stabilen Button-IDs gebunden.
 * Die HTML-Struktur entspricht den nativen Roundcube-Toolbar-Einträgen.
 */
#bsv-mark-spam-button::before,
#bsv-mark-not-spam-button::before {
    content:"" !important;
    width:1.75rem !important;
    height:1.75rem !important;
    background-color:currentColor !important;
    -webkit-mask-position:center !important;
    -webkit-mask-repeat:no-repeat !important;
    -webkit-mask-size:contain !important;
    mask-position:center !important;
    mask-repeat:no-repeat !important;
    mask-size:contain !important;
}

#bsv-mark-spam-button::before {
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22L12 2zm0 5.2 6.8 11.8H5.2L12 7.2zM11 10h2v5h-2v-5zm0 6.5h2v2h-2v-2z'/%3E%3C/svg%3E") !important;
    mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22L12 2zm0 5.2 6.8 11.8H5.2L12 7.2zM11 10h2v5h-2v-5zm0 6.5h2v2h-2v-2z'/%3E%3C/svg%3E") !important;
}

#bsv-mark-not-spam-button::before {
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 3 5v6c0 5.6 3.8 9.7 9 11 5.2-1.3 9-5.4 9-11V5l-9-3zm-1.1 14.2-4-4 1.4-1.4 2.6 2.6 5.3-5.3 1.4 1.4-6.7 6.7z'/%3E%3C/svg%3E") !important;
    mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 3 5v6c0 5.6 3.8 9.7 9 11 5.2-1.3 9-5.4 9-11V5l-9-3zm-1.1 14.2-4-4 1.4-1.4 2.6 2.6 5.3-5.3 1.4 1.4-6.7 6.7z'/%3E%3C/svg%3E") !important;
}

/* Desktop: Icon wie bei nativen Toolbar-Einträgen oberhalb des Textes. */
@media screen and (min-width:769px) {
    #bsv-mark-spam-button::before,
    #bsv-mark-not-spam-button::before {
        display:block !important;
        margin:0 auto !important;
    }
}

/* Mobil: Icon links vom Text; Roundcube behält die native Textposition. */
@media screen and (max-width:768px) {
    #bsv-mark-spam-button::before,
    #bsv-mark-not-spam-button::before {
        display:inline-block !important;
        margin-top:10px !important;
        vertical-align:middle !important;
    }
}



.bsv-login-history th:first-child,
.bsv-login-history td:first-child {
    width:3rem;
}

.bsv-domain-suggestion-group {
    margin-top:1.25rem;
}


/* Automatische Antworten */
.bsv-autoreply-note { margin-bottom:1.25rem; }
.bsv-autoreply-message { min-height:12rem; resize:vertical; }
.bsv-field-help { margin-top:.25rem; font-size:.9em; opacity:.75; }
/* Toggle-Switches verwenden bewusst die nativen Roundcube-Elastic-Klassen
 * .custom-control .custom-switch .custom-control-input .custom-control-label. */
.bsv-autoreply-period { max-width:40rem; }
.bsv-autoreply-period.is-disabled { opacity:.55; }


/* AutoReply date/time fields follow Roundcube user date/time formats. */
.bsv-autoreply-datetime { display:flex; gap:.5rem; align-items:center; }
.bsv-autoreply-datetime .bsv-autoreply-date { flex:1 1 12rem; min-width:10rem; }
.bsv-autoreply-datetime .bsv-autoreply-time { flex:0 1 8rem; min-width:7rem; }
@media (max-width: 480px) {
  .bsv-autoreply-datetime { flex-direction:column; align-items:stretch; }
  .bsv-autoreply-datetime .bsv-autoreply-date,
  .bsv-autoreply-datetime .bsv-autoreply-time { width:100%; min-width:0; }
}


/* AutoReply 1.0.6 */
.bsv-autoreply-time-wrap { display:flex; align-items:center; gap:.4rem; flex:0 1 10rem; min-width:9rem; }
.bsv-autoreply-time-wrap .bsv-autoreply-time { flex:1 1 auto; min-width:7rem; }
.bsv-autoreply-time-suffix { white-space:nowrap; color:inherit; }

/* Quota-Anzeige im Footer der Ordnerliste */
#bsv-quota-display.bsv-quota-widget { position:relative; display:flex; align-items:center; gap:.75rem; width:100%; min-height:2.75rem; padding:.35rem .85rem; box-sizing:border-box; color:inherit; background:transparent; overflow:visible; }
#bsv-quota-display .bsv-quota-icon { width:1.65rem; height:1.65rem; flex:0 0 1.65rem; opacity:.65; }
#bsv-quota-display .bsv-quota-icon svg { width:100%; height:100%; display:block; fill:currentColor; }
#bsv-quota-display .bsv-quota-bar { position:relative; height:.62rem; flex:1 1 auto; min-width:4rem; border:1px solid rgba(128,128,128,.35); border-radius:999px; overflow:hidden; background:rgba(128,128,128,.06); }
#bsv-quota-display .bsv-quota-bar-value { display:block; height:100%; width:0; background:#37beff; transition:width .2s ease; }
#bsv-quota-display.is-warning .bsv-quota-bar-value { background:#ff5552; }
#bsv-quota-display .bsv-quota-percent { flex:0 0 3.25rem; text-align:right; font-weight:600; opacity:.72; }
#bsv-quota-display .bsv-quota-tooltip { position:absolute; left:50%; bottom:calc(100% + .55rem); transform:translateX(-50%); z-index:1200; display:none; min-width:18rem; max-width:26rem; padding:.65rem .9rem; border-radius:.35rem; background:#1f1f1f; color:#fff; text-align:center; font-size:.95rem; line-height:1.45; box-shadow:0 2px 8px rgba(0,0,0,.25); }
#bsv-quota-display .bsv-quota-tooltip::after { content:''; position:absolute; left:50%; top:100%; transform:translateX(-50%); border:.45rem solid transparent; border-top-color:#1f1f1f; }
#bsv-quota-display:hover .bsv-quota-tooltip, #bsv-quota-display:focus-within .bsv-quota-tooltip { display:block; }
html.dark-mode #bsv-quota-display .bsv-quota-bar { background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.28); }
@media (max-width:768px) { .bsv-autoreply-time-wrap { width:100%; flex:1 1 auto; min-width:0; } #bsv-quota-display { padding-left:.65rem; padding-right:.65rem; gap:.55rem; } #bsv-quota-display .bsv-quota-tooltip { min-width:15rem; max-width:calc(100vw - 2rem); } }
