:root {
    --sigf-text-scale: 1;
    --sigf-rail-bg: #1c185d;
    --sigf-navy: #1c185d;
    --sigf-indigo: #5952f6;
    --sigf-teal: #8035ea;
    --sigf-bg: #f5f4fb;
    --sigf-text: #1a1a1a;
    --sigf-error: #c0392b;
    --sigf-success: #1f9d55;
    --sigf-sidebar-bg: #ffffff;
    --sigf-border: #ebe9f5;
    --sigf-bubble-theirs: #f0f1f3;
    --sigf-surface: #ffffff;
    --sigf-text-muted: #888888;
    --sigf-accent-bg: #f1eefc;
    --sigf-accent-border: #e4def9;
    --sigf-overlay: rgba(15, 15, 30, 0.45);
    --sigf-brand-dark: #1c185d;
}

[data-theme="dark"] {
    --sigf-navy: #e8e6ff;
    --sigf-indigo: #7c74ff;
    --sigf-teal: #a566f5;
    --sigf-bg: #15131f;
    --sigf-text: #eeeef2;
    --sigf-error: #ff6b5e;
    --sigf-success: #3ecf7e;
    --sigf-sidebar-bg: #1c1a29;
    --sigf-border: #2e2b40;
    --sigf-bubble-theirs: #262436;
    --sigf-surface: #211f30;
    --sigf-text-muted: #9d9ab0;
    --sigf-accent-bg: #2c2743;
    --sigf-accent-border: #3a3455;
    --sigf-overlay: rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    background: var(--sigf-bg);
    color: var(--sigf-text);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ---- Auth pages ---- */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 32px;
    background: var(--sigf-surface);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.auth-container h1 {
    color: var(--sigf-navy);
    margin-bottom: 4px;
}

.auth-logo {
    display: block;
    max-width: 220px;
    margin: 0 auto 4px;
}

.tagline {
    color: var(--sigf-text-muted);
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 14px;
}

input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 14px;
    border: 1px solid var(--sigf-border);
    border-radius: 999px;
    font-size: 14px;
    font-family: inherit;
    color: var(--sigf-text);
    background-color: transparent;
}

button {
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.auth-container button {
    width: 100%;
    padding: 12px;
}

.error { color: var(--sigf-error); font-size: 14px; }
.success { color: var(--sigf-success); font-size: 14px; }

/* ---- App shell ---- */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 380px;
    flex-shrink: 0;
    background: var(--sigf-sidebar-bg);
    border-right: 1px solid var(--sigf-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(16px + env(safe-area-inset-top)) 18px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 24px;
    height: 24px;
}

.brand-name {
    font-weight: 800;
    font-size: 18px;
    color: var(--sigf-navy);
    letter-spacing: -0.3px;
}

.my-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.search-box {
    position: relative;
    padding: 0 16px 12px;
}

.search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sigf-text-muted);
    font-size: 15px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    margin: 0;
    padding: 9px 14px 9px 34px;
    border-radius: 999px;
    border: none;
    background: var(--sigf-bg);
    font-size: 14px;
}

.search-results {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 46px;
    background: var(--sigf-surface);
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-height: 240px;
    overflow-y: auto;
    z-index: 10;
}

.search-results.visible {
    display: block;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
}

.search-result:hover {
    background: var(--sigf-bg);
}

.search-result-text {
    display: flex;
    flex-direction: column;
}

.search-result .username {
    display: block;
    color: var(--sigf-text-muted);
    font-size: 12px;
}

.search-empty {
    padding: 10px 14px;
    color: var(--sigf-text-muted);
    font-size: 13px;
}

.conversation-list {
    list-style: none;
    margin: 0;
    padding: 4px 8px;
    overflow-y: auto;
    flex: 1;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
}

.conversation-item:hover {
    background: var(--sigf-bg);
}

.conversation-item.active {
    background: var(--sigf-accent-bg);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    position: relative;
    background-size: cover;
    background-position: center;
}

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

.avatar.online::after {
    content: '';
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid var(--sigf-surface);
    border-radius: 50%;
}

.conv-info {
    min-width: 0;
    flex: 1;
}

.conv-top-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.conv-name {
    font-weight: 700;
    font-size: calc(15.5px * var(--sigf-text-scale));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 12px;
    color: var(--sigf-text-muted);
    flex-shrink: 0;
}

.conv-preview {
    display: block;
    font-size: calc(13.5px * var(--sigf-text-scale));
    color: var(--sigf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.conv-bottom-row .conv-preview { flex: 1; min-width: 0; }

.conversation-item.has-unread .conv-preview {
    color: var(--sigf-text);
    font-weight: 600;
}

.conversation-item.has-unread {
    position: relative;
}

.conversation-item.has-unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--sigf-indigo);
}

.conv-unread-badge {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--sigf-indigo);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.empty-hint {
    color: var(--sigf-text-muted);
    font-size: 13px;
    padding: 16px;
}

.sidebar-footer {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--sigf-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.presence-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

.presence-toggle input {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    width: 38px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--sigf-border);
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.presence-toggle input::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.2s ease;
}

.presence-toggle input:checked {
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
}

.presence-toggle input:checked::before {
    transform: translateX(16px);
}

.logout-link {
    color: var(--sigf-text-muted);
    font-size: 13px;
    text-decoration: none;
}

.logout-link:hover {
    color: var(--sigf-navy);
}

/* ---- Message panel ---- */
.message-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--sigf-bg);
    min-width: 0;
}

.message-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 22px 12px;
    border-bottom: 1px solid var(--sigf-border);
    background: var(--sigf-surface);
    min-height: 30px;
}

.message-panel-header.empty {
    color: var(--sigf-text-muted);
    font-size: 14px;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.header-name {
    font-weight: 700;
    font-size: 15px;
}

.header-username {
    font-size: 12px;
    color: var(--sigf-text-muted);
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-row {
    display: block;
    width: 100%;
}

.message-row.mine {
    text-align: right;
}

.message-row.theirs {
    text-align: left;
}

.message-bubble-column {
    display: inline-block;
    max-width: 82%;
    text-align: left;
    vertical-align: top;
}

.message-bubble {
    padding: 9px 14px;
    border-radius: 18px;
    font-size: calc(15px * var(--sigf-text-scale));
    line-height: 1.45;
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.emoji-only-text {
    font-size: calc(40px * var(--sigf-text-scale));
    line-height: 1.2;
    display: inline-block;
}

.message-bubble.mine {
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    border-bottom-right-radius: 5px;
}

.message-bubble.theirs {
    background: var(--sigf-bubble-theirs);
    color: var(--sigf-text);
    border-bottom-left-radius: 5px;
}

.message-bubble.highlight-flash,
.message-row.highlight-flash .message-bubble {
    animation: bubble-flash 1.2s ease;
}

@keyframes bubble-flash {
    0%, 100% { box-shadow: none; }
    30% { box-shadow: 0 0 0 3px var(--sigf-teal); }
}

.message-text {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
}

.message-time {
    display: block;
    font-size: 10.5px;
    opacity: 0.65;
    margin-top: 3px;
    text-align: right;
}

.message-bubble.expiring {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.self-destruct-badge {
    display: inline-block;
    font-size: 11px;
    margin-left: 8px;
    opacity: 0.75;
}

/* ---- Geciteerd bericht (antwoord) ---- */
.reply-quote {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 10px;
    margin-bottom: 6px;
    border-left: 3px solid var(--sigf-teal);
    border-radius: 6px;
    background: rgba(0,0,0,0.06);
    cursor: pointer;
    max-width: 100%;
}

.message-bubble.mine .reply-quote {
    background: rgba(255,255,255,0.18);
    border-left-color: rgba(255,255,255,0.7);
}

.reply-quote-sender {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
}

.reply-quote-snippet {
    font-size: 12.5px;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Reactiebalk onder een bericht ---- */
.reactions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--sigf-surface);
    border: 1px solid var(--sigf-border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--sigf-text);
    line-height: 1.6;
}

.reaction-pill span {
    font-size: 11px;
    color: var(--sigf-text-muted);
    font-weight: 700;
}

.reaction-pill.mine {
    background: var(--sigf-accent-bg);
    border-color: var(--sigf-teal);
}

.reaction-pill.mine span {
    color: var(--sigf-teal);
}

.reaction-pill:hover {
    background: var(--sigf-bg);
}

/* ---- Berichtcontextmenu (lang indrukken / rechtsklik) — Signal-stijl:
   snelle-reacties-rij bovenaan, actielijst eronder, één zwevend paneel. ---- */
.message-context-menu {
    position: fixed;
    z-index: 60;
    background: var(--sigf-surface);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
    overflow: hidden;
    max-width: 260px;
}

.message-context-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-menu-reactions {
    display: flex;
    gap: 2px;
    padding: 8px;
}

.reaction-picker-option {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: none;
    background-image: none;
    font-size: 19px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reaction-picker-option:hover {
    background: var(--sigf-bg);
}

.context-menu-actions {
    border-top: 1px solid var(--sigf-border);
    padding: 4px;
}

.context-menu-actions button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    background-image: none;
    color: var(--sigf-text);
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: left;
}

.context-menu-actions button:hover {
    background: var(--sigf-bg);
}

/* ---- "Antwoorden op..."-balk boven het invoerveld ---- */
.reply-preview-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: var(--sigf-accent-bg);
    border-top: 1px solid var(--sigf-accent-border);
}

.reply-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#reply-preview-sender {
    font-size: 12px;
    font-weight: 700;
    color: var(--sigf-navy);
}

#reply-preview-snippet {
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-bar button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: none;
    background-image: none;
    color: var(--sigf-text-muted);
    font-size: 16px;
    padding: 0;
    flex-shrink: 0;
}

.reply-preview-bar button:hover {
    background: rgba(0,0,0,0.06);
}

/* ---- Emoji-picker ---- */
.emoji-picker {
    display: none;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    max-width: 360px;
    margin: 0 20px 8px auto;
    padding: 10px;
    background: var(--sigf-surface);
    border: 1px solid var(--sigf-border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 200px;
    overflow-y: auto;
}

.emoji-option {
    background: none;
    background-image: none;
    border-radius: 8px;
    font-size: 19px;
    padding: 4px;
    line-height: 1.4;
    cursor: pointer;
}

.emoji-option:hover {
    background: var(--sigf-bg);
}

/* ---- Input bar ---- */
.message-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    background: var(--sigf-surface);
    border-top: 1px solid var(--sigf-border);
}

.icon-button {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--sigf-bg);
    background-image: none;
    color: var(--sigf-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.icon-button:hover {
    background: var(--sigf-accent-bg);
}

.send-button {
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    background-image: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.timer-select {
    border-radius: 999px;
    border: none;
    background: var(--sigf-bg);
    padding: 0 8px;
    height: 38px;
    font-size: 13px;
    flex-shrink: 0;
    width: 56px;
}

.message-input-pill {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    border-radius: 22px;
    background: var(--sigf-bg);
    padding: 3px 3px 3px 6px;
    min-width: 0;
}

.message-input-pill .icon-button {
    background: none;
    background-image: none;
    flex-shrink: 0;
}

.message-input-pill .icon-button:hover {
    background: rgba(0,0,0,0.06);
}

.message-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    border-radius: 18px;
    border: none;
    background: none;
    padding: 9px 4px;
    font-size: 14.5px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
    max-height: 120px;
}

/* ---- Attachments ---- */
.attachment-preview-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--sigf-accent-bg);
    border-top: 1px solid var(--sigf-accent-border);
    overflow-x: auto;
}

.attachment-preview-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--sigf-surface);
    border: 1px solid var(--sigf-border);
}

.attachment-preview-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-preview-thumb-file {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.attachment-preview-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    border: none;
}

.message-bubble.image-only {
    background: none;
    padding: 0;
    display: inline-block;
    position: relative;
    line-height: 0;
}

.message-bubble.image-only .attachment-image-link {
    background: none;
    padding: 0;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.message-bubble.image-only .attachment-image {
    border-radius: 0;
    margin: 0;
}

.message-bubble.image-only .message-time {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    margin: 0;
    opacity: 1;
}

.message-bubble.image-only .self-destruct-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 3px 9px;
    border-radius: 999px;
    margin: 0;
    opacity: 1;
}
.attachment-image-link {
    display: block;
    background: var(--sigf-surface);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 4px;
    width: fit-content;
}

.attachment-image {
    display: block;
    max-width: 240px;
    max-height: 240px;
    border-radius: 10px;
}

.attachment-file-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--sigf-surface);
    border-radius: 12px;
    font-size: 13px;
    text-decoration: none;
    color: var(--sigf-text);
    margin-bottom: 4px;
    width: fit-content;
}

.attachment-size {
    opacity: 0.6;
    font-size: 11px;
}

/* ---- Terugknop (alleen mobiel zichtbaar) ---- */
.back-button {
    display: none;
    margin-right: 2px;
}

/* ---- Responsive (mobiel) ---- */
@media (max-width: 720px) {
    .app-shell {
        position: relative;
        height: 100dvh;
        height: var(--app-height, 100dvh);
        overflow: hidden;
    }

    .sidebar,
    .message-panel {
        width: 100%;
        height: 100%;
    }

    /* Standaard: alleen de gesprekslijst, het gesprek staat klaar maar verborgen */
    .message-panel {
        display: none;
    }

    /* Zodra een gesprek geopend is: lijst weg, gesprek schermvullend */
    .app-shell.show-chat .sidebar {
        display: none;
    }

    .app-shell.show-chat .message-panel {
        display: flex;
    }

    .back-button {
        display: flex;
    }

    .message-bubble {
        font-size: 16px;
    }

    .message-time {
        font-size: 11px;
    }

    .conv-name {
        font-size: 15.5px;
    }

    .conv-preview {
        font-size: 13.5px;
    }

    .header-name {
        font-size: 16px;
    }

    .message-input {
        font-size: 16px;
    }

    .modal {
        max-width: 92%;
    }

    .emoji-picker {
        max-width: calc(100vw - 32px);
        margin-right: 16px;
    }
}

/* ---- Instellingen-modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--sigf-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: var(--sigf-surface);
    border-radius: 18px;
    width: 90%;
    max-width: 380px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--sigf-navy);
}

.modal-body {
    padding: 16px 20px;
}

.modal-footer {
    padding: 0 20px 20px;
}

.modal-footer .primary-button {
    width: 100%;
    padding: 11px;
}

.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.settings-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    background-size: cover;
    background-position: center;
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.secondary-button {
    background: var(--sigf-bg);
    background-image: none;
    color: var(--sigf-navy);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    width: auto;
}

.text-button {
    background: none;
    background-image: none;
    color: var(--sigf-text-muted);
    font-size: 12.5px;
    font-weight: 400;
    padding: 2px 4px;
    width: auto;
}

.text-button:hover {
    color: var(--sigf-error);
}

.primary-button {
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    font-weight: 700;
    width: auto;
    padding: 10px 20px;
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.settings-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sigf-text-muted);
    margin-bottom: 18px;
}

.settings-label input {
    margin-top: 6px;
}

.settings-presence-row {
    margin-bottom: 4px;
}

.settings-hint {
    font-size: 12px;
    color: var(--sigf-text-muted);
    margin: 0 0 12px;
}

.settings-feedback {
    font-size: 13px;
    color: var(--sigf-success);
    min-height: 18px;
}

.settings-feedback.error {
    color: var(--sigf-error);
}

/* ---- Vrienden uitnodigen ---- */
.settings-divider {
    border: none;
    border-top: 1px solid var(--sigf-border);
    margin: 18px 0;
}

.invite-section h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: var(--sigf-navy);
}

.invite-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.invite-link-row input {
    flex: 1;
    margin: 0;
    font-size: 12.5px;
    background: var(--sigf-bg);
    border: none;
    color: var(--sigf-text-muted);
}

.invite-link-row .secondary-button {
    flex-shrink: 0;
}

.invite-share-button {
    width: 100%;
}

.invite-banner {
    background: var(--sigf-accent-bg);
    color: var(--sigf-navy);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13.5px;
    text-align: center;
    margin-bottom: 16px;
}

/* ---- GDPR: gegevensbeheer ---- */
.gdpr-section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--sigf-navy);
}

.gdpr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sigf-border);
}

.gdpr-row strong {
    font-size: 13.5px;
    color: var(--sigf-text);
}

.gdpr-row .settings-hint {
    margin: 2px 0 0;
    max-width: 260px;
}

.gdpr-row form {
    margin: 0;
    flex-shrink: 0;
}

.danger-button {
    background: var(--sigf-error);
    color: #fff;
    font-weight: 700;
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    flex-shrink: 0;
}

.delete-confirm-box {
    margin-top: 12px;
    padding: 14px;
    background: #fdeceb;
    border-radius: 12px;
}

.delete-confirm-box p {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--sigf-error);
}

.delete-confirm-box input {
    margin-bottom: 8px;
}

.delete-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

/* ---- Groepen ---- */
.new-group-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 14px;
    width: calc(100% - 32px);
    background: var(--sigf-surface);
    background-image: none;
    color: var(--sigf-indigo);
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--sigf-border);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.new-group-button svg {
    flex-shrink: 0;
}

.new-group-button:hover {
    background: var(--sigf-accent-bg);
    border-color: var(--sigf-indigo);
}

.header-clickable-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.message-sender-name {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.group-member-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    min-height: 20px;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sigf-accent-bg);
    color: var(--sigf-navy);
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
}

.chip-remove {
    width: auto;
    background: none;
    background-image: none;
    color: var(--sigf-text-muted);
    font-size: 15px;
    padding: 0 4px;
    cursor: pointer;
}

.group-participant-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.group-participant-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--sigf-border);
}

.participant-name {
    flex: 1;
    font-size: 13.5px;
}

.remove-participant-btn {
    color: var(--sigf-error);
    font-size: 12px;
}

.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    background: var(--sigf-accent-bg);
    color: var(--sigf-teal);
    margin-left: 4px;
}

/* ---- Bellen ---- */
.header-call-buttons {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.call-overlay {
    position: fixed;
    inset: 0;
    background: #0f0f2d;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* ---- Inkomende oproep ---- */
.incoming-call-box {
    text-align: center;
}

.incoming-call-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.incoming-call-avatar .avatar {
    width: 96px;
    height: 96px;
    font-size: 34px;
}

.incoming-call-box h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.incoming-call-box p {
    color: rgba(255,255,255,0.7);
    margin: 0 0 40px;
}

.incoming-call-actions {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.call-action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    background-image: none;
    color: #fff;
    padding: 0;
}

.call-action-btn.accept {
    background: #1f9d55;
    background-image: none;
}

.call-action-btn.decline {
    background: var(--sigf-error);
    background-image: none;
}

.call-action-btn.control {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.15);
    background-image: none;
}

.call-action-btn.control.off {
    background: var(--sigf-error);
    background-image: none;
}

.call-action-btn.control.active {
    background: var(--sigf-indigo);
    background-image: none;
}

/* ---- Actief gesprek ---- */
.in-call-header {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

.call-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
    margin-bottom: 100px;
}

/* v222.37 - 1-op-1 gesprek: beeld van de ander groot, eigen beeld als
   klein PiP-vakje — vooral belangrijk zodra iemand scherm deelt. */
.call-tiles.solo-view {
    display: block;
    position: relative;
    max-width: 1400px;
    height: min(760px, calc(100vh - 180px));
}

.call-tiles.solo-view .call-tile {
    aspect-ratio: auto;
}

.call-tiles.solo-view .call-tile:not(.local) {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.call-tiles.solo-view .call-tile.local {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 130px;
    height: 98px;
    border-radius: 14px;
    z-index: 5;
    border: 2px solid rgba(255,255,255,0.25);
    box-shadow: 0 10px 26px rgba(0,0,0,0.45);
}

.call-tiles.solo-view .call-tile.local .call-tile-label {
    font-size: 10px;
    padding: 2px 7px;
}

@media (max-width: 640px) {
    .call-tiles.solo-view .call-tile.local {
        width: 88px;
        height: 66px;
        bottom: 10px;
        right: 10px;
    }
}

.call-tile {
    position: relative;
    background: #1a1a3a;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-tile audio {
    display: none;
}

.call-tile-label {
    position: absolute;
    left: 10px;
    bottom: 8px;
    font-size: 12px;
    background: rgba(0,0,0,0.5);
    padding: 3px 9px;
    border-radius: 999px;
    z-index: 2;
}

.call-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ---- Call-event regel (gemist/geweigerd/beëindigd) ---- */
.call-event-pill {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sigf-accent-bg);
    color: var(--sigf-navy);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    margin: 4px 0;
}

.call-event-time {
    color: var(--sigf-text-muted);
    font-weight: 400;
    font-size: 11px;
}

/* ---- Bijlage-menu (bestand vs. camera) ---- */
.attach-menu-wrapper {
    position: relative;
}

.attach-menu {
    position: absolute;
    bottom: 48px;
    left: 0;
    background: var(--sigf-surface);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 6px;
    min-width: 170px;
    z-index: 20;
}

.attach-menu button,
.attach-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    background-image: none;
    color: var(--sigf-text);
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 10px;
    border-radius: 8px;
    text-align: left;
    text-decoration: none;
    box-sizing: border-box;
}

.attach-menu button:hover,
.attach-menu a:hover {
    background: var(--sigf-bg);
}

/* ---- In-app camera ---- */
#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.camera-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 2;
}

.camera-shutter-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid rgba(255,255,255,0.4);
    padding: 0;
}

#camera-feedback {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    text-align: center;
    color: #ff8a80;
    z-index: 2;
}

/* ---- Installeer-banner ---- */
.install-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 14px;
    padding: 10px 12px;
    background: var(--sigf-accent-bg);
    border-radius: 12px;
}

.install-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.install-banner-text strong {
    font-size: 13px;
    color: var(--sigf-navy);
}

.install-banner-text span {
    font-size: 11.5px;
    color: var(--sigf-text-muted);
}

.install-banner .secondary-button {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 12.5px;
}

.install-banner .text-button {
    flex-shrink: 0;
    font-size: 15px;
    color: var(--sigf-text-muted);
}

.ios-install-steps {
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.8;
}

.ios-share-icon {
    display: inline-block;
    font-weight: 700;
}

/* ---- Meer-opties-menu (blokkeren/rapporteren) ---- */
.header-more-wrapper {
    position: relative;
}


/* ---- Typt-indicator ---- */
.typing-indicator-bar {
    padding: 4px 20px;
    font-size: 12px;
    font-style: italic;
    color: var(--sigf-text-muted);
}

/* ---- Leesbevestiging-vinkje ---- */
.read-receipt {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: -1px;
}

.read-receipt.read {
    color: #6fd3ff;
    opacity: 1;
}

/* ---- Tweestapsverificatie ---- */
.twofa-qr-container {
    display: flex;
    justify-content: center;
    padding: 12px;
    background: var(--sigf-surface);
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    margin-bottom: 12px;
    width: fit-content;
}

.twofa-manual-secret {
    display: block;
    background: var(--sigf-bg);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 16px;
    word-break: break-all;
}

.twofa-backup-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0 16px;
}

.twofa-backup-codes code {
    display: block;
    background: var(--sigf-bg);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 13.5px;
}

#twofa-on-view .secondary-button,
#twofa-on-view .danger-button {
    margin-right: 8px;
}

/* ---- @vermeldingen ---- */
.mention-dropdown {
    position: absolute;
    bottom: 68px;
    left: 20px;
    right: 20px;
    max-width: 320px;
    background: var(--sigf-surface);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 6px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 30;
}

.mention-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    background-image: none;
    padding: 7px 8px;
    border-radius: 8px;
    text-align: left;
    font-size: 13.5px;
    color: var(--sigf-text);
}

.mention-option .username {
    color: var(--sigf-text-muted);
    font-size: 11.5px;
}

.mention-option:hover,
.mention-option.active {
    background: var(--sigf-bg);
}

.mention {
    font-weight: 700;
    color: var(--sigf-teal);
}

.message-bubble.mine .mention {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.5);
}

.mention-self {
    background: rgba(128, 53, 234, 0.15);
    border-radius: 4px;
    padding: 0 3px;
}

.message-bubble.mine .mention-self {
    background: rgba(255,255,255,0.25);
}

/* ---- Abonnement ---- */
.pro-perks-list {
    margin: 0 0 16px;
    padding-left: 20px;
    font-size: 13.5px;
    color: var(--sigf-text);
    line-height: 1.8;
}

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

#billing-pro-view {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#billing-next-payment {
    margin: 4px 0 10px;
}

/* ---- Afbeelding-lightbox ---- */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.image-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox-icon-btn {
    position: absolute;
    top: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
}

.lightbox-icon-btn:hover {
    background: rgba(255,255,255,0.22);
}

.lightbox-close {
    right: 18px;
}

.lightbox-download {
    right: 70px;
    font-size: 16px;
}

/* ---- Eigen QR-code/deel-link ---- */
.qr-code-container {
    display: flex;
    justify-content: center;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    margin: 12px 0;
    width: fit-content;
}

.qr-link-row {
    display: flex;
    gap: 8px;
}

.qr-link-row input {
    flex: 1;
    margin: 0;
    font-size: 12.5px;
    background: var(--sigf-bg);
}

.qr-link-row .secondary-button {
    flex-shrink: 0;
    padding: 0 16px;
}

/* ---- Vastgezet bericht ---- */
.pinned-message-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    background: var(--sigf-accent-bg);
    border-bottom: 1px solid var(--sigf-accent-border);
    cursor: pointer;
}

.pinned-icon {
    flex-shrink: 0;
}

.pinned-content {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 6px;
    overflow: hidden;
}

#pinned-sender {
    font-weight: 800;
    font-size: 12.5px;
    color: var(--sigf-navy);
    flex-shrink: 0;
}

#pinned-snippet {
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#pinned-unpin-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: none;
    background-image: none;
    color: var(--sigf-text-muted);
    font-size: 13px;
}

#pinned-unpin-btn:hover {
    background: rgba(0,0,0,0.06);
}

/* ---- Kleine Pro-badge (naast andermans naam) ---- */
.pro-badge-small {
    display: inline-block;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.02em;
}

/* ---- Chat-achtergronden (Pro) ---- */
.wallpaper-section {
    margin: 4px 0 16px;
}

.wallpaper-label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 8px;
}

.wallpaper-picker {
    display: flex;
    gap: 10px;
}

.wallpaper-swatch {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid var(--sigf-border);
    background-color: var(--sigf-bg);
    padding: 0;
}

.wallpaper-swatch.active {
    border-color: var(--sigf-teal);
}

.wallpaper-none {
    background-image: none;
}

.wallpaper-dots,
.message-list.wallpaper-dots {
    background-image: radial-gradient(var(--sigf-border) 1.4px, transparent 1.4px);
    background-size: 16px 16px;
}

.wallpaper-lines,
.message-list.wallpaper-lines {
    background-image: repeating-linear-gradient(135deg, var(--sigf-border) 0, var(--sigf-border) 1px, transparent 1px, transparent 14px);
}

.wallpaper-grid,
.message-list.wallpaper-grid {
    background-image: linear-gradient(var(--sigf-border) 1px, transparent 1px), linear-gradient(90deg, var(--sigf-border) 1px, transparent 1px);
    background-size: 18px 18px;
}

.wallpaper-waves,
.message-list.wallpaper-waves {
    background-image: radial-gradient(circle at 20% 30%, var(--sigf-accent-bg) 0%, transparent 45%), radial-gradient(circle at 80% 70%, var(--sigf-accent-bg) 0%, transparent 45%);
}

.wallpaper-confetti,
.message-list.wallpaper-confetti {
    background-image:
        radial-gradient(var(--sigf-indigo) 1.5px, transparent 1.5px),
        radial-gradient(var(--sigf-teal) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
}

.wallpaper-chevron,
.message-list.wallpaper-chevron {
    background-image: linear-gradient(135deg, var(--sigf-border) 25%, transparent 25%), linear-gradient(225deg, var(--sigf-border) 25%, transparent 25%);
    background-size: 16px 16px;
}

.wallpaper-custom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sigf-text-muted);
    background-color: var(--sigf-bg);
}

.message-list.wallpaper-custom {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ---- Belduur-waarschuwing (gratis tier) ---- */
.call-feedback {
    text-align: center;
    color: #ffd166;
    font-size: 12.5px;
    padding: 0 20px;
    min-height: 16px;
}

/* ---- Berichten doorzoeken ---- */
#message-search-input {
    width: 100%;
    margin-bottom: 12px;
}

.message-search-results {
    max-height: 55vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-search-result {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--sigf-bg);
    background-image: none;
    border-radius: 10px;
    padding: 10px 12px;
}

.message-search-result:hover {
    background: var(--sigf-accent-bg);
}

.message-search-result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.message-search-result-header strong {
    font-size: 13px;
    color: var(--sigf-navy);
}

.message-search-result-header span {
    font-size: 11px;
    color: var(--sigf-text-muted);
}

.message-search-result-snippet {
    font-size: 13px;
    color: var(--sigf-text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---- Audio-apparaatkiezer tijdens een gesprek ---- */
.call-device-wrapper {
    position: relative;
}

.call-device-group {
    padding: 4px 6px;
}

.call-device-group + .call-device-group {
    border-top: 1px solid var(--sigf-border);
    margin-top: 4px;
    padding-top: 8px;
}

.call-device-group-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--sigf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 6px 6px;
}

.call-device-option {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    background-image: none;
    color: var(--sigf-text);
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-device-option:hover {
    background: var(--sigf-bg);
}

.call-device-option.active {
    color: var(--sigf-teal);
    font-weight: 700;
}

#call-device-menu {
    min-width: 220px;
    max-width: 280px;
}

/* ---- Bewerkt-label ---- */
.edited-label {
    font-size: 10px;
    opacity: 0.65;
    font-style: italic;
    margin-right: 4px;
}

/* ---- Spraakberichten ---- */
.recording-bar {
    background: #fdeceb;
}

.recording-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--sigf-error);
    animation: recording-pulse 1.2s ease-in-out infinite;
}

@keyframes recording-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#recording-timer {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.recording-bar .reply-preview-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recording-bar .secondary-button {
    flex-shrink: 0;
    padding: 6px 16px;
    font-size: 13px;
    margin-right: 4px;
}

/* ---- Eigen spraakbericht-speler (verzonden + voorvertoning) ---- */
.voice-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.voice-play-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.message-bubble.theirs .voice-play-btn {
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
}

.voice-play-btn .icon-play {
    margin-left: 1px;
}

.voice-track {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.message-bubble.mine .voice-track {
    background: rgba(255,255,255,0.3);
}

.voice-track-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--sigf-teal);
    border-radius: 999px;
}

.message-bubble.mine .voice-track-fill {
    background: #fff;
}

.voice-duration {
    flex-shrink: 0;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
    min-width: 28px;
}

/* ---- Voorvertoning vóór versturen ---- */
.voice-preview-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--sigf-accent-bg);
    border-top: 1px solid var(--sigf-accent-border);
}

.voice-preview-bar .voice-player {
    flex: 1;
    background: var(--sigf-surface);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
}

.voice-preview-bar .voice-play-btn {
    width: 30px;
    height: 30px;
}

.voice-preview-bar .voice-duration {
    color: var(--sigf-text);
    opacity: 1;
}

.voice-send-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    padding: 9px 20px;
    border-radius: 999px;
}

/* ---- Facturen ---- */
.invoices-heading {
    font-size: 13px;
    font-weight: 800;
    margin: 20px 0 8px;
    color: var(--sigf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---- Contextmenu voor gesprekken (dempen/archiveren/verwijderen) ---- */
#conv-context-menu {
    min-width: 200px;
}

/* ---- Terugkeer-naar-gesprek-balk (na minimaliseren tijdens een oproep) ---- */
.return-to-call-bar {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    max-width: calc(100vw - 32px);
}

.return-to-call-icon {
    font-size: 14px;
}

#return-to-call-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

#return-to-call-timer {
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

.return-to-call-hint {
    opacity: 0.85;
    font-weight: 500;
    display: none;
}

@media (min-width: 480px) {
    .return-to-call-hint {
        display: inline;
    }
}

/* ---- Contactprofielscherm ---- */
.header-profile-clickable {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    background-image: none;
    padding: 0;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.contact-profile-header {
    text-align: center;
    margin-bottom: 8px;
}

.contact-profile-header h3 {
    margin: 0 0 2px;
    font-size: 18px;
}

.nickname-section {
    margin: 16px 0;
}

.nickname-section label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

#contact-nickname-input {
    flex: 1;
    margin: 0;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.media-grid-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* ---- Ontdek Pro (alleen gratis gebruikers) ---- */
.discover-pro-button {
    background: linear-gradient(135deg, rgba(89,82,246,0.08), rgba(45,212,191,0.08));
    border-color: var(--sigf-teal);
    color: var(--sigf-indigo);
    font-weight: 700;
}

/* ---- Peilingen ---- */
.poll-widget {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    margin-top: 2px;
}

.poll-question {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.poll-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.06);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    overflow: hidden;
    text-align: left;
}

.message-bubble.mine .poll-option {
    background: rgba(255,255,255,0.18);
}

.poll-option-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(45,212,191,0.25);
    z-index: 0;
    transition: width 0.3s ease;
}

.message-bubble.mine .poll-option-fill {
    background: rgba(255,255,255,0.22);
}

.poll-option.poll-option-mine {
    font-weight: 700;
}

.poll-option-label,
.poll-option-pct {
    position: relative;
    z-index: 1;
}

.poll-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.poll-option-pct {
    flex-shrink: 0;
    opacity: 0.75;
    font-size: 11px;
}

.poll-total {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

/* ---- Inlog-/registratiepagina: opgeruimde links ---- */
.auth-container a {
    color: var(--sigf-indigo);
    font-weight: 600;
    text-decoration: none;
}

.auth-container a:hover {
    text-decoration: underline;
}

.auth-links {
    text-align: center;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
    color: var(--sigf-text-muted);
}

.auth-links p {
    margin: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--sigf-text-muted);
    font-size: 12px;
    margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--sigf-border);
}

.auth-divider span {
    padding: 0 12px;
}

.auth-qr-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 0;
    border: 1px solid var(--sigf-border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
}

.auth-qr-link:hover {
    background: var(--sigf-bg);
    text-decoration: none !important;
}

/* ---- QR-inloggen: statusregel met pulserend stipje ---- */
.qr-login-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: var(--sigf-text-muted);
    font-size: 13.5px;
    margin: 4px 0 0;
}

.qr-login-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sigf-teal);
    animation: qr-pulse 1.4s ease-in-out infinite;
}

@keyframes qr-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ---- Privacy-inzichtscherm ---- */
.insight-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.insight-stat {
    background: var(--sigf-bg);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}

.insight-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--sigf-navy);
}

.insight-stat-label {
    font-size: 12px;
    color: var(--sigf-text-muted);
}

.insight-category {
    padding: 10px 0;
    border-bottom: 1px solid var(--sigf-border);
}

.insight-category:last-child {
    border-bottom: none;
}

.insight-category-title {
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 2px;
}

.insight-category-detail {
    font-size: 12.5px;
    color: var(--sigf-text-muted);
}

/* ---- Instellingen: tabblad-layout ---- */
.settings-pane {
    display: none;
}

.settings-pane.active {
    display: block;
}

.settings-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0 16px 10px;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.settings-tab {
    background: none;
    background-image: none;
    color: var(--sigf-text-muted);
    font-weight: 700;
    font-size: 13px;
    padding: 7px 13px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-tab.active {
    background: var(--sigf-indigo);
    color: #fff;
}

/* Desktop: tabs als zijbalk naast de inhoud (zoals het ontwerp) */
@media (min-width: 720px) {
    .settings-modal {
        max-width: 720px;
        width: 92vw;
        display: grid;
        grid-template-columns: 190px 1fr;
        grid-template-rows: auto 1fr auto;
        grid-template-areas:
            "header header"
            "tabs   body"
            "footer footer";
    }

    .settings-modal .modal-header { grid-area: header; }
    .settings-modal .settings-tabs {
        grid-area: tabs;
        flex-direction: column;
        overflow-x: visible;
        padding: 4px 10px 16px 16px;
        border-right: 1px solid var(--sigf-border);
        align-items: stretch;
    }
    .settings-modal .settings-tab {
        text-align: left;
        border-radius: 10px;
        white-space: normal;
    }
    .settings-modal .modal-body { grid-area: body; }
    .settings-modal .modal-footer { grid-area: footer; }
}

/* ---- Privacy Score ---- */
.privacy-score-card {
    display: flex;
    align-items: center;
    gap: 18px;
}

.privacy-score-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: conic-gradient(var(--score-color, var(--sigf-teal)) calc(var(--score, 0) * 1%), var(--sigf-border) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.privacy-score-ring::before {
    content: '';
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--sigf-surface);
}

.privacy-score-ring span {
    position: relative;
    font-size: 24px;
    font-weight: 800;
    color: var(--sigf-navy);
}

.privacy-score-label {
    font-weight: 800;
    font-size: 14px;
    display: block;
    margin-bottom: 6px;
}

.privacy-score-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    color: var(--sigf-text-muted);
}

/* ---- Instellingen: snelkoppelingen (ontwerp-refresh) ---- */
.settings-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.settings-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 6px;
    background: var(--sigf-bg);
    background-image: none;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    color: var(--sigf-indigo);
}

.settings-shortcut:hover {
    background: var(--sigf-surface);
}

.settings-shortcut-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--sigf-text);
}

.settings-shortcut-sub {
    font-size: 10.5px;
    color: var(--sigf-text-muted);
}

/* ---- Loginhistorie ---- */
.login-history-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.login-history-dot.ok { background: #22c55e; }
.login-history-dot.fail { background: #ef4444; }

/* ==========================================================================
   v222.0 - Workspace Nav & Shell Foundation (Fase 0)
   CSS-only + isolated JS (assets/js/workspace-nav.js). Geen wijzigingen aan
   chat.js, API's, database of bestaande renderers. Bestaande IDs (my-avatar-
   button, sidebar-settings-button/-menu) zijn verplaatst naar de topbar,
   niet gedupliceerd of van gedrag veranderd.
   ========================================================================== */

.app-frame {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: var(--app-height, 100vh);
    overflow: hidden;
}

.app-frame .app-shell {
    height: auto;
    flex: 1;
    min-height: 0;
}

/* ---- Topbar ---- */
.app-topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--sigf-surface);
    border-bottom: 1px solid var(--sigf-border);
    flex-shrink: 0;
}

.app-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-topbar-brand .brand-logo { width: 24px; height: 24px; }

.app-topbar-brand .brand-name {
    font-weight: 800;
    font-size: 17px;
    color: var(--sigf-navy);
    letter-spacing: -0.3px;
}

.app-topbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--sigf-accent-bg);
    border: 1px solid var(--sigf-accent-border);
    border-radius: 10px;
    color: var(--sigf-text-muted);
    font-size: 13.5px;
    cursor: pointer;
    font-family: inherit;
}

.app-topbar-search-placeholder { flex: 1; text-align: left; }

.app-topbar-search-mobile-label { display: none; }

.app-topbar-search .kbd-hint {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--sigf-surface);
    border: 1px solid var(--sigf-border);
    color: var(--sigf-text-muted);
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sigf-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}

.topbar-icon-btn:hover { background: var(--sigf-accent-bg); color: var(--sigf-navy); }

.topbar-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--sigf-error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

.topbar-account-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.topbar-account-name-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.topbar-account-name-btn:hover { background: var(--sigf-accent-bg); }

.topbar-account-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--sigf-text);
    white-space: nowrap;
}

.topbar-account-chevron { color: var(--sigf-text-muted); font-size: 11px; }

.topbar-dropdown {
    min-width: 180px;
    padding: 6px;
}

.topbar-dropdown-empty {
    margin: 0;
    padding: 10px 8px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--sigf-text-muted);
    max-width: 240px;
}

/* ---- Workspace nav rail (desktop) ---- */
.workspace-nav {
    width: 76px;
    flex-shrink: 0;
    background: var(--sigf-rail-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    gap: 6px;
    overflow-y: auto;
}

.workspace-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    flex-shrink: 0;
}

.workspace-nav-item svg { flex-shrink: 0; }

.workspace-nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

.workspace-nav-item.active {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

.workspace-nav-more-wrapper {
    position: relative;
}

.workspace-nav-footer {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    justify-content: center;
}

.workspace-nav-footer .status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--sigf-success);
}

.workspace-nav-soon {
    margin-left: auto;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--sigf-text-muted);
    background: var(--sigf-border);
    padding: 2px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

.workspace-nav-divider {
    height: 1px;
    background: var(--sigf-border);
    margin: 10px 6px;
}

.workspace-nav-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
}

.workspace-pro-card {
    text-align: left;
    border: none;
    border-radius: 12px;
    padding: 12px;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    cursor: pointer;
    font-family: inherit;
}

.workspace-pro-card strong { display: block; font-size: 13px; }

.workspace-pro-card p {
    margin: 4px 0 8px;
    font-size: 11.5px;
    opacity: 0.9;
}

.workspace-pro-link { font-size: 11.5px; font-weight: 700; }

.workspace-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--sigf-text-muted);
    padding: 0 4px;
}

.workspace-status .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sigf-success);
    flex-shrink: 0;
}

/* ---- Toast (workspace-nav.js) ---- */
.workspace-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: var(--sigf-navy);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    z-index: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.workspace-toast.visible { opacity: 1; }

/* ---- Mobile bottom nav ---- */
.mobile-bottom-nav {
    display: none;
}

.mobile-more-modal {
    max-width: 360px;
}

.mobile-more-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-more-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--sigf-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.mobile-more-item:hover { background: var(--sigf-accent-bg); }

/* ---- Responsive ---- */
@media (max-width: 720px) {
    .app-topbar-brand .brand-name { display: none; }

    .app-topbar-search-placeholder { display: none; }

    .app-topbar-search-mobile-label { display: inline; flex: 1; text-align: left; }

    .app-topbar-search .kbd-hint { display: none; }

    .app-topbar-search { max-width: none; flex: 1; }

    .topbar-account-name { display: none; }

    .topbar-dropdown {
        position: fixed !important;
        top: 56px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none;
        max-height: 70vh;
    }

    .workspace-nav { display: none; }

    .mobile-bottom-nav {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        flex-shrink: 0;
        background: var(--sigf-surface);
        border-top: 1px solid var(--sigf-border);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .app-shell.show-chat ~ .mobile-bottom-nav {
        display: none;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 8px 4px 6px;
        border: none;
        background: transparent;
        color: var(--sigf-text-muted);
        font-family: inherit;
        font-size: 10.5px;
        font-weight: 700;
        cursor: pointer;
    }

    .mobile-nav-item.active { color: var(--sigf-indigo); }

    .mobile-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px 14px;
        border-radius: 12px;
    }

    .mobile-nav-item.active .mobile-nav-icon {
        background: var(--sigf-accent-bg);
    }
}

/* ---- Fix: zwevend tijd-badge bij niet-geladen foto (v222.0) ----
   .message-bubble.image-only .message-time is ontworpen om ÓVER een foto te
   liggen. Als de foto zelf niet laadt (bv. verlopen/kapotte bijlage), bleef
   voorheen alleen dat losse badge over, zwevend in de lege ruimte. Deze regel
   toont in plaats daarvan een duidelijke plek-houder en zet de tijd terug
   naar normale, niet-zwevende opmaak. Raakt alleen de fallback-staat; een
   normaal ladende foto ziet er identiek uit als voorheen. */
.attachment-broken-hint { display: none; }

.message-bubble.image-only.attachment-broken {
    min-width: 160px;
    min-height: 120px;
    background: var(--sigf-bubble-theirs);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 24px;
}

.message-bubble.image-only.attachment-broken .attachment-image-link {
    display: none;
}

.message-bubble.image-only.attachment-broken .attachment-broken-hint {
    display: block;
    color: var(--sigf-text-muted);
    font-size: 12.5px;
    text-align: center;
    padding: 0 16px;
}

.message-bubble.image-only.attachment-broken .message-time {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    background: none;
    color: var(--sigf-text-muted);
    text-align: center;
    padding: 0;
    opacity: 0.75;
}

/* ==========================================================================
   v222.1 - Home Dashboard (Fase 1)
   CSS-only + isolated JS (assets/js/dashboard.js). Toont/verbergt op basis
   van de bestaande .message-panel-header.empty-status (geen wijziging aan
   chat.js' openConversation-logica nodig, behalve de mark_read-call).
   ========================================================================== */

.message-panel-header.empty {
    display: none;
}

.home-dashboard {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 40px;
}

.home-dashboard.visible { display: block; }

/* Fix: zonder dit deelde #message-list (leeg, maar ook flex:1) de hoogte
   van .message-panel 50/50 met #home-dashboard, waardoor het dashboard maar
   de helft van de benodigde ruimte kreeg en "Recente activiteiten"/de
   vertrouwensstrip buiten het zichtbare (scrollbare) deel vielen. */
#home-dashboard.visible ~ #message-list {
    display: none;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--sigf-accent-bg), var(--sigf-surface));
    border: 1px solid var(--sigf-accent-border);
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 28px;
}

.dashboard-hero-text h1 {
    margin: 0 0 6px;
    font-size: 24px;
    color: var(--sigf-navy);
}

.dashboard-hero-text p {
    margin: 0;
    color: var(--sigf-text-muted);
    font-size: 14px;
}

.dashboard-hero-visual img {
    width: 56px;
    height: 56px;
    opacity: 0.85;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 12px;
}

.dashboard-section-header h2 {
    margin: 0;
    font-size: 15px;
    color: var(--sigf-text);
}

.dashboard-quickstart-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.dashboard-quickstart-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 10px;
    border-radius: 14px;
    border: 1px solid var(--sigf-border);
    background: var(--sigf-surface);
    color: var(--sigf-text);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
}

.dashboard-quickstart-tile svg { color: var(--sigf-indigo); }

.dashboard-quickstart-tile:hover {
    border-color: var(--sigf-accent-border);
    background: var(--sigf-accent-bg);
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.dashboard-metric-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--sigf-border);
    background: var(--sigf-surface);
}

.metric-tint-indigo { background: rgba(89, 82, 246, 0.07); border-color: rgba(89, 82, 246, 0.16); }
.metric-tint-teal { background: rgba(31, 157, 85, 0.07); border-color: rgba(31, 157, 85, 0.16); }
.metric-tint-amber { background: rgba(245, 166, 35, 0.08); border-color: rgba(245, 166, 35, 0.2); }
.metric-tint-coral { background: rgba(224, 99, 46, 0.08); border-color: rgba(224, 99, 46, 0.2); }

.dashboard-metric-icon { font-size: 16px; margin-bottom: 6px; }

.dashboard-metric-label {
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    font-weight: 700;
}

.dashboard-metric-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--sigf-navy);
    margin: 2px 0 4px;
}

.dashboard-metric-sub {
    font-size: 11.5px;
    color: var(--sigf-text-muted);
    margin-bottom: 10px;
}

.dashboard-metric-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--sigf-border);
    overflow: hidden;
}

.dashboard-metric-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.dashboard-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--sigf-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--sigf-surface);
}

.dashboard-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sigf-border);
    cursor: pointer;
}

.dashboard-activity-item:last-child { border-bottom: none; }

.dashboard-activity-item:hover { background: var(--sigf-accent-bg); }

.dashboard-activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sigf-accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

.dashboard-view-all-link {
    background: none;
    border: none;
    color: var(--sigf-indigo);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.dashboard-view-all-link:hover { text-decoration: underline; }

.dashboard-activity-icon.type-direct {
    background: var(--sigf-accent-bg);
    color: var(--sigf-indigo);
}

.dashboard-activity-icon.type-group {
    background: rgba(31, 157, 85, 0.14);
    color: var(--sigf-success);
}

@keyframes dashboardFlashHighlight {
    0%, 100% { box-shadow: none; }
    30% { box-shadow: 0 0 0 3px var(--sigf-indigo); }
}

.conversation-list.flash-highlight {
    animation: dashboardFlashHighlight 0.9s ease;
    border-radius: 10px;
}

.dashboard-activity-body { flex: 1; min-width: 0; }

.dashboard-activity-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sigf-text);
}

.dashboard-activity-detail {
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-activity-time {
    font-size: 11px;
    color: var(--sigf-text-muted);
    flex-shrink: 0;
}

.dashboard-activity-empty {
    padding: 16px;
    color: var(--sigf-text-muted);
    font-size: 13px;
}

.dashboard-trust-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--sigf-border);
}

.dashboard-trust-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
}

.dashboard-trust-item span { font-size: 18px; }

.dashboard-trust-item strong {
    display: block;
    font-size: 12.5px;
    color: var(--sigf-text);
    margin-bottom: 2px;
}

.dashboard-trust-item p {
    margin: 0;
    color: var(--sigf-text-muted);
    font-size: 11.5px;
    line-height: 1.4;
}

@media (max-width: 720px) {
    .home-dashboard { padding: 20px 16px 90px; }
    .dashboard-hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
    .dashboard-quickstart-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-trust-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   v222.2 - Command palette (Fase 2)
   Los, geïsoleerd bestand (assets/js/command-palette.js). Combineert de
   bestaande api/search_users.php + api/search_messages.php + de al geladen
   gesprekkenlijst (voor groepen) in één overzicht. Klik-acties "besturen"
   de bestaande, al werkende UI (gebruikerszoekveld / berichten-zoekmodal /
   gesprekkenlijst) in plaats van de aanmaak-/navigatielogica te dupliceren.
   ========================================================================== */

.command-palette-overlay {
    position: fixed;
    inset: 0;
    background: var(--sigf-overlay);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    z-index: 200;
}

.command-palette {
    width: 100%;
    max-width: 560px;
    max-height: 70vh;
    background: var(--sigf-surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.command-palette-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--sigf-border);
    flex-shrink: 0;
}

.command-palette-input-row .search-icon {
    color: var(--sigf-text-muted);
    font-size: 16px;
}

#command-palette-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 16px;
    font-family: inherit;
    color: var(--sigf-text);
}

.command-palette-input-row .kbd-hint {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--sigf-accent-bg);
    border: 1px solid var(--sigf-accent-border);
    color: var(--sigf-text-muted);
}

#command-palette-close {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    color: var(--sigf-text-muted);
}

#command-palette-close:hover {
    background: var(--sigf-accent-bg);
}

.command-palette-results {
    overflow-y: auto;
    padding: 8px;
}

.command-palette-hint,
.command-palette-empty {
    padding: 20px 14px;
    text-align: center;
    color: var(--sigf-text-muted);
    font-size: 13px;
    margin: 0;
}

.command-palette-section-label {
    padding: 10px 10px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--sigf-text-muted);
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.command-palette-item:hover,
.command-palette-item.active {
    background: var(--sigf-accent-bg);
}

.command-palette-item-body {
    flex: 1;
    min-width: 0;
}

.command-palette-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sigf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-palette-item-sub {
    font-size: 12px;
    color: var(--sigf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .command-palette-overlay { padding-top: max(16px, env(safe-area-inset-top)); align-items: stretch; }
    .command-palette { max-width: none; max-height: none; height: 100%; border-radius: 0; }
    .command-palette-esc-hint { display: none; }
}

/* ==========================================================================
   v222.3 - Notificatiecentrum (Fase 3)
   Los, geïsoleerd bestand (assets/js/notifications.js).
   ========================================================================== */

.notifications-dropdown {
    width: 380px;
    max-height: 420px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.notifications-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--sigf-border);
    flex-shrink: 0;
}

.notifications-dropdown-header strong {
    font-size: 13.5px;
    color: var(--sigf-text);
    white-space: nowrap;
}

#notifications-mark-all-read {
    background: none;
    border: none;
    color: var(--sigf-indigo);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

#notifications-mark-all-read:hover { text-decoration: underline; }

.notifications-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.notifications-empty {
    padding: 20px 14px;
    text-align: center;
    color: var(--sigf-text-muted);
    font-size: 12.5px;
    margin: 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.notification-item:hover { background: var(--sigf-accent-bg); }

.notification-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-item-top strong {
    font-size: 12.5px;
    color: var(--sigf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item-type {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--sigf-text-muted);
    background: var(--sigf-border);
    padding: 1px 5px;
    border-radius: 999px;
    flex-shrink: 0;
}

.notification-item-snippet {
    font-size: 12px;
    color: var(--sigf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item-time {
    font-size: 10.5px;
    color: var(--sigf-text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ==========================================================================
   v222.4 - Chats-lijst: header, filtertabs, favorieten
   ========================================================================== */

.chats-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 10px;
}

.chats-panel-title {
    margin: 0;
    font-size: 17px;
    color: var(--sigf-text);
}

.chat-filter-tabs {
    display: flex;
    gap: 6px;
    padding: 4px 0 12px;
    overflow-x: auto;
}

@media (max-width: 720px) {
    .chat-filter-tabs {
        justify-content: center;
    }
}

.chat-filter-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--sigf-border);
    background: var(--sigf-surface);
    color: var(--sigf-text-muted);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-filter-tab:hover {
    background: var(--sigf-accent-bg);
}

.chat-filter-tab.active {
    background: var(--sigf-indigo);
    border-color: var(--sigf-indigo);
    color: #fff;
}

.chat-filter-count {
    background: rgba(255,255,255,0.3);
    border-radius: 999px;
    padding: 0 6px;
    font-size: 10.5px;
}

.chat-filter-tab:not(.active) .chat-filter-count {
    background: var(--sigf-indigo);
    color: #fff;
}

/* ==========================================================================
   v222.5 - Toevoegen-menu (bijlage) redesign
   ========================================================================== */

.attach-menu-grid {
    min-width: 300px;
    padding: 10px;
}

.attach-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.attach-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 10px;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    background: var(--sigf-surface);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.attach-tile:hover {
    background: var(--sigf-accent-bg);
    border-color: var(--sigf-accent-border);
}

.attach-tile-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.attach-tile-icon-teal { background: rgba(31, 157, 85, 0.14); color: var(--sigf-success); }
.attach-tile-icon-purple { background: var(--sigf-accent-bg); color: var(--sigf-indigo); }
.attach-tile-icon-amber { background: rgba(245, 166, 35, 0.16); color: #a3670f; }
.attach-tile-icon-blue { background: rgba(55, 138, 221, 0.14); color: #185fa5; }

.attach-tile-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--sigf-text);
}

.attach-tile-sub {
    font-size: 10.5px;
    color: var(--sigf-text-muted);
}

.attach-paste-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: var(--sigf-bg);
    color: var(--sigf-indigo);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.attach-paste-row:hover { background: var(--sigf-accent-bg); }

.attach-paste-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sigf-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .attach-menu-grid { min-width: 260px; }
}

@media (max-width: 720px) {
    .chat-filter-tabs { justify-content: center; }
}

/* ==========================================================================
   v222.6 - Gespreksheader "Meer opties"-menu redesign
   ========================================================================== */

.header-menu-list {
    min-width: 230px;
    padding: 6px;
}

.header-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 8px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--sigf-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
}

.header-menu-item:hover {
    background: var(--sigf-accent-bg);
}

.header-menu-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-menu-icon-coral { background: rgba(226, 75, 74, 0.14); color: #a32d2d; }
.header-menu-icon-amber { background: rgba(245, 166, 35, 0.16); color: #a3670f; }
.header-menu-icon-red { background: rgba(226, 75, 74, 0.14); color: #a32d2d; }
.header-menu-icon-purple { background: var(--sigf-accent-bg); color: var(--sigf-indigo); }
.header-menu-icon-blue { background: rgba(55, 138, 221, 0.14); color: #185fa5; }

/* ==========================================================================
   v222.7 - Privacy Center: samenvoeging + encryptie-uitleg
   ========================================================================== */

.encryption-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--sigf-accent-bg);
    border: 1px solid var(--sigf-accent-border);
    margin-bottom: 16px;
}

.encryption-info-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--sigf-surface);
    color: var(--sigf-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.encryption-info-box strong {
    display: block;
    font-size: 13.5px;
    color: var(--sigf-navy);
    margin-bottom: 3px;
}

.encryption-info-box .settings-hint {
    margin: 0;
}

/* ==========================================================================
   v222.8 - Bestanden-hub
   ========================================================================== */

.files-hub-modal {
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.files-hub-modal .modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.files-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.files-hub-tile {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--sigf-surface);
}

.files-hub-tile-preview-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.files-hub-tile-preview-btn:hover .files-hub-tile-preview { filter: brightness(0.95); }

.files-hub-tile-actions {
    display: flex;
    border-top: 1px solid var(--sigf-border);
}

.files-hub-icon-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 4px;
    border: none;
    border-right: 1px solid var(--sigf-border);
    background: var(--sigf-bg);
    color: var(--sigf-text-muted);
    cursor: pointer;
    font-family: inherit;
}

.files-hub-icon-btn:last-child { border-right: none; }
.files-hub-icon-btn:hover { background: var(--sigf-accent-bg); color: var(--sigf-navy); }
.files-hub-icon-btn-danger { color: #a32d2d; }
.files-hub-icon-btn-danger:hover { background: rgba(226, 75, 74, 0.14); }

.files-hub-picker {
    position: fixed;
    z-index: 300;
    min-width: 180px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--sigf-surface);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    padding: 6px;
}

.files-hub-picker-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--sigf-text);
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-hub-picker-item:hover { background: var(--sigf-accent-bg); }

.files-hub-picker-empty {
    padding: 10px;
    font-size: 12px;
    color: var(--sigf-text-muted);
}

.files-hub-tile-preview {
    width: 100%;
    height: 100px;
    background: var(--sigf-accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.files-hub-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.files-hub-icon { font-size: 32px; }

.files-hub-tile-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--sigf-text);
    padding: 8px 10px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-hub-tile-meta {
    font-size: 10.5px;
    color: var(--sigf-text-muted);
    padding: 0 10px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .files-hub-modal { max-height: 100%; height: 100%; border-radius: 0; max-width: none; }
    .files-hub-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ==========================================================================
   v222.9 - Nextcloud-koppeling
   ========================================================================== */

.settings-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--sigf-text-muted);
    margin-top: 12px;
    margin-bottom: -2px;
}

.nextcloud-browser-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#nextcloud-browser-path {
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nextcloud-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 8px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--sigf-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.nextcloud-file-item:hover { background: var(--sigf-accent-bg); }

.nextcloud-file-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nextcloud-file-size {
    margin-left: auto;
    font-size: 11px;
    color: var(--sigf-text-muted);
    font-weight: 400;
    flex-shrink: 0;
}

/* ==========================================================================
   v222.11 - Notities
   ========================================================================== */

.notes-search-box {
    padding: 0 0 10px;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-card {
    display: flex;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--sigf-surface);
}

.notes-card-accent {
    width: 4px;
    flex-shrink: 0;
}

.notes-card-accent.private { background: var(--sigf-indigo); }
.notes-card-accent.shared { background: var(--sigf-success); }

.notes-card-body {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    cursor: pointer;
}

.notes-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.notes-card-top strong {
    font-size: 14px;
    color: var(--sigf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-card-snippet {
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-card-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(31, 157, 85, 0.14);
    color: var(--sigf-success);
    flex-shrink: 0;
    white-space: nowrap;
}

.notes-card-badge-private {
    background: var(--sigf-bg);
    color: var(--sigf-text-muted);
}

.notes-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-card-time {
    font-size: 11px;
    color: var(--sigf-text-muted);
}

.notes-card-actions {
    display: flex;
    gap: 2px;
}

.notes-card-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: none;
    color: var(--sigf-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-card-action-btn:hover { background: var(--sigf-accent-bg); color: var(--sigf-navy); }
.notes-card-action-btn-danger:hover { background: rgba(226, 75, 74, 0.14); color: #a32d2d; }

.notes-title-input {
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-bottom: 1px solid var(--sigf-border);
    border-radius: 0;
    padding: 8px 2px;
    margin-bottom: 10px;
}

.notes-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.notes-toolbar button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--sigf-bg);
    color: var(--sigf-text);
    font-size: 12px;
}

.notes-toolbar button:hover { background: var(--sigf-accent-bg); }

.notes-toolbar-right {
    margin-left: auto;
    width: auto !important;
    padding: 0 10px;
    font-size: 11.5px !important;
    font-weight: 700;
    color: var(--sigf-indigo);
    background: none !important;
}

.notes-content-textarea {
    width: 100%;
    min-height: 220px;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--sigf-text);
    background: var(--sigf-bg);
    resize: vertical;
}

#notes-share-select {
    margin-top: 6px;
    background: var(--sigf-bg);
    color: var(--sigf-text);
    border: 1px solid var(--sigf-border);
    border-radius: 999px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
}

.notes-content-preview {
    min-height: 220px;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--sigf-text);
}

.notes-content-preview p { margin: 0 0 8px; }
.notes-content-preview ul { margin: 0 0 8px; padding-left: 20px; }

.notes-share-row {
    margin-top: 12px;
}

.notes-share-fixed {
    font-size: 12px;
    color: var(--sigf-text-muted);
}

.notes-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

/* ==========================================================================
   v222.12 - Agenda
   ========================================================================== */

.calendar-datetime-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 10px 0;
}

.calendar-datetime-row input[type="date"],
.calendar-datetime-row input[type="time"] {
    margin-top: 6px;
}

.calendar-day-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--sigf-text-muted);
    margin: 14px 0 6px;
}

.calendar-day-header:first-child { margin-top: 0; }

.event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    background: var(--sigf-surface);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.event-card-time {
    flex-shrink: 0;
    width: 52px;
    font-size: 12px;
    font-weight: 700;
    color: var(--sigf-indigo);
    text-align: center;
}

.event-card-body {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.event-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sigf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-card-sub {
    font-size: 11.5px;
    color: var(--sigf-text-muted);
}

/* ==========================================================================
   v222.14 - Support
   ========================================================================== */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.faq-item {
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--sigf-surface);
}

.faq-item summary {
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sigf-text);
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
    content: '+';
    display: inline-block;
    width: 16px;
    color: var(--sigf-indigo);
    font-weight: 700;
}

.faq-item[open] summary::before {
    content: '−';
}

.faq-item p {
    margin: 8px 0 2px;
    font-size: 12.5px;
    color: var(--sigf-text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   v222.15 - Calls-overzicht
   ========================================================================== */

.call-log-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    background: var(--sigf-surface);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    margin-bottom: 8px;
}

.call-log-item:hover { background: var(--sigf-accent-bg); }

.call-log-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.call-log-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.call-log-avatar-initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.call-log-type-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--sigf-surface);
}

.call-log-type-badge.ok { background: var(--sigf-success); color: #fff; }
.call-log-type-badge.missed { background: #e24b4a; color: #fff; }

.call-log-body { flex: 1; min-width: 0; }

.call-log-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sigf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-log-sub {
    font-size: 11.5px;
    color: var(--sigf-text-muted);
}

.call-log-sub.bad { color: #a32d2d; font-weight: 600; }

.call-log-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--sigf-text-muted);
    flex-shrink: 0;
}

/* ==========================================================================
   v222.16 - Posts (Twitter-achtige feed)
   ========================================================================== */

.posts-compose-row {
    display: flex;
    gap: 8px;
    margin: 8px 0 4px;
}

.posts-compose-row select {
    flex: 1;
    margin-top: 0;
}

#posts-encryption-hint {
    margin-bottom: 14px;
}

.post-card {
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    background: var(--sigf-surface);
    padding: 12px 14px;
    margin-bottom: 8px;
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.post-avatar-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.post-avatar-initial {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sigf-indigo), var(--sigf-teal));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.post-card-author {
    flex: 1;
    min-width: 0;
}

.post-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--sigf-text);
}

.post-card-meta {
    font-size: 11px;
    color: var(--sigf-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-visibility-badge {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--sigf-border);
    color: var(--sigf-text-muted);
}

.post-follow-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 999px;
    background: var(--sigf-indigo);
    color: #fff;
}

.post-follow-btn.following {
    background: none;
    border: 1px solid var(--sigf-border);
    color: var(--sigf-text-muted);
}

.post-card-content {
    font-size: 13.5px;
    color: var(--sigf-text);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 8px;
}

.post-card-actions {
    display: flex;
    gap: 16px;
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--sigf-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.post-action-btn:hover { color: var(--sigf-navy); }
.post-action-btn.liked { color: #e24b4a; }

.posts-reply-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.posts-reply-row input {
    flex: 1;
}

.post-reply-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--sigf-border);
}

.post-reply-item:last-child { border-bottom: none; }

.post-reply-body { flex: 1; min-width: 0; }

.post-reply-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--sigf-text);
}

.post-reply-text {
    font-size: 12.5px;
    color: var(--sigf-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.post-reply-time {
    font-size: 10.5px;
    color: var(--sigf-text-muted);
}

/* ==========================================================================
   v222.18 - Posts als eigen pagina in het message-panel (i.p.v. modal)
   ========================================================================== */

.posts-page {
    display: none;
    flex: 1;
    overflow: hidden;
}

.message-panel.showing-posts #home-dashboard,
.message-panel.showing-posts #pinned-message-bar,
.message-panel.showing-posts #message-list,
.message-panel.showing-posts #typing-indicator,
.message-panel.showing-posts #reply-preview,
.message-panel.showing-posts #edit-preview,
.message-panel.showing-posts #recording-bar,
.message-panel.showing-posts #voice-preview-bar,
.message-panel.showing-posts #attachment-preview,
.message-panel.showing-posts #message-form {
    display: none !important;
}

.message-panel.showing-posts #posts-page {
    display: flex;
}

.posts-page-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 24px 28px 40px;
}

.posts-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.posts-page-header h1 {
    font-size: 20px;
    color: var(--sigf-navy);
    margin: 0;
}

.posts-page-header .chat-filter-tabs { padding: 0; }

.posts-page-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-left: 1px solid var(--sigf-border);
    padding: 24px 18px;
    overflow-y: auto;
}

.posts-compose-card { margin-bottom: 6px; }

.posts-compose-row-top {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.posts-compose-row-top textarea {
    flex: 1;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--sigf-text);
    min-height: 44px;
    background: none;
}

.posts-suggestions-card {
    border: 1px solid var(--sigf-border);
    border-radius: 12px;
    padding: 14px;
}

.posts-suggestions-card strong {
    font-size: 12.5px;
    color: var(--sigf-navy);
}

.posts-suggestion-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.posts-suggestion-row .info { flex: 1; min-width: 0; }

.posts-suggestion-row .name {
    font-size: 12px;
    font-weight: 700;
    color: var(--sigf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 960px) {
    .posts-page-sidebar { display: none; }
}

@media (max-width: 720px) {
    .posts-page { flex-direction: column; }
    .posts-page-main { padding: 16px; }
}

/* ==========================================================================
   v222.21 - Tekstgrootte-instelling (toegankelijkheid)
   ========================================================================== */

html.text-scale-sm { --sigf-text-scale: 0.9; }
html.text-scale-md { --sigf-text-scale: 1; }
html.text-scale-lg { --sigf-text-scale: 1.2; }

.text-scale-section {
    margin: 18px 0;
}

.text-scale-picker {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.text-scale-option {
    width: 44px;
    height: 40px;
    border-radius: 12px;
    background: var(--sigf-bg);
    color: var(--sigf-text);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-scale-option.active {
    background: var(--sigf-accent-bg);
    color: var(--sigf-indigo);
    border: 1.5px solid var(--sigf-indigo);
}

/* ==========================================================================
   v222.24 - Moderne, dunne scrollbalken (Chrome/Edge/Safari + Firefox)
   ========================================================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--sigf-border) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--sigf-border);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--sigf-text-muted);
}

/* ==========================================================================
   v222.28 - Bel-knoppenrij op mobiel: nette ruimte i.p.v. verdrukt
   6 knoppen x 60px + 20px tussenruimtes vroeg ~460px — past niet op de
   meeste telefoonschermen (~320-360px beschikbaar), vandaar de verdrukte
   indruk. Kleinere knoppen + kleinere tussenruimte, alleen op mobiel.
   ========================================================================== */

@media (max-width: 480px) {
    .call-controls {
        gap: 8px;
        bottom: 24px;
        padding: 0 10px;
    }

    .call-action-btn {
        width: 46px;
        height: 46px;
    }

    .call-action-btn svg {
        width: 18px;
        height: 18px;
    }

    .call-action-btn.decline {
        width: 52px;
        height: 52px;
        margin-left: 6px;
    }
}

/* ==========================================================================
   v222.29 - Taalkeuze
   ========================================================================== */

.language-option {
    height: 40px;
    border-radius: 12px;
    background: var(--sigf-bg);
    color: var(--sigf-text);
}

.language-option.active {
    background: var(--sigf-accent-bg);
    color: var(--sigf-indigo);
    border: 1.5px solid var(--sigf-indigo);
}
