/* ============================================================
   APP STYLES — MESSAGING (Messages + Konek)
   ============================================================ */

/* ----------------------------------------------------------
   Messages (iMessage-style)
   ---------------------------------------------------------- */
.thread .scroll { padding: 104px 14px 92px; display: flex; flex-direction: column; }
/* Counteract Bootstrap 5's .nav { display:flex } collapsing .nav-row so the
   header bar spans full width and the compose icon sits at the far right. */
.nav-row { width: 100%; }
/* Neutralize Bootstrap's .row negative margins for message list rows only
   (settings rows keep Bootstrap's default); keeps rows flush and the unread
   dot inside the left gutter instead of clipped at the phone edge. */
.view[data-view="messages-list"] .row { margin: 0; }
/* Force the unread dot to a 10px circle (reference value). Some cross-origin
   rule (Bootstrap) sizes it to 24px and isn't enumerable via styleSheets, so
   pin it here with !important to guarantee the circular, unclipped dot. */
#apps .view[data-view="messages-list"] .row .unread { width: 10px !important; height: 10px !important; min-width: 0 !important; max-width: none !important; padding: 0 !important; flex: 0 0 10px !important; }
/* Neutralize Bootstrap 5 .row > * gutter padding on Messages list avatars so
   the photo fills its 44x44 circle (object-fit: cover) instead of being squeezed. */
#apps .view[data-view="messages-list"] .row > .av { padding: 0 !important; margin-top: 0 !important; width: 44px !important; height: 44px !important; flex: none !important; }
.thread-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; background: var(--bar); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid var(--sep); } /* theme-adaptive header: .nav/.nav.solid (components.css) add position, padding-top 50px and the solid background/border; var(--bar)/var(--sep) follow light/dark; translucent blurred bar over the scroll container; reference uses blur(20px) saturate(1.8) == saturate(180%) */
.thread-nav .nav-row { height: 70px; align-items: flex-start; grid-template-columns: 1fr auto 1fr; }
.thread-who { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 400; color: var(--label); width: auto; }
.thread-who .av { width: 42px; height: 42px; border-radius: 50%; font-size: 15px; display: grid; place-items: center; flex-shrink: 0; }
.thread-who > span:not(.av) { display: flex; align-items: center; gap: 6px; font: inherit; white-space: nowrap; }
.thread-who > span:not(.av) svg { width: 6px; height: 10px; color: var(--label3); }
.day { text-align: center; font-size: 11.5px; color: var(--label2); margin: 14px 0 8px; }
.day b { font-weight: 600; }
.b-row { display: flex; margin-bottom: 2px; }
.b-row.me { justify-content: flex-end; }
.b-row.end { margin-bottom: 9px; }
.b { position: relative; max-width: 74%; padding: 7px 12px 8px; border-radius: 18px; font-size: 16.5px; line-height: 1.3; word-wrap: break-word; }
.b.me { background: var(--bubble-me); color: #fff; }
.b.me.sms { background: var(--bubble-sms); }
.b.them { background: var(--bubble-them); color: var(--label); }
.b.tail.me::before { content: ""; position: absolute; bottom: 0; right: -7px; width: 20px; height: 20px; background: inherit; border-bottom-left-radius: 16px 14px; }
.b.tail.me::after { content: ""; position: absolute; bottom: 0; right: -10px; width: 10px; height: 20px; background: var(--bg); border-bottom-left-radius: 10px; }
.b.tail.them::before { content: ""; position: absolute; bottom: 0; left: -7px; width: 20px; height: 20px; background: inherit; border-bottom-right-radius: 16px 14px; }
.b.tail.them::after { content: ""; position: absolute; bottom: 0; left: -10px; width: 10px; height: 20px; background: var(--bg); border-bottom-right-radius: 10px; }
.b-img { width: 210px; height: 250px; border-radius: 18px; overflow: hidden; display: block; }
.b-img .media { width: 100%; height: 100%; }
.status-line { text-align: right; font-size: 11.5px; color: var(--label2); margin: -4px 2px 8px; }
.status-line b { font-weight: 600; }
.scroll .typing {
  display: flex;
  padding: 12px 14px;
}
.scroll .typing .typing-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bubble-them);
  border-radius: 18px;
  padding: 9px 12px;
  animation: typingPop 0.25s cubic-bezier(0.17, 0.89, 0.32, 1.3) both;
}
.scroll .typing .typing-bubble::before,
.scroll .typing .typing-bubble::after {
  content: "";
  position: absolute;
  background: var(--bubble-them);
  border-radius: 50%;
}
.scroll .typing .typing-bubble::before {
  width: 11px;
  height: 11px;
  bottom: -4px;
  left: -4px;
}
.scroll .typing .typing-bubble::after {
  width: 7px;
  height: 7px;
  bottom: -12px;
  left: -10px;
}
.scroll .typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--label2);
  opacity: 0.55;
  animation: typingDot 1.4s infinite ease-in-out both;
}
.scroll .typing i:nth-child(2) { animation-delay: 0.18s; }
.scroll .typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingPop {
  0% { opacity: 0; transform: scale(0.8) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes typingDot {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.25); opacity: 1; }
}
.new { animation: bubIn .35s cubic-bezier(.2,.9,.25,1) both; }
.composer { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 12px 34px; display: flex; align-items: center; gap: 10px; background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); flex-direction: column; align-items: stretch; }
.composer .cbar { display: flex; align-items: center; gap: 10px; }
.composer .field .ftxt.typing { color: var(--label); }
.composer .field .ftxt.typing::after {
  /* Blinking text caret shown while the composer is in the .typing state.
     inline-block keeps it glued to the end of the typed text without shifting
     layout or changing field height. */
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  background: var(--bubble-me);
  border-radius: 1px;
  vertical-align: baseline;
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink {
  50% { opacity: 0; }
}

/* Unknown Number flow choice block — rendered inside the chat scroll as a
   green sent-style bubble with white pill buttons (never in the composer).
   The .b.me.sms padding makes the green show as a border around the pills. */
.sms-choice {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sms-choice-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  color: #000;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
  text-align: left;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
  animation: bubIn .35s cubic-bezier(.2,.9,.25,1) both;
  cursor: pointer;
}
.sms-choice-btn:active { background: #f2f2f2; }
.composer .plus { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); color: var(--label2); font-size: 24px; line-height: 1; display: grid; place-items: center; }
.composer .field { flex: 1; min-height: 36px; border: 1px solid var(--sep); border-radius: 18px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; color: var(--label3); font-size: 16.5px; }
.composer .field svg { width: 20px; height: 20px; color: var(--label3); }

/* ----------------------------------------------------------
   Konek (Chat App)
   ---------------------------------------------------------- */
.kn-head { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: 54px 16px 0; height: 104px; display: flex; align-items: center; justify-content: space-between; background: var(--bg); }
.kn-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.kn-head .acts { display: flex; gap: 18px; color: var(--label); }
.kn-head svg { width: 24px; height: 24px; }
.kn .scroll { padding-top: 104px; }
.kn-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 16px; }
.kn-row:active { background: var(--fill); }
.kn-row .m { flex: 1; min-width: 0; }
.kn-row .m b { display: flex; gap: 5px; align-items: baseline; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn-row .m b small { font-weight: 400; color: var(--label2); font-size: 14px; }
.kn-row .m span { display: block; font-size: 13.5px; color: var(--label2); line-height: 1.35; margin-top: 2px; }
.kn-row .r { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; align-self: flex-start; padding-top: 3px; }
.kn-row .r small { font-size: 11.5px; color: var(--label2); white-space: nowrap; }
.kn-badge { background: #ff5b3a; color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 10px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; }
.kn-sec { font-size: 12.5px; color: var(--label2); padding: 14px 16px 4px; border-top: .5px solid var(--sep); margin-top: 6px; }
.kn-me-row { padding: 10px 16px 14px; }
.kn-me-row b { font-size: 18px; }
.kn-status { display: inline-block; font-size: 12px; color: var(--label2); border: 1px solid var(--sep); border-radius: 12px; padding: 2px 9px; margin-top: 4px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn-room { background: var(--kn-bg); }
.kn-room.igdm, .kn-room.igdm .nav, .kn-room.igdm .scroll { background: var(--bg); }
.kn-room.igdm .nav-t { display: flex; align-items: center; gap: 8px; justify-content: center; }
.kn-room.igdm .nav-t .av { border-radius: 50%; }
.kn-room.igdm .tm.them .tbub { background: var(--fill,#efeff4); color: var(--label); border-radius: 20px; }
.kn-room.igdm .tm.me .tbub { background: linear-gradient(135deg,#7b3fe4,#3b82f6); color: #fff; border-radius: 20px; }
.kn-room.igdm .tm .av { border-radius: 50%; }
.kn-room.igdm .kn-date { background: none; }
.kn-room.igdm .chip { border-color: #6f4ce8; color: #6f4ce8; }
.kn-room.igdm .kn-send { background: #3b82f6; }
.dm-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; text-align: left; }
.dm-row .m { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dm-row .m b { font-weight: 500; font-size: 15px; }
.dm-row .m span { color: var(--label2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row .m span.unr { color: var(--label); font-weight: 600; }
.dm-row .dot { width: 9px; height: 9px; border-radius: 50%; background: #3b82f6; }
.mo-gal .gal-t { display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 17px; text-transform: capitalize; }
.mo-gal .gal-t small { font-size: 12px; font-weight: 600; color: var(--label2); text-transform: none; }
.kn-room .nav { background: var(--kn-bg); border-bottom: 0; }
.kn-room .nav-t { opacity: 1; color: var(--label); }
.kn-room .nav-t small { font-weight: 400; color: var(--label2); margin-left: 4px; }
.kn-room .scroll { padding: 100px 12px 120px; display: flex; flex-direction: column; background: var(--kn-bg); }
.kn-date { align-self: center; background: var(--kn-date); color: var(--label2); font-size: 11.5px; padding: 4px 12px; border-radius: 12px; margin: 12px 0 6px; display: flex; gap: 5px; align-items: center; }
.kn-date svg { width: 11px; height: 11px; }
.tm { display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; }
.tm.first { margin-top: 10px; }
.tm .sp { width: 38px; flex: none; }
.tm .col { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 78%; }
.tm .nm { font-size: 12px; color: var(--label); opacity: .8; margin: 0 0 2px 2px; }
.tm .line { display: flex; align-items: flex-end; gap: 5px; }
.tm.me { justify-content: flex-end; }
.tm.me .line { flex-direction: row-reverse; }
.tbub { padding: 8px 11px; border-radius: 15px; font-size: 15px; line-height: 1.38; background: var(--kn-them); color: var(--label); word-wrap: break-word; max-width: 240px; }
.tm.first.them .tbub { border-top-left-radius: 4px; }
.tm.me .tbub { background: var(--kn-me); color: var(--kn-me-fg); }
.tm.me.first .tbub { border-top-right-radius: 4px; }
.tbub.img { padding: 0; overflow: hidden; width: 200px; height: 240px; display: block; }
.tbub.img .media { width: 100%; height: 100%; }
.tmeta { display: flex; flex-direction: column; align-items: flex-end; font-size: 10px; color: var(--label2); white-space: nowrap; line-height: 1.2; flex: none; }
.tm.them .tmeta { align-items: flex-start; }
.tmeta b { color: var(--kn-accent); font-weight: 700; font-size: 11px; }
.kn-compose { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg); padding: 8px 10px 32px; z-index: 6; }
.kn-chips { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 10px; max-height: 42vh; max-height: min(42vh,340px); overflow-y: auto; overscroll-behavior: contain; }
.kn-chips small { font-size: 11.5px; color: var(--label2); padding-left: 4px; display: flex; align-items: center; gap: 5px; }
.kn-chips small i { width: 6px; height: 6px; border-radius: 50%; background: var(--kn-accent); animation: typ 1.4s infinite; }
.chip { align-self: flex-start; text-align: left; font-size: 15px; padding: 9px 14px; border-radius: 18px; border: 1.5px solid var(--kn-accent); color: var(--kn-accent); background: transparent; line-height: 1.3; max-width: 100%; animation: bubIn .35s both; }
.chip:active { background: var(--kn-accent); color: #fff; }
.kn-bar { display: flex; align-items: center; gap: 8px; }
.kn-bar .plus { width: 32px; height: 32px; display: grid; place-items: center; color: var(--label2); }
.kn-bar .plus svg { width: 22px; height: 22px; }
.kn-field { flex: 1; min-height: 38px; border-radius: 19px; background: var(--fill); display: flex; align-items: center; padding: 8px 14px; font-size: 15.5px; line-height: 1.3; color: var(--label); word-break: break-word; }
.kn-field.empty { color: var(--label3); }
.kn-field .caret { display: inline-block; width: 2px; height: 18px; background: var(--kn-accent); margin-left: 1px; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
.kn-send { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--label3); flex: none; transition: background .2s,color .2s; }
.kn-send.on { background: var(--kn-accent); color: #fff; }
.kn-send svg { width: 18px; height: 18px; }
.kn-prof { color: #fff; background: #111; }
.kn-prof .bgp { position: absolute; inset: 0; }
.kn-prof .bgp .media { position: absolute; inset: 0; }
.kn-prof .bgp::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(0,0,0,.15),rgba(0,0,0,.05) 40%,rgba(0,0,0,.55)); }
.kn-prof .x { position: absolute; top: 58px; left: 16px; font-size: 30px; font-weight: 300; line-height: 1; z-index: 2; }
.kn-prof .who { position: absolute; left: 0; right: 0; bottom: 150px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 2; text-align: center; padding: 0 30px; }
.kn-prof .who b { font-size: 20px; font-weight: 600; }
.kn-prof .who span { font-size: 14px; opacity: .85; }
.kn-prof .acts { position: absolute; left: 0; right: 0; bottom: 52px; display: flex; justify-content: center; gap: 44px; z-index: 2; border-top: .5px solid rgba(255,255,255,.25); padding-top: 22px; margin: 0 22px; }
.kn-prof .acts button { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; }
.kn-prof .acts svg { width: 26px; height: 26px; }

/* ----------------------------------------------------------
   Shared playlist bubble in chat
   ---------------------------------------------------------- */
.tbub.pl { display: flex; flex-direction: column; padding: 0; overflow: hidden; width: 220px; text-align: left; background: #1c1c22 !important; color: #fff !important; border-radius: 18px; }
.pl-cv { display: block; width: 100%; aspect-ratio: 1/1; background-size: cover; background-position: center; }
.pl-t { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.pl-t small { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #ff6b81; }
.pl-t small svg { width: 12px; height: 12px; }
.pl-t b { font-size: 17px; font-weight: 700; }
.pl-t span { font-size: 13px; opacity: .7; }
.pl-t em { font-style: normal; font-size: 13px; font-weight: 600; color: #ff6b81; margin-top: 6px; }
.chip.chip-pl { border-color: #ff6b81; color: #e0284a; }

/* ----------------------------------------------------------
   Message links (open Maps, Notes, Photos…)
   ---------------------------------------------------------- */
.tlink { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; padding: 5px 11px 5px 5px; border-radius: 14px; background: var(--fill,#efeff4); color: var(--label); font-size: 13px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); align-self: flex-start; }
.tm.me .tlink { align-self: flex-end; }
.tlink .tl-ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 12px; overflow: hidden; }
.tlink .tl-ico svg { width: 14px; height: 14px; }
.b-row.lk { margin: 2px 0 8px; }
.b-row.lk.me { justify-content: flex-end; }

/* ----------------------------------------------------------
   Headers / footers in lists
   ---------------------------------------------------------- */
.bt-h { padding: 22px 32px 7px; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--label2,#8e8e93); }
.bt-foot { padding: 8px 32px; font-size: 13px; line-height: 1.35; color: var(--label2,#8e8e93); }
.grouped .group .switch.on { pointer-events: none; }