.thread.source-facebook{border-left:4px solid #1877f2}.thread.source-email{border-left:4px solid #18a66a}.thread.source-instagram{border-left:4px solid #c13584}
.thread.source-facebook .source-icon{background:#1877f2}.thread.source-email .source-icon{background:#18a66a}.thread.source-instagram .source-icon{background:linear-gradient(135deg,#833ab4,#fd1d1d,#fcb045)}
.source-badge{display:inline-block;padding:2px 7px;border-radius:9px;color:white;font-size:12px;line-height:1.35}.source-facebook .source-badge{background:#1877f2}.source-email .source-badge{background:#18a66a}.source-instagram .source-badge{background:#c13584}
.thread.source-website{border-left:4px solid var(--warn)}.thread.source-website .source-icon{background:var(--warn)}.source-website .source-badge{background:var(--warn)}
.message-context{position:sticky;top:-28px;z-index:2;display:flex;align-items:center;gap:12px;margin:-12px 0 20px;padding:10px 14px;background:#fff;border:1px solid var(--rule);border-left:4px solid #18a66a;border-radius:10px;box-shadow:0 4px 14px var(--shadow-color)}.message-context strong{flex:none;color:var(--ok)}.message-context span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2);font-size:12.5px}.message-context.source-facebook{border-left-color:#1877f2}.message-context.source-facebook strong{color:#1877f2}.message-context.source-website{border-left-color:var(--warn)}.message-context.source-website strong{color:var(--warn)}.message-context.source-instagram{border-left-color:#c13584}.message-context.source-instagram strong{color:#c13584}
.messages .bubble{max-width:min(82%,760px);padding:17px 19px;border:1px solid var(--rule);box-shadow:0 5px 18px var(--shadow-color);line-height:1.5}.message-body{white-space:pre-wrap;overflow-wrap:anywhere}.quoted-message{margin-top:14px;padding-top:11px;border-top:1px solid var(--rule);color:var(--ink-2);font-size:13px}.quoted-message summary{cursor:pointer;color:var(--press);font-weight:600;user-select:none}.quoted-message>div{margin-top:12px;padding:12px;background:var(--surface-2);border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:360px;overflow:auto}
.messages.email-view{padding:24px 5%;background:var(--surface-2)}.email-subject{display:flex;align-items:center;gap:11px;margin-bottom:12px;padding:2px 4px}.email-subject>span{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:#18a66a;color:white;font-size:17px}.email-subject.source-website>span{background:var(--warn)}.email-subject h3{margin:0;font-size:19px;color:var(--ink)}.email-message{width:100%;max-width:920px;margin:0 auto 16px;padding:20px 22px;background:white;border:1px solid var(--rule);border-radius:12px;box-shadow:0 5px 18px var(--shadow-color)}.email-message>header{height:auto;padding:0 0 17px;border:0;display:grid;grid-template-columns:38px 1fr auto;gap:11px;align-items:center}.email-message>header i{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--ok-tint);color:var(--ok);font-style:normal;font-weight:800}.email-message.sent>header i{background:var(--press-tint);color:var(--press)}.email-message>header b{display:block;font-size:14px}.email-message>header small{display:block;margin-top:3px;color:var(--ink-3);font-size:12px}.email-message>header time{color:var(--ink-3);font-size:12px}.email-files{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px}.email-files>div{min-width:210px;padding:11px 13px;display:flex;align-items:center;gap:9px;background:var(--surface-2);border:1px solid var(--rule);border-radius:8px}.email-files span{color:var(--press)}.email-files b{font-size:12.5px}.email-body{min-height:60px;padding:4px 2px 18px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55;color:var(--ink)}.email-message .quoted-message{margin-bottom:3px}
.thread.source-whatsapp{border-left:4px solid #20b968}.thread.source-whatsapp .source-icon{background:#20b968}.source-whatsapp .source-badge{background:#20b968}.message-context.source-whatsapp{border-left-color:#20b968}.message-context.source-whatsapp strong{color:var(--ok)}
.thread.source-viber{border-left:4px solid #7360f2}.thread.source-viber .source-icon{background:#7360f2}.source-viber .source-badge{background:#7360f2}.message-context.source-viber{border-left-color:#7360f2}.message-context.source-viber strong{color:#5b48d6}
.message-images{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;margin-top:10px}.message-images img{display:block;width:100%;max-height:420px;object-fit:contain;border-radius:9px;background:var(--fill)}.message-images a{display:block}

/* v0.4.4 — email reading mode */
.messages.email-view{padding:22px clamp(18px,4vw,54px) 44px;background:var(--surface-2)}
.email-subject{max-width:860px;margin:0 auto 14px;padding:7px 2px;align-items:flex-start}
.email-subject h3{font-size:18px;line-height:1.38;letter-spacing:-.01em;white-space:normal}
.email-message{max-width:860px;padding:24px 28px;border-radius:14px;box-shadow:0 5px 20px var(--shadow-color)}
.email-message>header{padding-bottom:18px;margin-bottom:4px;border-bottom:1px solid var(--fill);grid-template-columns:42px 1fr auto;gap:12px}
.email-message>header i{width:42px;height:42px;font-size:15px}
.email-message>header b{font-size:15px;line-height:1.35}
.email-message>header small,.email-message>header time{font-size:12.5px;line-height:1.4}
.email-body{min-height:54px;max-width:74ch;padding:16px 0 10px;font-size:16px;line-height:1.72;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere;letter-spacing:.002em}
.email-files{margin:16px 0 4px}.email-files>div{background:var(--surface-2);border-color:var(--rule)}
.email-signature{max-width:74ch;margin-top:12px;padding-top:12px;border-top:1px dashed var(--rule);color:var(--ink-3);font-size:13px}
.email-signature summary{cursor:pointer;color:var(--ink-2);font-weight:650;user-select:none}
.email-signature>div{margin-top:10px;padding:12px 14px;background:var(--surface-2);border-radius:9px;white-space:pre-wrap;line-height:1.55}
.email-message .quoted-message{max-width:74ch;margin-top:14px;padding-top:13px}
.quoted-message summary{display:flex;align-items:center;gap:8px;font-size:13px}.quoted-message summary span{padding:2px 7px;border-radius:999px;background:var(--fill);color:var(--press);font-size:12px;font-weight:600}
.quoted-message>.quoted-thread{margin-top:10px}.quoted-thread>section{padding:13px 14px;background:var(--surface-2);border-color:var(--rule)}.quoted-body{font-size:13.5px;line-height:1.62;color:var(--ink-2);max-width:72ch}
.thread.source-email{min-height:96px}.thread.source-email p{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;line-height:1.35;margin-top:5px}
@media(max-width:900px){.messages.email-view{padding:16px 18px 36px}.email-message{padding:20px}.email-body{font-size:15px;line-height:1.65}.email-message>header{grid-template-columns:38px 1fr}.email-message>header time{grid-column:2}.email-subject h3{font-size:17px}}
