/* Tipao UI Overrides — framing + callouts
   Loaded after base theme to avoid changing the core template look.
*/
.tipao-callout { margin: 14px 0; }
.tipao-callout-inner {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
}

.tipao-callout-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.tipao-callout-title{
  font-weight: 700;
  letter-spacing: .2px;
}

.tipao-progress{
  font-weight: 700;
  opacity: .9;
}

.tipao-callout-body{
  line-height: 1.45;
  opacity: .95;
}

.tipao-callout-cta{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}

.tipao-callout-cta:hover{
  background: rgba(255,255,255,0.10);
}

/* Framing: reduce "too close to edge" risk on small screens without changing theme */
@media (max-width: 520px){
  .content-wrap, .main-content, .article, .container{
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .incident-grid { gap: 12px !important; }
}


/* ---------------------------
   Tipao Chat + Modal (MERCO)
   --------------------------- */
.tipao-chat { position: static; z-index: 9999; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

.tipao-chat-panel{
  width: min(420px, calc(100vw - 36px));
  height: min(640px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  position: fixed; right: 18px; top: 88px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10,12,18,0.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  overflow: hidden;
}
.tipao-chat-panel.open{ display: flex; }

.tipao-chat-head{
  display:flex; align-items:center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.00));
}
.tipao-chat-head .title{ font-weight: 800; letter-spacing: 0.10em; font-size: 12px; color: rgba(255,255,255,0.92); }
.tipao-chat-head .sub{ font-size: 12px; color: rgba(255,255,255,0.68); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tipao-chat-head .left{ display:flex; flex-direction:column; gap: 2px; }
.tipao-chat-head .right{ display:flex; align-items:center; gap: 8px; }
.tipao-iconbtn{
  height: 30px; min-width: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86);
  cursor: pointer;
  font-size: 12px;
}

.tipao-chat-body{ padding: 12px 14px; display:flex; flex-direction: column; gap: 10px; overflow: hidden; position: relative; }
.tipao-quick{ display:flex; flex-wrap: wrap; gap: 8px; }
.tipao-chip{
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.84);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.tipao-thread{
  flex: 1;
  overflow: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tipao-thread .msg{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 10px 12px;
}
.tipao-thread .msg.user{ background: rgba(86,170,255,0.10); border-color: rgba(86,170,255,0.20); }
.tipao-thread .msg.agent{ background: linear-gradient(180deg, rgba(14,165,233,0.08), rgba(0,0,0,0.18)); border-color: rgba(14,165,233,0.22); }
.tipao-thread .msg.system{ background: rgba(255,255,255,0.03); }
.tipao-thread .who{ font-size: 12px; font-weight: 750; color: rgba(255,255,255,0.85); margin-bottom: 4px; }
.tipao-thread .body{ font-size: 13px; color: rgba(255,255,255,0.82); line-height: 1.55; }
.tipao-thread .meta{ margin-top: 6px; font-size: 11px; color: rgba(255,255,255,0.56); }

/* GPT-like prose bubble */
.tipao-prose{ display:flex; flex-direction:column; gap: 7px; }
.tipao-prose-answer{
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,0.94);
  margin: 0;
}
.tipao-prose-next{
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.72);
  margin: 0;
}
.tipao-prose-next strong{ color: rgba(255,255,255,0.96); font-weight: 600; }
.tipao-prose-why{
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.46);
  margin: 0;
}
.tipao-expand{
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 6px 10px;
}
.tipao-expand summary{
  cursor: pointer;
  font-size: 12px;
  color: rgba(125,211,252,0.80);
  font-weight: 600;
}
.tipao-expand ul{ margin: 8px 0 0; padding-left: 16px; }
.tipao-expand li{ margin: 4px 0; color: rgba(255,255,255,0.72); line-height: 1.45; font-size: 12px; }

/* Compressed older messages */
.msg.compressed .msg-preview{
  font-size: 13px;
  color: rgba(255,255,255,0.50);
  line-height: 1.4;
}
.tipao-expand-btn{
  border: none; background: none;
  color: rgba(125,211,252,0.70);
  font-size: 12px; cursor: pointer;
  padding: 0 2px;
}
.tipao-expand-btn:hover{ color: rgba(125,211,252,1); }

/* Follow-up chips */
.tipao-followups{ display: flex; flex-wrap: wrap; gap: 8px; }
.tipao-followup{
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: rgba(14,165,233,0.10);
  color: rgba(240,249,255,0.92);
  padding: 7px 11px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
}
.tipao-followup:hover{ background: rgba(14,165,233,0.18); }

/* Scroll-to-bottom button */
.tipao-scroll-btn{
  position: absolute; bottom: 8px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(10,12,18,0.82);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.tipao-scroll-btn[hidden]{ display: none; }

.tipao-chat-foot{
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display:flex; align-items:center; gap: 8px;
  background: rgba(0,0,0,0.18);
}
.tipao-input{
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  padding: 0 12px;
  outline: none;
  font-size: 13px;
}
.tipao-input::placeholder{ color: rgba(255,255,255,0.55); }
.tipao-btn{
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  border: 1px solid rgba(86,170,255,0.40);
  background: rgba(86,170,255,0.18);
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
  font-size: 16px;
}
.tipao-btn:disabled,
.tipao-input:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

/* Modal */
.tipao-modal{ position: fixed; inset: 0; z-index: 10000; display: none; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.tipao-modal.open{ display:block; }
.tipao-modal-backdrop{ position:absolute; inset:0; background: rgba(0,0,0,0.55); }
.tipao-modal-panel{
  position:absolute; left:50%; top:50%; transform: translate(-50%,-50%);
  width: min(520px, calc(100vw - 36px));
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10,12,18,0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 70px rgba(0,0,0,0.65);
  overflow: hidden;
}
.tipao-modal-head{
  display:flex; align-items:center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.tipao-modal-title{ font-weight: 850; font-size: 14px; color: rgba(255,255,255,0.92); }
.tipao-modal-x{
  height: 30px; width: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.tipao-modal-body{ padding: 14px; color: rgba(255,255,255,0.84); font-size: 13px; line-height: 1.6; }
.tipao-modal-body .muted{ color: rgba(255,255,255,0.62); }
.tipao-modal-foot{ padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.10); display:flex; justify-content:flex-end; }



/* =========================
   Tipao publication framing
   Prevent "too close to edge" on all screens
   ========================= */
.publication-wrapper{
  padding-left: clamp(24px, 5vw, 80px) !important;
  padding-right: clamp(24px, 5vw, 80px) !important;
}
.publication{
  width: min(900px, 100%);
}

/* Context Prompt (Conversational Chat Trigger) */
.context-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(14, 165, 233, 0.08);
  border-left: 4px solid #0ea5e9;
  border-radius: 8px;
  margin: 24px 0;
  cursor: pointer;
  transition: all 0.2s;
}

.context-prompt:hover {
  background: rgba(14, 165, 233, 0.15);
  transform: translateX(4px);
}

.prompt-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.prompt-text {
  flex: 1;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
}

.prompt-text strong {
  color: #0ea5e9;
  font-weight: 700;
}
