/* AEOTEE Quiet States — tiny, trustworthy status UI and readable conversation bubbles.
   Pure presentation: V2 state, retry behavior, drafts, RTC and SW update gates stay untouched.
   Loaded LAST so older oversized/high-saturation styles do not win the cascade. */

/* 1. Compact encryption/verification status: a small nonblocking inline lozenge. */
.app.premium-ready #aeoteeChatSurface > #secureSessionStatus:not([hidden]){
 display:flex!important;align-items:center;justify-content:flex-start;align-self:flex-start;
 gap:9px;flex:0 0 auto;position:relative;min-height:31px!important;
 width:max-content!important;max-width:calc(100% - 26px)!important;
 margin:10px 13px 3px!important;padding:7px 11px!important;
 font:600 11px/1.4 "Segoe UI",system-ui,sans-serif!important;
 letter-spacing:0!important;border:1px solid #a796cb68!important;
 border-radius:11px!important;background:#201e3bec!important;
 color:#e7dff5!important;box-shadow:0 3px 11px #17122f2f!important;
 overflow-wrap:anywhere;z-index:1;
}
.app.premium-ready #aeoteeChatSurface > #secureSessionStatus[hidden]{
 display:none!important;
}
.app.premium-ready #secureSessionStatus::before{
 content:"";display:block;flex:0 0 7px;width:7px;height:7px;
 border-radius:50%;background:#b7a8dc;box-shadow:0 0 0 3px #b7a8dc24;
}
.app.premium-ready #secureSessionStatus[data-kind="loading"]{
 border-color:#9e8ac166!important;background:#231e3eed!important;color:#eee4fa!important;
}
.app.premium-ready #secureSessionStatus[data-kind="loading"]::before{
 background:#d9b6fa;box-shadow:0 0 0 3px #d9b6fa22;
}
.app.premium-ready #secureSessionStatus[data-kind="error"]{
 border-color:#ca8b9c8c!important;background:#352139ee!important;
 color:#ffe1e6!important;
}
.app.premium-ready #secureSessionStatus[data-kind="error"]::before{
 background:#f9a8ad;box-shadow:0 0 0 3px #f9a8ad28;
}
.app.premium-ready #secureSessionStatus[data-kind="success"]{
 border-color:#75b89a83!important;background:#1e3435ed!important;color:#def8e9!important;
}
.app.premium-ready #secureSessionStatus[data-kind="success"]::before{
 background:#94d4af;box-shadow:0 0 0 3px #94d4af28;
}
.app.premium-ready #secureSessionStatus[data-kind="notice"]{
 border-color:#dbb68a77!important;background:#342b39ed!important;color:#ffeacb!important;
}
.app.premium-ready #secureSessionStatus[data-kind="notice"]::before{background:#e4c093}
.app.premium-ready #secureSessionStatusText{min-width:0;max-width:100%;color:inherit!important}
.app.premium-ready #secureSessionSecurityBtn:not([hidden]){
 display:inline-flex!important;align-items:center;flex:0 0 auto;
 width:auto!important;min-height:28px!important;padding:5px 10px!important;
 background:#55416e!important;color:#fff1ff!important;border:1px solid #9276af!important;
 border-radius:8px!important;font:700 10px/1.3 "Segoe UI",system-ui,sans-serif!important;
 cursor:pointer;
}
.app.premium-ready #secureSessionSecurityBtn[hidden]{display:none!important}

/* V2 setup notice is a quiet editorial status line, NOT another warning card. */
.app.premium-ready .sidebar > #aeoteeV2SetupStatus:not([hidden]){
 display:block!important;position:relative;
 width:calc(100% - 34px)!important;max-width:none!important;
 min-height:0!important;margin:7px 17px 13px!important;
 padding:3px 2px 2px 14px!important;
 background:transparent!important;border:0!important;
 border-left:2px solid #c497a7!important;border-radius:0!important;
 box-shadow:none!important;
 color:#e9dce9!important;font:500 11px/1.5 "Segoe UI",system-ui,sans-serif!important;
 letter-spacing:0!important;overflow-wrap:anywhere;
}
.app.premium-ready .sidebar > #aeoteeV2SetupStatus[hidden]{display:none!important}
.app.premium-ready .sidebar > #aeoteeV2SetupStatus::before{
 content:"SECURITY · NEEDS ATTENTION";display:block;position:static;
 width:auto;height:auto;margin:0 0 4px!important;padding:0!important;
 border:0!important;border-radius:0!important;background:transparent!important;
 box-shadow:none!important;color:#e3b0c1!important;
 font:800 9px/1.3 "Segoe UI",system-ui,sans-serif!important;letter-spacing:.085em;
}
.app.premium-ready .sidebar > #aeoteeV2SetupStatus[data-kind="error"]{
 background:transparent!important;border:0!important;
 border-left:2px solid #dcb09c!important;color:#f0e0e5!important;
}
.app.premium-ready .sidebar > #aeoteeV2SetupStatus[data-kind="error"]::before{
 content:"SECURITY · SETUP ISSUE";color:#f0baa9!important;
}
.app.premium-ready .sidebar > #aeoteeV2SetupStatus[data-kind="success"]{
 background:transparent!important;border:0!important;
 border-left:2px solid #89bca7!important;color:#c9f1df!important;
}
.app.premium-ready .sidebar > #aeoteeV2SetupStatus[data-kind="success"]::before{
 content:"SECURITY · VERIFIED";color:#a2d5bd!important;
}

/* 3. Balanced, legible message surfaces: dusty rose not neon pink. */
.app.premium-ready #messages > .bubble{
 max-width:min(78%,570px)!important;
 padding:11px 14px!important;line-height:1.5!important;
 border-radius:16px!important;box-shadow:0 5px 16px #110d2b34!important;
 font-size:13px!important;letter-spacing:0!important;
}
.app.premium-ready #messages > .bubble.outgoing{
 background:#c9a4c2!important;border:1px solid #e3c0d9a6!important;
 color:#281d32!important;border-radius:16px 16px 5px 16px!important;
}
.app.premium-ready #messages > .bubble.incoming{
 background:#2b2849ef!important;border:1px solid #80769a80!important;
 color:#f5effd!important;border-radius:16px 16px 16px 5px!important;
}
.app.premium-ready #messages > .bubble .bubble-body{
 font:500 13px/1.56 "Segoe UI",system-ui,sans-serif!important;
 color:inherit!important;overflow-wrap:anywhere;
}
.app.premium-ready #messages > .bubble .message-protection{
 display:block;text-align:left!important;
 font:650 10px/1.45 "Segoe UI",system-ui,sans-serif!important;
 letter-spacing:.015em!important;opacity:1!important;margin:0 0 5px!important;
 color:#64516e!important;
}
.app.premium-ready #messages > .bubble.incoming .message-protection{color:#c7b7df!important}
.app.premium-ready #messages > .bubble .bubble-meta{
 display:flex!important;justify-content:flex-end!important;align-items:center!important;
 margin-top:6px!important;gap:5px!important;
 font:500 10px/1.2 "Segoe UI",system-ui,sans-serif!important;
 color:#65516d!important;opacity:1!important;
}
.app.premium-ready #messages > .bubble .bubble-meta span{
 font:inherit!important;color:inherit!important;opacity:1!important;
 display:inline!important;margin:0!important;
}
.app.premium-ready #messages > .bubble.incoming .bubble-meta{color:#c2b6d8!important}

/* A decryption failure must never resemble a successfully opened plaintext message. */
.app.premium-ready #messages > .bubble[data-content-protection="unavailable"],
.app.premium-ready #messages > .bubble[data-content-protection="recovery-required"],
.app.premium-ready #messages > .bubble[data-content-protection="identity-mismatch"],
.app.premium-ready #messages > .bubble[data-content-protection="unsupported"]{
 background:#504264f5!important;border:1px solid #a08cb48c!important;
 color:#fff6ff!important;box-shadow:0 5px 17px #120d2c46!important;
}
.app.premium-ready #messages > .bubble.incoming[data-content-protection="unavailable"],
.app.premium-ready #messages > .bubble.incoming[data-content-protection="recovery-required"],
.app.premium-ready #messages > .bubble.incoming[data-content-protection="identity-mismatch"],
.app.premium-ready #messages > .bubble.incoming[data-content-protection="unsupported"]{
 background:#292640f5!important;border-color:#80799e87!important;
}
.app.premium-ready #messages > .bubble[data-content-protection] .bubble-body{
 font-size:13px!important;line-height:1.52!important;
}
.app.premium-ready #messages > .bubble[data-content-protection="unavailable"] .message-protection,
.app.premium-ready #messages > .bubble[data-content-protection="recovery-required"] .message-protection,
.app.premium-ready #messages > .bubble[data-content-protection="identity-mismatch"] .message-protection,
.app.premium-ready #messages > .bubble[data-content-protection="unsupported"] .message-protection{
 color:#dbc6ec!important;
}
.app.premium-ready #messages > .bubble[data-content-protection="unavailable"] .bubble-meta,
.app.premium-ready #messages > .bubble[data-content-protection="recovery-required"] .bubble-meta,
.app.premium-ready #messages > .bubble[data-content-protection="identity-mismatch"] .bubble-meta,
.app.premium-ready #messages > .bubble[data-content-protection="unsupported"] .bubble-meta{
 color:#ded1ee!important;
}
.app.premium-ready #messages > .bubble .message-decrypt-retry{
 display:inline-flex!important;align-items:center;justify-content:center;
 min-height:30px!important;margin:8px 0 1px!important;padding:6px 11px!important;
 border:1px solid #c4abd596!important;border-radius:9px!important;
 background:#76618aff!important;color:#fff7ff!important;
 font:700 11px/1.3 "Segoe UI",system-ui,sans-serif!important;
 box-shadow:none!important;cursor:pointer;white-space:normal;
}
.app.premium-ready #messages > .bubble .message-decrypt-retry:hover:not(:disabled){
 background:#88719e!important;border-color:#dcc4e9!important;
}
.app.premium-ready #messages > .bubble .message-decrypt-retry:disabled{opacity:.6;cursor:wait}
.app.premium-ready #messages > .bubble .message-decrypt-retry:focus-visible{
 outline:2px solid #ffe1f6!important;outline-offset:2px!important;
}
/* Keep the latest button readable without covering whole message bubbles. */
.app.premium-ready #aeoteeChatSurface > .aeotee-scroll-latest{
 min-height:34px!important;padding:0 12px!important;
 border:1px solid #997facb0!important;background:#342d51f5!important;
 color:#f8f1ff!important;font:750 11px/1 "Segoe UI",system-ui,sans-serif!important;
 box-shadow:0 6px 17px #0b09245a!important;right:13px!important;
 border-radius:18px!important;
}
.app.premium-ready #aeoteeChatSurface > .aeotee-scroll-latest.has-new{
 background:#49335fff!important;color:#fff3ff!important;
}

/* 4. Update available: a quiet, premium floating card; keep explicit consent. */
html body #aeoteeUpdateNotice:not([hidden]){
 display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
 align-items:center!important;gap:10px 9px!important;flex-wrap:initial!important;
 width:min(352px,calc(100vw - 24px))!important;max-height:min(76dvh,300px)!important;
 overflow-y:auto!important;padding:16px!important;
 position:fixed!important;z-index:9000!important;
 right:max(12px,env(safe-area-inset-right))!important;
 bottom:max(12px,env(safe-area-inset-bottom))!important;left:auto!important;top:auto!important;
 background:linear-gradient(145deg,#262142,#1b1b38)!important;
 color:#f8f2ff!important;border:1px solid #8a77ad96!important;
 border-radius:17px!important;box-shadow:0 16px 50px #07051b99!important;
 font:500 12px/1.5 "Segoe UI",system-ui,sans-serif!important;
}
html body #aeoteeUpdateNotice[hidden]{display:none!important}
html body #aeoteeUpdateNotice::before{
 content:"✦  UPDATE READY";display:block;grid-column:1/-1;
 color:#eab6e8;font:800 10px/1.3 "Segoe UI",system-ui,sans-serif!important;
 letter-spacing:.11em;margin-bottom:-2px;
}
html body #aeoteeUpdateNotice p{
 grid-column:1/-1;width:auto!important;margin:0!important;max-width:100%;
 color:#e6dbf0!important;font:500 12px/1.55 "Segoe UI",system-ui,sans-serif!important;
 overflow-wrap:anywhere;
}
html body #aeoteeUpdateNotice button{
 display:inline-flex!important;justify-content:center;align-items:center;
 min-height:39px!important;padding:9px 13px!important;
 border:1px solid #e5a5e1a3!important;border-radius:11px!important;
 background:linear-gradient(110deg,#d48bdc,#c993d1)!important;
 color:#261732!important;font:750 11px/1.2 "Segoe UI",system-ui,sans-serif!important;
 cursor:pointer;box-shadow:none!important;white-space:nowrap;
}
html body #aeoteeUpdateNotice #aeoteeUpdateNow{grid-column:1;min-width:0}
html body #aeoteeUpdateNotice #aeoteeUpdateLater{
 grid-column:2;min-width:77px;
 color:#eee2f8!important;border:1px solid #6354759f!important;
 background:#36304f!important;
}
html body #aeoteeUpdateNotice button:disabled{opacity:.6;cursor:wait}
html body #aeoteeUpdateNotice button:focus-visible{
 outline:2px solid #f7c7f5!important;outline-offset:2px!important;
}
@media(max-width:680px){
 .app.premium-ready #aeoteeChatSurface > #secureSessionStatus:not([hidden]){
  max-width:calc(100% - 20px)!important;margin:8px 10px 3px!important;
  font-size:11px!important;
 }
 .app.premium-ready #messages>.bubble{max-width:88%!important;padding:10px 12px!important}
 .app.premium-ready #messages>.bubble .bubble-body{font-size:13px!important}
 .app.premium-ready .sidebar > #aeoteeV2SetupStatus:not([hidden]){
  margin-inline:11px!important;width:calc(100% - 22px)!important;
 }
 html body #aeoteeUpdateNotice:not([hidden]){
  left:12px!important;right:12px!important;bottom:max(12px,env(safe-area-inset-bottom))!important;
  width:auto!important;max-height:50dvh!important;
 }
}
@media(prefers-reduced-motion:reduce){
 html body #aeoteeUpdateNotice:not([hidden]){animation:none!important;transition:none!important}
}
html.premium-motion-off #aeoteeUpdateNotice:not([hidden]){animation:none!important;transition:none!important}


/* Unopened encrypted messages: unmistakable direction AND honest error copy.
   The left/right location, tail, contrast and visible direction tag all differ. */
.app.premium-ready #messages > .bubble.outgoing:is(
 [data-content-protection="unavailable"],
 [data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],
 [data-content-protection="unsupported"]){
 background:#d6b4c9!important;border:1px solid #f2d8e5c9!important;
 border-right:3px solid #80506e!important;color:#2d2038!important;
 border-radius:16px 16px 4px 16px!important;box-shadow:0 5px 17px #30203835!important;
 margin-left:auto!important;margin-right:0!important;
}
.app.premium-ready #messages > .bubble.incoming:is(
 [data-content-protection="unavailable"],
 [data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],
 [data-content-protection="unsupported"]){
 background:#222d4aef!important;border:1px solid #8d9ec47d!important;
 border-left:3px solid #8db2d5!important;color:#f5f5ff!important;
 border-radius:16px 16px 16px 4px!important;box-shadow:0 5px 17px #0f122d47!important;
 margin-left:0!important;margin-right:auto!important;
}
.app.premium-ready #messages > .bubble.outgoing:is(
 [data-content-protection="unavailable"],
 [data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],
 [data-content-protection="unsupported"]) .bubble-body::before{
 content:"↗  YOU";display:block;margin:0 0 8px;
 font:800 10px/1.25 "Segoe UI",system-ui,sans-serif;letter-spacing:.12em;
 color:#65435e!important;
}
.app.premium-ready #messages > .bubble.incoming:is(
 [data-content-protection="unavailable"],
 [data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],
 [data-content-protection="unsupported"]) .bubble-body::before{
 content:"↙  INCOMING";display:block;margin:0 0 8px;
 font:800 10px/1.25 "Segoe UI",system-ui,sans-serif;letter-spacing:.105em;
 color:#b3d2f2!important;
}
/* Bubble body keeps the decryption error; hide only its duplicated tiny heading. */
.app.premium-ready #messages > .bubble[data-content-protection="unavailable"] .message-protection{
 display:none!important;
}
.app.premium-ready #messages > .bubble.outgoing:is(
 [data-content-protection="unavailable"],
 [data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],
 [data-content-protection="unsupported"]) :is(.bubble-body,.message-protection,.bubble-meta,.bubble-meta span){
 color:#30223a!important;opacity:1!important;
}
.app.premium-ready #messages > .bubble.incoming:is(
 [data-content-protection="unavailable"],
 [data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],
 [data-content-protection="unsupported"]) :is(.bubble-body,.message-protection,.bubble-meta,.bubble-meta span){
 color:#f1f3ff!important;opacity:1!important;
}
.app.premium-ready #messages > .bubble.outgoing .message-decrypt-retry{
 background:#6e466e!important;color:#fff7ff!important;
 border-color:#81557d!important;
}
.app.premium-ready #messages > .bubble.incoming .message-decrypt-retry{
 background:#405779!important;color:#ffffff!important;
 border-color:#6c8bad!important;
}
.app.premium-ready #messages > .bubble.outgoing .message-decrypt-retry:hover:not(:disabled){
 background:#583859!important;
}
.app.premium-ready #messages > .bubble.incoming .message-decrypt-retry:hover:not(:disabled){
 background:#516d92!important;
}
@media(max-width:680px){
 .app.premium-ready .sidebar > #aeoteeV2SetupStatus:not([hidden]){
  width:calc(100% - 30px)!important;margin:7px 15px 12px!important;padding-left:12px!important;
 }
 .app.premium-ready #messages > .bubble.outgoing:is([data-content-protection="unavailable"],[data-content-protection="recovery-required"],[data-content-protection="identity-mismatch"],[data-content-protection="unsupported"]),
 .app.premium-ready #messages > .bubble.incoming:is([data-content-protection="unavailable"],[data-content-protection="recovery-required"],[data-content-protection="identity-mismatch"],[data-content-protection="unsupported"]){
  max-width:88%!important;
 }
}
