/* chat.css — staff chat that deletes itself (chat.js). */

/* Buttons show only for staff Super Admin has paired. */
body:not(.gk-can-chat) .gk-chat-only { display: none !important; }

.sc-nav-btn { position: relative; }
.sc-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill, 999px);
  background: var(--brand-action, #c2006f);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sc-badge.hidden { display: none; }
#mobile-bottom-nav .nav-tab { position: relative; }
#mobile-bottom-nav .sc-badge {
  top: 5px;
  right: auto;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 0.6rem;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--ink-900, #111);
}

/* ---- the sheet ---- */
.sc-sheet .sc-content {
  width: min(480px, calc(100vw - 32px));
  max-width: 100%;
  height: min(640px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  padding: 16px;
  box-sizing: border-box;
}
.sc-sheet .modal-header { margin-bottom: 6px; }
.sc-people { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.sc-people[hidden] { display: none; }
.sc-person {
  border: 1px solid var(--border-light, #e5e5ea);
  background: var(--bg-white, #fff);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-dark, #222);
}
.sc-person.is-on { background: var(--brand-action, #c2006f); border-color: transparent; color: #fff; }
.sc-person__n {
  display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--brand-action, #c2006f); color: #fff; font-size: 0.66rem; line-height: 16px; text-align: center;
}
.sc-rule {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--accent-gold-light, #fdeef6);
  color: var(--text-dark, #333);
  font-size: 0.74rem;
}
.sc-rule i { color: var(--brand-action, #c2006f); margin-right: 4px; }

.sc-thread {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 2px;
  background: var(--bg-light, #f7f7f9);
  border-radius: 12px;
  overscroll-behavior: contain;
}
.sc-empty { margin: auto; text-align: center; color: var(--text-muted, #777); font-size: 0.85rem; }
.sc-empty i { font-size: 1.6rem; margin-bottom: 6px; color: var(--brand-action, #c2006f); opacity: .7; }

.sc-msg {
  max-width: 80%;
  align-self: flex-start;
  margin: 0 8px;
  padding: 8px 10px 6px;
  border-radius: 14px 14px 14px 4px;
  background: var(--bg-white, #fff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  font-size: 0.9rem;
  color: var(--text-dark, #222);
}
.sc-msg--mine {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: var(--brand-action, #c2006f);
  color: #fff;
}
.sc-msg.is-pending { opacity: .6; }
.sc-msg__text { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.sc-msg__foot { margin-top: 3px; font-size: 0.66rem; opacity: .75; display: flex; gap: 6px; justify-content: space-between; }

.sc-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.sc-form textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 12px;
  border-radius: 21px;
  border: 1px solid var(--border-light, #ddd);
  font: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.sc-send {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--brand-action, #c2006f);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  .sc-sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .sc-sheet .sc-content { width: 100%; height: 100dvh; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
}

/* ---- Settings: who can chat ---- */
.sc-set-on { margin-bottom: 10px; }
.sc-set-pairs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sc-set-pair {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border-light, #e5e5ea); border-radius: 10px;
  font-size: 0.85rem; font-weight: 600;
}
.sc-set-pair i { color: var(--brand-action, #c2006f); margin-right: 4px; }
.sc-set-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.85rem; }
.sc-set-add select { min-width: 0; flex: 1 1 130px; padding: 8px; border-radius: 8px; border: 1px solid var(--border-light, #ddd); font: inherit; }

/* ---- symbols (one tap, each with a meaning) ---- */
.sc-syms {
  /* Two rows that scroll sideways together, so 34 symbols fit without
     pushing the conversation off a phone screen. */
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  gap: 6px;
  overflow-x: auto;
  padding: 8px 2px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sc-syms::-webkit-scrollbar { display: none; }
.sc-sym {
  flex: none;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid var(--border-light, #e5e5ea);
  border-radius: 12px;
  background: var(--bg-white, #fff);
  cursor: pointer;
  color: var(--text-dark, #222);
}
.sc-sym:active { transform: scale(.95); background: var(--accent-gold-light, #fdeef6); }
.sc-sym__s { font-size: 1.5rem; line-height: 1.1; }
.sc-sym__en { font-size: 0.6rem; line-height: 1.15; text-align: center; color: var(--text-muted, #666);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-msg--sym { text-align: center; min-width: 120px; }
.sc-msg__sym { font-size: 2.4rem; line-height: 1.1; }
.sc-msg__meaning { font-size: 0.82rem; font-weight: 700; margin-top: 2px; }
.sc-msg__meaning span { display: block; font-weight: 500; font-size: 0.78rem; opacity: .85; }
.sc-set-pair__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-set-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.sc-set-name { display: flex; flex-direction: column; gap: 4px; font-size: 0.76rem; font-weight: 500; color: var(--text-muted, #666); }
.sc-set-name b { color: var(--text-dark, #222); }
.sc-set-name input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-light, #ddd); font: inherit; font-size: 0.85rem; color: var(--text-dark, #222); }

/* ---- message rows: reactions and Super Admin's swipe to delete ---- */
.sc-row { position: relative; display: flex; flex-direction: column; align-items: flex-start; }
.sc-row--mine { align-items: flex-end; }
.sc-row.can-swipe { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.sc-row__in { position: relative; z-index: 1; display: flex; align-items: center; gap: 2px; max-width: 100%; transition: transform .16s ease; }
.sc-row--mine .sc-row__in { flex-direction: row-reverse; }
.sc-row.is-swiping .sc-row__in { transition: none; }
/* Uma, 2026-11-25: bubbles wrapped too early. The bubble's own percentage
   was taken from the shrink-wrapped row inside, not the chat's width; cap
   the row (bubble + smiley) against the chat instead, and keep the time line
   on one line so a short "Ok" is not squeezed. */
.sc-row .sc-row__in { max-width: 88%; }
.sc-row .sc-msg { max-width: 100%; min-width: 0; }
.sc-msg__foot { white-space: nowrap; }
.sc-row__bin {
  position: absolute; inset: 0 8px; display: none; align-items: center; justify-content: flex-end;
  padding: 0 16px; border-radius: 14px; background: #fde2e2; color: #c62828; font-size: 1.1rem;
}
.sc-row--mine .sc-row__bin { justify-content: flex-start; }
.sc-row.is-swiping .sc-row__bin { display: flex; }
.sc-row.is-armed .sc-row__bin { background: #d32f2f; color: #fff; }

.sc-react-btn, .sc-del-btn {
  flex: none; width: 30px; height: 30px; border: none; border-radius: 50%;
  background: transparent; color: var(--text-muted, #888); cursor: pointer; font-size: 0.95rem;
}
.sc-react-btn:hover, .sc-del-btn:hover { background: var(--bg-white, #fff); color: var(--brand-action, #c2006f); }
.sc-del-btn:hover { color: #c62828; }
/* On a phone, Super Admin swipes; the bin button is for a mouse. */
@media (hover: none) { .sc-del-btn { display: none; } }

.sc-msg { position: relative; }
.sc-msg.has-react { margin-bottom: 12px; }
.sc-reacts {
  position: absolute; bottom: -14px; right: 6px; display: flex; gap: 1px;
  padding: 1px 5px; border-radius: 999px; border: 1px solid var(--border-light, #e5e5ea);
  background: var(--bg-white, #fff); font-size: 0.85rem; line-height: 1.3; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.sc-msg--mine .sc-reacts { right: auto; left: 6px; }
.sc-picker {
  position: relative; z-index: 3; display: flex; gap: 2px; margin: 4px 8px 0;
  padding: 4px; border-radius: 999px; background: var(--bg-white, #fff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.sc-picker button {
  width: 38px; height: 38px; border: none; border-radius: 50%; background: transparent;
  font-size: 1.35rem; cursor: pointer;
}
.sc-picker button.is-on { background: var(--accent-gold-light, #fdeef6); }
.sc-picker button:active { transform: scale(1.2); }

.sc-undo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #263238; color: #fff; font-size: 0.85rem;
}
.sc-undo[hidden] { display: none; }
.sc-undo button { border: none; background: none; color: #ffcc80; font-weight: 800; font: inherit; font-weight: 800; cursor: pointer; }

/* ---- indicators: a coloured sign, nothing to read ---- */
.sc-inds { display: flex; gap: 10px; padding: 8px 2px 0; }
.sc-ind {
  width: 48px; height: 48px; border-radius: 50%; border-width: 3px; border-style: solid; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1;
}
.sc-ind:active { transform: scale(.92); }
.sc-ind--amber { border-color: #f59e0b; background: #fff7e6; }
.sc-ind--green { border-color: #16a34a; background: #e8f7ee; }
.sc-ind--red { border-color: #dc2626; background: #fdecec; }
.sc-msg--ind { background: transparent !important; box-shadow: none; padding: 2px 0 0; }
.sc-msg--ind .sc-msg__foot { color: var(--text-muted, #777); justify-content: center; }
.sc-indmsg {
  width: 76px; height: 76px; border-radius: 50%; border-width: 5px; border-style: solid;
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem; line-height: 1; margin: 0 auto;
}

/* ---- "Show new messages on the app icon" (push notifications) ---- */
.sc-push {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--accent-gold-light, #fdeef6); font-size: 0.8rem; color: var(--text-dark, #333);
}
.sc-push[hidden] { display: none; }
.sc-push i { color: var(--brand-action, #c2006f); margin-right: 4px; }
.sc-push button {
  flex: none; border: none; border-radius: 999px; padding: 6px 14px;
  background: var(--brand-action, #c2006f); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}

/* ---- one-tap symbols and indicators: only when Super Admin switches them on ---- */
.sc-sheet:not(.sc-sheet--tools) .sc-syms,
.sc-sheet:not(.sc-sheet--tools) .sc-inds,
.sc-sheet:not(.sc-sheet--tools) .sc-react-btn,
.sc-sheet:not(.sc-sheet--tools) .sc-reacts { display: none; }
.sc-sheet:not(.sc-sheet--tools) .sc-msg.has-react { margin-bottom: 0; }
.sc-set-symnote { margin-top: -4px; }

/* ---- status by the name (Uma, 2026-11-21: "very tiny ... noticeable only
   when paid attention"): a small faded sign, the words smaller still ---- */
.sc-sheet .modal-header { position: relative; gap: 6px; }
.sc-sheet .modal-header h3 { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 6px;
  white-space: nowrap; overflow: hidden; }
#sc-title-text { overflow: hidden; text-overflow: ellipsis; }
.sc-mood {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-sans, inherit); font-size: 0.62rem; font-weight: 500;
  color: var(--text-muted, #888); opacity: .75; letter-spacing: .01em;
}
.sc-mood[hidden] { display: none; }
.sc-mood > span[aria-hidden] { font-size: 0.78rem; }
@media (max-width: 380px) { .sc-mood__en { display: none; } }
.sc-person__mood { font-size: 0.62rem; margin-left: 3px; opacity: .8; vertical-align: 1px; }

.sc-my-mood {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1px dashed var(--border-light, #d8d8de); background: transparent;
  color: var(--text-muted, #999); font-size: 0.8rem; line-height: 1; cursor: pointer; opacity: .7;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.sc-my-mood.is-set { border-style: solid; opacity: 1; font-size: 0.85rem; }
.sc-my-mood:hover { opacity: 1; color: var(--brand-action, #c2006f); }
.sc-mood-menu {
  position: absolute; z-index: 5; top: 52px; right: 16px; min-width: 210px;
  display: flex; flex-direction: column; padding: 6px; border-radius: 12px;
  background: var(--bg-white, #fff); box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
.sc-mood-menu[hidden] { display: none; }
.sc-mood-menu__h { padding: 4px 10px 6px; font-size: 0.7rem; font-weight: 700; color: var(--text-muted, #888);
  text-transform: uppercase; letter-spacing: .04em; }
.sc-mood-menu button {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: none; border-radius: 8px;
  background: transparent; font: inherit; font-size: 0.86rem; color: var(--text-dark, #222); text-align: left; cursor: pointer;
}
.sc-mood-menu button:hover { background: var(--bg-light, #f5f5f7); }
.sc-mood-menu button.is-on { background: var(--accent-gold-light, #fdeef6); font-weight: 700; }
.sc-mood-menu .sc-mood-menu__clear { color: var(--text-muted, #777); border-top: 1px solid var(--border-light, #eee); border-radius: 0 0 8px 8px; margin-top: 2px; }
.sc-sheet .sc-content { position: relative; }

/* ---- a status sent with "Ring them too": a small line, not a bubble ---- */
.sc-row--status { align-items: center; }
.sc-statusmsg {
  margin: 2px auto; padding: 4px 10px; border-radius: 999px; max-width: 90%;
  background: var(--bg-white, #fff); border: 1px solid var(--border-light, #e5e5ea);
  font-size: 0.74rem; color: var(--text-muted, #666); text-align: center;
}
.sc-statusmsg b { color: var(--text-dark, #222); font-weight: 600; }
.sc-statusmsg i { color: var(--brand-action, #c2006f); font-size: 0.7rem; }
.sc-statusmsg__t { opacity: .7; font-size: 0.66rem; margin-left: 2px; }
.sc-mood-menu__ring {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px 6px; margin-top: 2px;
  border-top: 1px solid var(--border-light, #eee); font-size: 0.8rem; color: var(--text-dark, #333); cursor: pointer;
}
.sc-mood-menu__ring i { color: var(--brand-action, #c2006f); font-size: 0.75rem; }

/* ---- kept out of sight (Uma, 2026-11-24): no Chat button; hold the logo
   for 3 seconds. A new message is only a tiny dot on the logo. ---- */
.gk-chat-only { display: none !important; }
.sc-logo { position: relative; display: inline-flex; align-items: center;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  touch-action: none; /* no zoom or scroll from the logo, so taps and the L reach us */ }
.sc-logo img { -webkit-user-drag: none; pointer-events: none; }
.sc-dot {
  position: absolute; top: 1px; right: -5px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-action, #c2006f); opacity: .85; display: none;
}
body.gk-can-chat.gk-chat-dot .sc-dot { display: block; }

/* The hidden "just gone" list (hold the name 2 s; Uma, 2026-11-28). It takes
   the thread's place and looks like a plain, quieter thread. */
.sc-gone[hidden], .sc-thread[hidden] { display: none; }
.sc-gone .sc-msg { opacity: .8; }
#sc-title { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.sc-gone__bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted, #777); background: var(--surface, #fff); padding: 2px 2px 4px; }
.sc-gone__bar button { border: none; background: none; color: inherit; font-size: 0.9rem; padding: 4px 8px; cursor: pointer; }
.sc-gone__none { margin: auto; color: var(--text-muted, #777); font-size: 0.8rem; }
