/* =====================================================================
   BATALHA PARTY — Rodada 47: janela "Suporte" do lobby (js/ui/screen-support.js; docs/ROUND47-SUPORTE.md).
   Moldura = a do Centro de tarefas (css/tasks.css: .tk-backdrop/.tk-wrap/.tk-panel/.tk-ribbon/.tk-close). Conteúdo no mesmo
   tom do painel creme: textos marrons, caixas brancas com borda bege, botões 3D (dourado = ação principal; verde
   WhatsApp; azul Telegram). Início: dois cards grandes; conversa: balões (você à direita em dourado, Suporte à esquerda
   em branco com o fone roxo); novo ticket: assuntos + descrição e, ao lado, os tickets anteriores.
   Palco fixo 1280x720 escalado: sem media queries.
   ===================================================================== */
.overlay.support { position: absolute; inset: 0; }
.sp-wrap { width: 1040px; height: 600px; }
.sp-panel { background: #f8f1e1; }
.sp-body {
  position: absolute; left: 0; right: 0; top: 46px; bottom: 10px; padding: 6px 28px 8px; color: #5a3a1a;
  display: flex; flex-direction: column; min-height: 0;
}
.sp-loading { margin: 0; padding: 180px 0; text-align: center; font-size: 20px; font-weight: 800; color: #9a7a4a; }
.sp-err { margin: auto; text-align: center; font-size: 20px; font-weight: 900; color: #c0392b; }
.sp-err p { margin: 0 0 16px; }
.sp-panel ::-webkit-scrollbar { width: 10px; }
.sp-panel ::-webkit-scrollbar-track { background: transparent; }
.sp-panel ::-webkit-scrollbar-thumb { background: #d9c9a3; border-radius: 5px; border: 2px solid #f8f1e1; }

/* ---------------------------------------------------------------- botões */
.sp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 58px; padding: 0 18px; border: 0; border-radius: 16px;
  cursor: pointer; font-family: inherit; font-size: 21px; font-weight: 900; white-space: nowrap; overflow: hidden; color: #fff;
  -webkit-text-stroke: 1.2px rgba(0, 0, 0, .4); paint-order: stroke fill; text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .06s, box-shadow .06s, filter .12s;
}
.sp-btn .ico { flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.sp-btn span { overflow: hidden; text-overflow: ellipsis; }
.sp-btn:hover:not(:disabled) { filter: brightness(1.06); }
.sp-btn.wa { background: linear-gradient(#5fe08a, #22a455); box-shadow: 0 6px 0 #11692f, 0 9px 10px rgba(0, 0, 0, .2); }
.sp-btn.tg { background: linear-gradient(#6cc8f7, #1f8ad0); box-shadow: 0 6px 0 #0f5585, 0 9px 10px rgba(0, 0, 0, .2); }
.sp-btn.gold {
  color: #3a1d00; -webkit-text-stroke: 0; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  background: linear-gradient(#ffd24a, #ff9c1a); box-shadow: 0 6px 0 #a05a00, 0 9px 10px rgba(0, 0, 0, .2);
}
.sp-btn.gray, .sp-btn:disabled {
  cursor: default; color: #4a4a58; -webkit-text-stroke: 0; text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  background: linear-gradient(#e9e9ee, #b3b3bd); box-shadow: 0 6px 0 #7a7a86, 0 9px 10px rgba(0, 0, 0, .15);
}
.sp-btn:active:not(:disabled) { transform: translateY(4px); }
.sp-btn.wa:active:not(:disabled) { box-shadow: 0 2px 0 #11692f; }
.sp-btn.tg:active:not(:disabled) { box-shadow: 0 2px 0 #0f5585; }
.sp-btn.gold:active:not(:disabled) { box-shadow: 0 2px 0 #a05a00; }
.sp-btn.big { height: 62px; min-width: 270px; font-size: 24px; }
.sp-btn.pulse { animation: sp-pulse 1.3s ease-in-out infinite; }
@keyframes sp-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.14); } }

/* ---------------------------------------------------------------- início: dois cards */
.sp-home { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sp-intro { margin: 2px 0 12px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 900; color: #7a5326; }
.sp-cards { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sp-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; padding: 0 20px 18px;
  background: #fff; border: 3px solid #e6d9bd; border-radius: 20px; overflow: hidden;
  box-shadow: 0 5px 0 rgba(120, 90, 40, .18), 0 10px 18px rgba(0, 0, 0, .08);
}
.sp-card-top { position: relative; flex: none; align-self: stretch; margin: 0 -20px 10px; height: 148px; display: flex; align-items: center; justify-content: center; }
.sp-card-top::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .38), transparent 58%); }
.sp-card.ext.wa .sp-card-top { background: linear-gradient(#6fe08e, #22a455); }
.sp-card.ext.tg .sp-card-top { background: linear-gradient(#73cdf7, #1f8ad0); }
.sp-card.ext.both .sp-card-top { background: linear-gradient(112deg, #6fe08e 0%, #22a455 49.6%, #1f8ad0 50.4%, #73cdf7 100%); }
.sp-card.tk .sp-card-top { background: linear-gradient(#b46af7, #7e22d6); }
.sp-card.off .sp-card-top { background: linear-gradient(#d6d6de, #a3a3b1); }
.sp-card-icons { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .25)); }
.sp-card.off .sp-card-icons { filter: grayscale(1) opacity(.65); }
.sp-pill {
  position: absolute; z-index: 2; top: 12px; right: 14px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: 999px; font-size: 14px; font-weight: 900; letter-spacing: .6px;
}
.sp-pill.live { background: #ff3b3b; color: #fff; box-shadow: 0 2px 0 #a01010; }
.sp-pill.live i { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: sp-blink 1.2s ease-in-out infinite; }
.sp-pill.soon { background: #fff; color: #7a5326; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
@keyframes sp-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.sp-card-title { font-size: 28px; font-weight: 900; line-height: 1.1; color: #4a2d0e; }
.sp-card-desc { margin-top: 8px; min-height: 44px; font-size: 17px; font-weight: 800; line-height: 1.3; color: #8a6234; }
.sp-card-hours, .sp-card-status {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 14px; border-radius: 999px;
  font-size: 16px; font-weight: 900; background: #f6efe0; border: 2px solid #eadcbf; color: #7a5326;
}
.sp-card-hours .ico { flex: none; }
.sp-card-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-card-status.open { background: #fff4d6; border-color: #ffd36a; color: #9a5a00; }
.sp-card-status.answered { background: #e3f8e6; border-color: #8fdc9c; color: #1f7a33; }
.sp-card-status.closed { background: #eeeef2; border-color: #d3d3dc; color: #5d5d6e; }
.sp-newbadge { flex: none; padding: 1px 9px; border-radius: 999px; background: #ff3b3b; color: #fff; font-size: 14px; box-shadow: 0 2px 0 #a01010; }
.sp-card-btns { margin-top: auto; padding-top: 12px; display: flex; justify-content: center; gap: 12px; width: 100%; }
.sp-card-btns .sp-btn { flex: 1 1 0; min-width: 0; max-width: 320px; }
.sp-homefoot { flex: none; display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }
.sp-oldnew {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 2px solid #ffd36a; background: #fff4d6; color: #9a5a00; font-family: inherit; font-size: 16px; font-weight: 900;
  box-shadow: 0 3px 0 rgba(160, 90, 0, .25); animation: sp-pulse 1.3s ease-in-out infinite;
}
.sp-oldnew:active { transform: translateY(2px); }
.sp-guide {
  align-self: center; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px 0 12px;
  border-radius: 999px; border: 2px solid #e6d9bd; background: #fff; color: #7a5326; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 900; box-shadow: 0 3px 0 rgba(120, 90, 40, .15);
}
.sp-guide:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 90, 40, .15); }

/* ---------------------------------------------------------------- barra do topo (conversa / novo ticket) */
.sp-chat, .sp-new { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sp-bar { flex: none; display: flex; align-items: center; gap: 12px; height: 50px; margin-bottom: 8px; }
.sp-backbtn, .sp-closebtn {
  flex: none; height: 42px; padding: 0 16px; border-radius: 12px; border: 2px solid #e6d9bd; background: #fff; cursor: pointer;
  font-family: inherit; font-size: 18px; font-weight: 900; color: #7a5326; box-shadow: 0 3px 0 rgba(120, 90, 40, .15);
}
.sp-backbtn:active, .sp-closebtn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 90, 40, .15); }
.sp-closebtn { border-color: #efc2bd; color: #c0392b; font-size: 16px; height: 38px; }
.sp-bar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 24px; font-weight: 900; color: #4a2d0e; }
.sp-bar-cat { font-size: 20px; color: #9a7a4a; }
.sp-bar-st { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.sp-stpill { padding: 5px 14px; border-radius: 999px; border: 2px solid; font-size: 16px; font-weight: 900; white-space: nowrap; }
.sp-stpill.open { background: #fff4d6; border-color: #ffd36a; color: #9a5a00; }
.sp-stpill.answered { background: #e3f8e6; border-color: #8fdc9c; color: #1f7a33; }
.sp-stpill.closed { background: #eeeef2; border-color: #d3d3dc; color: #5d5d6e; }

/* ---------------------------------------------------------------- conversa */
.sp-msgs {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
  background: #fbf6ea; border: 2px solid #ece3cf; border-radius: 16px; box-shadow: inset 0 2px 6px rgba(120, 90, 40, .08);
}
.sp-day { align-self: center; flex: none; }
.sp-day span { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #efe5cf; color: #8a6234; font-size: 13px; font-weight: 900; }
.sp-sys { align-self: center; flex: none; max-width: 90%; text-align: center; }
.sp-sys span { display: inline-block; padding: 5px 14px; border-radius: 999px; background: #eeeef2; border: 2px solid #d3d3dc; color: #5d5d6e; font-size: 14px; font-weight: 900; }
.sp-m { display: flex; max-width: 76%; flex: none; }
.sp-m.me { align-self: flex-end; flex-direction: column; align-items: flex-end; }
.sp-m.team { align-self: flex-start; align-items: flex-start; gap: 10px; }
.sp-av {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#b46af7, #7e22d6); border: 3px solid #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .2), 0 0 0 1.5px rgba(59, 10, 99, .35);
}
.sp-m.auto .sp-av { background: linear-gradient(#e6d6fb, #b99ae8); }
.sp-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.sp-who { margin: 0 0 3px 4px; font-size: 14px; font-weight: 900; color: #7e22d6; }
.sp-m.auto .sp-who { color: #9a7a4a; }
.sp-b { padding: 10px 14px; border-radius: 18px; font-size: 18px; font-weight: 700; line-height: 1.35; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.sp-m.me .sp-b { background: linear-gradient(#ffe27a, #ffb43a); color: #3a1d00; border-bottom-right-radius: 6px; box-shadow: 0 3px 0 #d98a1a; }
.sp-m.team .sp-b { background: #fff; color: #3b2a14; border: 2px solid #e6d9bd; border-bottom-left-radius: 6px; box-shadow: 0 3px 0 rgba(120, 90, 40, .12); }
.sp-m.auto .sp-b { background: #f5eeff; border: 2px dashed #c9a6f5; color: #4c1d95; }
.sp-t { margin-top: 4px; font-size: 13px; font-weight: 800; color: #a58a5e; white-space: nowrap; }
.sp-m.team .sp-t { margin-left: 4px; }
.sp-ck { letter-spacing: -2px; color: #b59c74; }
.sp-ck.on { color: #1f8ad0; }
.sp-cklbl { color: #a58a5e; }
.sp-typing { flex: none; display: flex; align-items: center; gap: 8px; height: 26px; padding: 2px 8px 0; font-size: 15px; font-weight: 900; color: #7e22d6; }
.sp-typing[hidden] { display: none; }
.sp-dots { display: inline-flex; gap: 4px; }
.sp-dots i { width: 7px; height: 7px; border-radius: 50%; background: #7e22d6; animation: sp-dot 1.2s ease-in-out infinite; }
.sp-dots i:nth-child(2) { animation-delay: .15s; }
.sp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sp-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.sp-foot { flex: none; margin-top: 8px; }
.sp-compose { display: flex; align-items: flex-end; gap: 12px; }
.sp-inbox {
  flex: 1 1 auto; min-width: 0; position: relative; display: flex; background: #fff; border: 2px solid #e6d9bd; border-radius: 16px;
  box-shadow: inset 0 2px 0 rgba(120, 90, 40, .08);
}
.sp-inbox:focus-within { border-color: #ffb43a; box-shadow: 0 0 0 3px rgba(255, 180, 58, .25); }
.sp-input, .sp-area {
  flex: 1 1 auto; min-width: 0; resize: none; border: 0; outline: none; background: transparent; font-family: inherit; font-weight: 700; color: #3b2a14;
}
.sp-input { height: 46px; min-height: 46px; max-height: 110px; padding: 11px 70px 11px 14px; font-size: 18px; line-height: 1.3; }
.sp-input::placeholder, .sp-area::placeholder { color: #b9a582; }
.sp-cnt { position: absolute; right: 12px; bottom: 6px; font-size: 12px; font-weight: 800; color: #a58a5e; pointer-events: none; }
.sp-cnt.warn { color: #c0392b; }
.sp-send {
  flex: none; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 16px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-size: 20px; font-weight: 900; color: #3a1d00; background: linear-gradient(#ffd24a, #ff9c1a);
  box-shadow: 0 5px 0 #a05a00, 0 8px 10px rgba(0, 0, 0, .2); transition: transform .06s, box-shadow .06s;
}
.sp-send:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #a05a00; }
.sp-send:disabled { cursor: wait; filter: grayscale(.4) brightness(.95); }
.sp-closedbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 6px 8px 6px 16px;
  background: #efe5cf; border-radius: 16px; font-size: 18px; font-weight: 900; color: #7a5326;
}
.sp-closedbar > span { display: inline-flex; align-items: center; gap: 8px; }
.sp-closedbar .sp-btn { height: 48px; font-size: 19px; }

/* ---------------------------------------------------------------- novo ticket + anteriores */
.sp-new-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
.sp-new-grid.nohist { grid-template-columns: minmax(0, 1fr); }
.sp-new-form { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.sp-lbl { margin: 0 0 8px 4px; font-size: 15px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: #8a6234; }
.sp-cats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.sp-cats.shake { animation: sp-shake .45s; }
@keyframes sp-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.sp-catbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px 0 10px; border-radius: 14px; border: 3px solid #e6d9bd;
  background: #fff; cursor: pointer; font-family: inherit; font-size: 18px; font-weight: 900; color: #5a3a1a; box-shadow: 0 3px 0 rgba(120, 90, 40, .15);
  transition: transform .06s;
}
.sp-catbtn:active { transform: translateY(2px); }
.sp-catbtn.on { border-color: #ff9c1a; background: #fff4d6; color: #7a3d00; box-shadow: 0 3px 0 #d98a1a, 0 0 0 3px rgba(255, 156, 26, .25); }
.sp-areabox { flex: 1 1 auto; min-height: 110px; position: relative; display: flex; background: #fff; border: 2px solid #e6d9bd; border-radius: 16px; box-shadow: inset 0 2px 0 rgba(120, 90, 40, .08); }
.sp-areabox:focus-within { border-color: #ffb43a; box-shadow: 0 0 0 3px rgba(255, 180, 58, .25); }
.sp-area { padding: 12px 14px 26px; font-size: 18px; line-height: 1.35; }
.sp-new-act { flex: none; display: flex; justify-content: flex-end; margin-top: 14px; padding-bottom: 6px; }
.sp-hist { display: flex; flex-direction: column; min-height: 0; padding: 10px 10px 6px; background: #fff; border: 2px solid #ece3cf; border-radius: 16px; box-shadow: 0 3px 0 rgba(120, 90, 40, .12); }
.sp-hist .sp-lbl { margin-left: 6px; }
.sp-hist-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sp-hrow {
  position: relative; width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "id cat dt" "st st st";
  align-items: center; gap: 4px 8px; padding: 9px 8px; border: 0; border-bottom: 2px solid #f2e9d6; border-radius: 10px 10px 0 0;
  background: transparent; cursor: pointer; text-align: left; font-family: inherit; color: #5a3a1a;
}
.sp-hrow:last-child { border-bottom: 0; }
.sp-hrow:hover { background: #fbf6ea; }
.sp-hrow .hid { grid-area: id; font-size: 17px; font-weight: 900; color: #7e22d6; }
.sp-hrow .hcat { grid-area: cat; font-size: 16px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-hrow .hdt { grid-area: dt; font-size: 13px; font-weight: 800; color: #a58a5e; }
.sp-hrow .hst { grid-area: st; justify-self: start; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 900; background: #eeeef2; color: #5d5d6e; }
.sp-hrow .hst.open { background: #fff4d6; color: #9a5a00; }
.sp-hrow .hst.answered { background: #e3f8e6; color: #1f7a33; }
.sp-dotn { position: absolute; right: 8px; bottom: 12px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
