/* =============================
   File: /opt/triluma/public/triluma-companion-popup.css
   Version: 2026-07-01 v101
============================= */

.tri-companion-chat-overlay{
  position:fixed;
  inset:0;
  z-index:2147482500;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,.62);
}

.tri-companion-chat-modal{
  width:min(800px,95vw);
  min-height:86vh;
  max-height:86vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--tri-white);
  border:1px solid var(--tri-border);
  border-radius:18px;
  box-shadow:0 18px 55px rgba(0,0,0,.25);
  font-family:'Roboto', system-ui, sans-serif;
  color:var(--tri-text);
  animation:triCompanionFadeIn .25s ease-out;
}

.tri-companion-chat-header{
  flex:0 0 auto;
  display:flex;
  justify-content:space-between;
  gap:var(--tri-space-md);
  padding:14px 16px 12px;
  border-bottom:1px solid var(--tri-border);
  background:linear-gradient(90deg, #ffffff 0%, #f8fbfc 100%);
}

.tri-companion-chat-person{
  display:flex;
  align-items:flex-start;
  gap:14px;
  min-width:0;
}

.tri-companion-chat-avatar-button{
  display:block;
  width:150px;
  height:150px;
  padding:0;
  border:0;
  background:none;
  cursor:pointer;
  flex:0 0 150px;
  position:relative;
}

.tri-companion-chat-avatar{
  width:150px;
  height:150px;
  border-radius:10px;
  object-fit:cover;
  display:block;
}

.tri-companion-chat-avatar-button .tri-avatar-overlay{
  left:0;
  right:0;
  bottom:0;
  height:15px;
  padding:0 4px;
  font-size:6px;
  line-height:15px;
  border-bottom-left-radius:10px;
  border-bottom-right-radius:10px;
  position:absolute;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(190,238,248,0.55);
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  pointer-events:none;
}

.tri-companion-chat-text{
  min-width:0;
  display:flex;
  flex-direction:column;
  min-height:150px;
}

.tri-companion-chat-text h2{
  margin:0 0 4px;
  font-family:'EBGaramond', serif;
  font-size:28px;
  line-height:1.1;
  color:var(--tri-blue);
}

.tri-companion-chat-text p{
  margin:0;
  font-size:14px;
  line-height:1.35;
  color:var(--tri-text);
  max-width:62ch;
}

.tri-companion-chat-rating{
  display:flex;
  align-items:center;
  gap:3px;
  margin:4px 0 7px;
}

.tri-companion-chat-rating img{
  width:15px;
  height:15px;
}

.tri-companion-chat-rating span{
  margin-left:4px;
  font-size:12px;
  color:var(--tri-muted);
}

.tri-companion-chat-langs{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:auto;
}

.tri-companion-chat-langs span{
  border:1px solid var(--tri-border);
  border-radius:999px;
  padding:2px 8px;
  font-size:11px;
  line-height:1.4;
  color:var(--tri-blue-dark);
  background:var(--tri-white);
}

.tri-companion-chat-icon-btn{
  width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid var(--tri-border);
  background:var(--tri-white);
  color:var(--tri-text);
  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.tri-companion-chat-toolbar{
  flex:0 0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 16px;
  border-bottom:1px solid var(--tri-border);
  background:#eef6f8;
}

.tri-companion-chat-toolbar-group{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.tri-companion-chat-label{
  font-size:14px;
  color:var(--tri-text);
  white-space:nowrap;
}

.tri-companion-chat-btn{
  height:34px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid var(--tri-border);
  background:var(--tri-white);
  color:var(--tri-text);
  font:inherit;
  font-size:14px;
  cursor:pointer;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}

.tri-companion-chat-btn:hover,
.tri-companion-chat-btn.is-active,
.tri-companion-chat-icon-btn:hover{
  background:var(--tri-blue);
  color:var(--tri-white);
  border-color:var(--tri-blue);
}

.tri-companion-chat-voice[aria-pressed="true"]::after{
  content:"";
  display:inline-block;
  width:8px;
  height:8px;
  margin-left:6px;
  border-radius:999px;
  background:var(--tri-red);
}

.tri-companion-chat-messages{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  padding:18px 18px;
  background:
    linear-gradient(rgba(243,246,248,.94), rgba(243,246,248,.94)),
    radial-gradient(circle at 20% 10%, rgba(129,205,226,.30), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(248,198,139,.24), transparent 34%);
}

.tri-companion-chat-message{
  max-width:78%;
  margin:0 0 10px;
  padding:9px 12px;
  border-radius:14px;
  font-size:15px;
  line-height:1.45;
  word-wrap:break-word;
  white-space:pre-wrap;
  color:var(--tri-black);
}

.tri-companion-chat-message-user{
  margin-left:auto;
  background:var(--tri-chat-bguser);
  border-bottom-right-radius:5px;
}

.tri-companion-chat-message-assistant{
  margin-right:auto;
  background:#d7edf4;
  border-bottom-left-radius:5px;
}

.tri-companion-chat-message-system{
  margin-left:auto;
  margin-right:auto;
  max-width:70%;
  text-align:center;
  background:rgba(255,255,255,.7);
  color:var(--tri-black);
  border:1px dashed var(--tri-border);
  font-size:13px;
}

.tri-companion-chat-inputbar{
  flex:0 0 auto;
  padding:10px 16px 12px;
  border-top:1px solid var(--tri-border);
  background:#eef6f8;
}

.tri-companion-chat-input{
  width:100%;
  height:72px;
  min-height:72px;
  max-height:72px;
  resize:none;
  overflow-y:auto;
  border:1px solid var(--tri-border);
  border-radius:var(--tri-radius);
  background:var(--tri-white);
  color:var(--tri-text);
  font:inherit;
  font-size:15px;
  line-height:1.35;
  padding:9px 12px;
}

.tri-companion-chat-input:focus{
  outline:2px dotted var(--tri-blue-dark);
  outline-offset:3px;
}

.tri-companion-session-code{
  display:block;
  margin:12px 0;
  font-size:32px;
  line-height:1.1;
  font-weight:700;
  letter-spacing:.08em;
  color:var(--tri-orange);
}

.tri-companion-chat-hidden{ display:none !important; }

@keyframes triCompanionFadeIn{
  from{ opacity:0; }
  to{ opacity:1; }
}

@media(max-width:720px){
  .tri-companion-chat-overlay{ padding:0; }
  .tri-companion-chat-modal{
    width:100%;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }
  .tri-companion-chat-header{ align-items:flex-start; }
  .tri-companion-chat-avatar-button,
  .tri-companion-chat-avatar{
    width:96px;
    height:96px;
    flex-basis:96px;
  }
  .tri-companion-chat-text{ min-height:auto; }
  .tri-companion-chat-message{ max-width:92%; }
  .tri-companion-chat-toolbar{ align-items:flex-start; flex-direction:column; }
}


/* ===== Companion chat header adjustments v4 ===== */
.tri-companion-chat-modal{
  width:min(800px,95vw) !important;
}

.tri-companion-chat-avatar-button,
.tri-companion-chat-avatar{
  width:150px !important;
  height:150px !important;
  min-width:150px !important;
  min-height:150px !important;
  max-width:150px !important;
  max-height:150px !important;
}

.tri-companion-chat-avatar-button .tri-avatar-overlay{
  left:0;
  right:0;
  bottom:0;
  height:16px;
  padding:0 4px;
  font-size:7px;
  line-height:16px;
  border-bottom-left-radius:8px;
  border-bottom-right-radius:8px;
}

.tri-companion-chat-avatar-button .tri-avatar-plus{
  top:7px;
  right:7px;
  width:20px;
  height:20px;
  font-size:18px;
}

@media(max-width:720px){
  .tri-companion-chat-avatar-button,
  .tri-companion-chat-avatar{
    width:72px !important;
    height:72px !important;
    min-width:72px !important;
    min-height:72px !important;
    max-width:72px !important;
    max-height:72px !important;
  }
}

/* ===== Handover button v8 ===== */
.tri-companion-chat-handover{
  display:flex;
  justify-content:flex-start;
  gap:8px;
}

.tri-companion-chat-handover-btn{
  border:1px solid var(--tri-blue, #3aa0b8);
  border-radius:999px;
  background:var(--tri-blue, #3aa0b8);
  color:#fff;
  font:inherit;
  font-size:13px;
  line-height:1.2;
  padding:8px 14px;
  cursor:pointer;
}

.tri-companion-chat-handover-btn:hover{
  filter:brightness(.96);
}

/* =========================================================
   v34 Close-Button-Fix: runde X-Buttons exakt quadratisch
========================================================= */
.tri-companion-chat-icon-btn{
  width:38px;
  height:38px;
  min-width:38px;
  min-height:38px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  flex:0 0 38px;
  appearance:none;
  -webkit-appearance:none;
}

.tri-emergency-help-close{
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}

/* =========================================================
   COMPANION THINKING BUBBLE
   Stand: 2026-06-26 v53
========================================================= */

.tri-companion-chat-message.tri-companion-chat-thinking{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:auto;
  max-width:max-content;
  margin-right:auto;
  background:#d7edf4;
  border:0;
  border-bottom-left-radius:5px;
  text-align:left;
  color:var(--tri-black);
}

.tri-companion-chat-thinking-label{
  font-size:14px;
  line-height:1.3;
}

.tri-companion-chat-thinking-dots{
  display:inline-flex;
  align-items:center;
  gap:4px;
}

.tri-companion-chat-thinking-dots i{
  display:block;
  width:6px;
  height:6px;
  border-radius:999px;
  background:currentColor;
  opacity:.35;
  animation:triCompanionThinkingDot 1.05s infinite ease-in-out;
}

.tri-companion-chat-thinking-dots i:nth-child(2){ animation-delay:.15s; }
.tri-companion-chat-thinking-dots i:nth-child(3){ animation-delay:.30s; }

@keyframes triCompanionThinkingDot{
  0%, 80%, 100%{ transform:translateY(0); opacity:.35; }
  40%{ transform:translateY(-4px); opacity:1; }
}


/* ===== Companion help panel in Chat-Format v101 ===== */
.tri-companion-chat-help-btn,
.tri-chat-help-btn{
  width:34px;
  padding:0;
  font-weight:700;
}

.tri-chat-help-panel{
  text-align:left;
  cursor:pointer;
}

.tri-chat-help-panel table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  line-height:1.35;
}

.tri-chat-help-panel th,
.tri-chat-help-panel td{
  border-bottom:1px solid var(--tri-border, #e2e8f0);
  padding:7px 8px;
  vertical-align:top;
}

.tri-chat-help-panel tr:last-child th,
.tri-chat-help-panel tr:last-child td{
  border-bottom:0;
}

.tri-chat-help-panel th{
  width:34%;
  color:var(--tri-blue-dark, #1b6d7e);
  font-weight:700;
  white-space:nowrap;
}


/* =========================================================
   POPUP SCROLL LOCK + SQUARE DESKTOP MODAL
   Stand: 2026-07-02 v1
========================================================= */

html.tri-popup-scroll-locked,
body.tri-popup-scroll-locked{
  overflow:hidden !important;
  overscroll-behavior:none !important;
}


.tri-companion-chat-overlay{
  z-index:2147483400 !important;
  overflow:hidden !important;
  overscroll-behavior:contain !important;
}

.tri-companion-chat-modal{
  width:min(800px, calc(100vw - 36px)) !important;
  max-width:800px !important;
  height:min(800px, calc(100vh - 36px)) !important;
  min-height:0 !important;
  max-height:min(800px, calc(100vh - 36px)) !important;
  overflow:hidden !important;
  overscroll-behavior:contain !important;
}

.tri-companion-chat-messages{
  overscroll-behavior:contain !important;
  -webkit-overflow-scrolling:touch;
}

@media(max-width:720px){
  .tri-companion-chat-overlay{
    padding:0 !important;
  }

  .tri-companion-chat-modal{
    width:100% !important;
    max-width:none !important;
    height:100dvh !important;
    max-height:100dvh !important;
    border-radius:0 !important;
  }
}

/* === TRILUMA_THEME_RESTART30_V4_COMPANION_CHAT_START === */
html[data-theme="dark"] .tri-companion-chat-overlay{ background:rgba(0,0,0,.66) !important; }
html[data-theme="dark"] .tri-companion-chat-modal{
  background:var(--tri-dark-surface, #201f1d) !important;
  color:var(--tri-dark-text, #f3f1ed) !important;
  border:1px solid var(--tri-border) !important;
  box-shadow:var(--tri-dark-shadow, 0 20px 54px rgba(0,0,0,.44)) !important;
}
html[data-theme="dark"] .tri-companion-chat-header,
html[data-theme="dark"] .tri-companion-chat-toolbar,
html[data-theme="dark"] .tri-companion-chat-inputbar{
  background:var(--tri-dark-surface-2, #2a2825) !important;
  color:var(--tri-dark-text, #f3f1ed) !important;
  border-color:var(--tri-border) !important;
}
html[data-theme="dark"] .tri-companion-chat-text p,
html[data-theme="dark"] .tri-companion-chat-rating span,
html[data-theme="dark"] .tri-companion-chat-label{ color:var(--tri-dark-text, #f3f1ed) !important; }
html[data-theme="dark"] .tri-companion-chat-langs span{
  background:var(--tri-dark-surface, #201f1d) !important;
  color:var(--tri-blue-light) !important;
  border-color:var(--tri-border) !important;
}
html[data-theme="dark"] .tri-companion-chat-messages{
  background:var(--tri-chat-bgchat, #1b1b1a) !important;
}
html[data-theme="dark"] .tri-companion-chat-message-user{ background:var(--tri-chat-bguser, #283b31) !important; color:var(--tri-dark-text, #f3f1ed) !important; }
html[data-theme="dark"] .tri-companion-chat-message-assistant{ background:var(--tri-chat-bgactor, #213d46) !important; color:var(--tri-dark-text, #f3f1ed) !important; }
html[data-theme="dark"] .tri-companion-chat-message-system{ background:transparent !important; color:var(--tri-dark-muted, #cbc4bb) !important; border-color:var(--tri-border) !important; }
html[data-theme="dark"] .tri-companion-chat-input{
  background:var(--tri-dark-surface, #201f1d) !important;
  color:var(--tri-dark-text, #f3f1ed) !important;
  border-color:var(--tri-border) !important;
}
html[data-theme="dark"] .tri-companion-chat-btn,
html[data-theme="dark"] .tri-companion-chat-icon-btn{
  background:transparent !important;
  color:var(--tri-dark-text, #f3f1ed) !important;
  border:1px solid var(--tri-blue) !important;
  box-shadow:none !important;
}
html[data-theme="dark"] .tri-companion-chat-btn:hover,
html[data-theme="dark"] .tri-companion-chat-btn.is-active,
html[data-theme="dark"] .tri-companion-chat-icon-btn:hover{
  background:var(--tri-blue) !important;
  color:var(--tri-white) !important;
  border-color:var(--tri-blue) !important;
}
html[data-theme="dark"] .tri-companion-chat-icon-btn[aria-label*="schließen" i],
html[data-theme="dark"] .tri-companion-chat-icon-btn[aria-label*="close" i]{
  width:42px !important; height:42px !important; border-radius:12px !important;
  background:rgba(255,255,255,.08) !important; color:var(--tri-dark-text, #f3f1ed) !important;
}
/* === TRILUMA_THEME_RESTART30_V4_COMPANION_CHAT_END === */


/* === TRILUMA_THEME_RESTART30_V5_COMPANION_CHAT_START === */
html[data-theme="dark"] .tri-companion-chat-overlay{ background:rgba(0,0,0,.42) !important; }
html[data-theme="dark"] .tri-companion-chat-modal{ background:var(--tri-dark-surface,#1d1c1a) !important; color:var(--tri-dark-text,#f3f1ed) !important; border:1px solid var(--tri-dark-border-strong,rgba(255,255,255,.16)) !important; }
html[data-theme="dark"] .tri-companion-chat-header,
html[data-theme="dark"] .tri-companion-chat-toolbar,
html[data-theme="dark"] .tri-companion-chat-inputbar{ background:var(--tri-dark-surface-2,#292623) !important; color:var(--tri-dark-text,#f3f1ed) !important; border-color:var(--tri-dark-border,rgba(255,255,255,.095)) !important; }
html[data-theme="dark"] .tri-companion-chat-avatar-button .tri-avatar-plus{
  position:absolute !important; top:7px !important; right:7px !important; left:auto !important; bottom:auto !important;
  width:20px !important; height:20px !important; border-radius:50% !important;
  background:rgba(27,109,126,0.55) !important; color:#fff !important;
  display:flex !important; align-items:center !important; justify-content:center !important;
  font-size:18px !important; line-height:1 !important; pointer-events:none !important;
}
html[data-theme="dark"] .tri-companion-chat-btn,
html[data-theme="dark"] .tri-companion-chat-icon-btn{ background:transparent !important; color:var(--tri-dark-text,#f3f1ed) !important; border:1px solid var(--tri-blue) !important; box-shadow:none !important; }
html[data-theme="dark"] .tri-companion-chat-icon-btn[aria-label*="schließen" i],
html[data-theme="dark"] .tri-companion-chat-icon-btn[aria-label*="close" i]{ background:rgba(255,255,255,.08) !important; border-color:var(--tri-dark-border-strong,rgba(255,255,255,.16)) !important; }
/* === TRILUMA_THEME_RESTART30_V5_COMPANION_CHAT_END === */

/* === RESTART_30 DARK OVERLAY HOTFIX v13 START === */
html[data-theme="dark"] .tri-overlay,
html[data-theme="dark"] .tri-session-choice-overlay,
html[data-theme="dark"] #tri-session-choice-overlay.tri-session-choice-overlay,
html[data-theme="dark"] #tri-session-choice-overlay.tri-session-choice-overlay.tri-popup-fade,
html[data-theme="dark"] .tri-contact-overlay,
html[data-theme="dark"] .triluma-contact-overlay,
html[data-theme="dark"] .tri-contact-popup-overlay,
html[data-theme="dark"] .tri-auth-overlay,
html[data-theme="dark"] .tri-login-overlay,
html[data-theme="dark"] .tri-code-overlay,
html[data-theme="dark"] .tri-vcoach-popup-overlay,
html[data-theme="dark"] .tri-companion-info-overlay,
html[data-theme="dark"] .tri-trainer-info-overlay,
html[data-theme="dark"] .tri-talkway-info-overlay,
html[data-theme="dark"] .tri-chat-popup-overlay,
html[data-theme="dark"] .tri-chat-overlay,
html[data-theme="dark"] .tri-companion-chat-overlay,
html[data-theme="dark"] .tri-trainer-chat-overlay,
html[data-theme="dark"] .tri-popup-overlay,
html[data-theme="dark"] .tri-modal-overlay,
html[data-theme="dark"] .cp-overlay,
html[data-theme="dark"] .triluma-roi-overlay,
:root[data-theme="dark"] .tri-overlay,
:root[data-theme="dark"] .tri-session-choice-overlay,
:root[data-theme="dark"] #tri-session-choice-overlay.tri-session-choice-overlay,
:root[data-theme="dark"] .triluma-roi-overlay,
#tri-session-choice-overlay.tri-session-choice-overlay-dark-soft {
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

:host([data-theme="dark"]) .tri-overlay,
:host-context(html[data-theme="dark"]) .tri-overlay {
  background: rgba(0, 0, 0, 0.78) !important;
}
/* === RESTART_30 DARK OVERLAY HOTFIX v13 END === */


/* === RESTART_33 PRIVACY INFO + POPUP Z-INDEX v111 START === */
.tri-chat-privacy-btn,
.tri-companion-chat-privacy-btn,
.tri-trainer-chat-privacy-btn{
  white-space:nowrap;
}

/* Auth-/Info-/Confirm-Popups müssen über Chat-Popups liegen. */
.tri-auth-overlay,
.tri-login-overlay,
.tri-code-overlay,
.tri-info-overlay,
.tri-popup-overlay,
.tri-modal-overlay,
.tri-session-login-overlay,
.triluma-auth-overlay,
.triluma-info-overlay,
#tri-info-overlay,
#tri-auth-overlay,
#tri-login-overlay{
  z-index:2147483700 !important;
}

.tri-auth-popup,
.tri-login-popup,
.tri-code-popup,
.tri-info-popup,
.tri-popup,
.tri-modal,
.triluma-auth-popup,
.triluma-info-popup{
  z-index:2147483701 !important;
}
/* === RESTART_33 PRIVACY INFO + POPUP Z-INDEX v111 END === */

/* ===== Header icon actions v112 ===== */
.tri-companion-chat-header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:0 0 auto;
}
.tri-companion-chat-header-tool-btn{
  font-weight:700;
}
@media(max-width:720px){
  .tri-companion-chat-header-actions{ gap:6px; }
  .tri-companion-chat-header-actions .tri-companion-chat-icon-btn{
    width:34px;
    height:34px;
    min-width:34px;
    min-height:34px;
    font-size:20px;
  }
}

/* ===== Header icon fine-tuning v113 ===== */
.tri-companion-chat-header-actions{
  gap:6px;
}
.tri-companion-chat-header-tool-btn{
  width:32px;
  height:32px;
  min-width:32px;
  min-height:32px;
  padding:0;
  font-size:20px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
}
#tri-companion-chat-privacy{
  font-size:22px;
  line-height:1;
  padding-left:1px;
}
#tri-companion-chat-close{
  margin-left:10px;
}
@media(max-width:720px){
  .tri-companion-chat-header-actions{ gap:5px; }
  .tri-companion-chat-header-tool-btn{
    width:30px;
    height:30px;
    min-width:30px;
    min-height:30px;
    font-size:18px;
  }
  #tri-companion-chat-privacy{ font-size:20px; }
  #tri-companion-chat-close{ margin-left:8px; }
}

/* ===== Header icon fine-tuning v114 ===== */
.tri-companion-chat-header-tool-btn{
  font-weight:500 !important;
  font-size:18px !important;
}
.tri-companion-chat-privacy-symbol-btn{
  font-size:15px !important;
  font-weight:500 !important;
  line-height:1 !important;
  padding-left:0 !important;
}
#tri-companion-chat-privacy{
  font-size:15px !important;
}
@media(max-width:720px){
  .tri-companion-chat-header-tool-btn{
    font-size:16px !important;
  }
  .tri-companion-chat-privacy-symbol-btn,
  #tri-companion-chat-privacy{
    font-size:13px !important;
  }
}

/* ===== Header button vertical align fix v115 ===== */
.tri-companion-chat-header{
  align-items:flex-start;
}
.tri-companion-chat-header-actions{
  align-self:flex-start;
  margin-top:2px;
}

/* ===== Chat root z-index restore v116 ===== */
#triluma-chat-popup,
#triluma-companion-chat-popup,
#triluma-trainer-popup{
  position:fixed !important;
  inset:0 !important;
  z-index:2147483400 !important;
  pointer-events:none !important;
}

#triluma-chat-popup .tri-chat-overlay,
#triluma-companion-chat-popup .tri-companion-chat-overlay,
#triluma-trainer-popup .tri-trainer-chat-overlay{
  pointer-events:auto !important;
}

/* ===== Session save/load popup above chat v119 ===== */
.tri-session-login-overlay,
.tri-auth-overlay,
.tri-login-overlay,
.tri-code-overlay,
.tri-confirm-overlay,
.tri-info-overlay,
.triluma-auth-overlay,
.triluma-info-overlay,
#tri-session-login-overlay,
#tri-auth-overlay,
#tri-login-overlay,
#tri-code-overlay,
#tri-confirm-overlay,
#tri-info-overlay{
  position:fixed !important;
  inset:0 !important;
  z-index:2147483700 !important;
}

.tri-session-login-popup,
.tri-auth-popup,
.tri-login-popup,
.tri-code-popup,
.tri-confirm-popup,
.tri-info-popup,
.triluma-auth-popup,
.triluma-info-popup{
  position:relative !important;
  z-index:2147483701 !important;
}


/* ===== Companion switch select/panel v123 ===== */
.tri-companion-chat-select{
  border:1px solid var(--tri-border, #d9e3e8);
  border-radius:999px;
  background:var(--tri-white, #fff);
  color:var(--tri-blue-dark, #1b6d7e);
  font:inherit;
  font-size:13px;
  line-height:1.2;
  padding:7px 28px 7px 12px;
  max-width:180px;
}
.tri-companion-chat-switch-panel{ text-align:left; white-space:normal; }
.tri-companion-chat-switch-panel p{ margin:0 0 8px; }
.tri-companion-chat-switch-actions{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:10px; }
.tri-companion-chat-switch-btn{ border:1px solid var(--tri-blue, #3aa0b8); border-radius:999px; background:var(--tri-blue, #3aa0b8); color:#fff; font:inherit; font-size:13px; line-height:1.2; padding:8px 14px; cursor:pointer; }
.tri-companion-chat-switch-btn-light{ background:var(--tri-white, #fff); color:var(--tri-blue-dark, #1b6d7e); }
.tri-companion-chat-switch-btn:hover{ filter:brightness(.96); }


/* v4: Sprachflaggen in Chat-Kopfzeilen */
.tri-vcoach-lang,
.tri-companion-chat-langs,
.tri-trainer-chat-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tri-vcoach-lang .tri-chat-language-flag,
.tri-companion-chat-langs .tri-chat-language-flag,
.tri-trainer-chat-langs .tri-chat-language-flag {
  display: block;
  width: 19px !important;
  height: 19px !important;
  min-width: 19px;
  max-width: 19px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  object-fit: cover;
  flex: 0 0 19px;
}
.tri-vcoach-lang .tri-chat-language-fallback,
.tri-companion-chat-langs .tri-chat-language-fallback,
.tri-trainer-chat-langs .tri-chat-language-fallback {
  display: inline-flex;
  width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  font-size: 8px;
  line-height: 1;
}

/* === RESTART_33 INFO POPUP CSS FINAL v146 START === */
/*
  Nur CSS, keine JS-Styles.
  Finaler Popup-Optik-Fix:
  - Companion/Trainer Aktionsleiste ohne Hintergrundstreifen
  - Favoriten-Link ohne sichtbaren Button-Rahmen
  - Companion/Trainer Miniheadlines in tri-blue
  - Coach-Popup-Headlines bleiben tri-blue
*/

/* Aktionszeilen: kein Hintergrundbalken, kein Rahmen, keine Schatten */
#tri-companion-info-content .tri-companion-info-actions,
#tri-trainer-info-content .tri-trainer-info-actions,
.tri-companion-info-actions,
.tri-trainer-info-actions,
#tri-companion-info-content div:has(> button[data-info-action="start"]),
#tri-trainer-info-content div:has(> button[data-info-action="start"]) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  padding: 0 !important;
}

/* Buttons bleiben Buttons, aber ohne Leistenhintergrund der Zeile */
#tri-companion-info-content .tri-companion-info-actions .tri-header-btn,
#tri-trainer-info-content .tri-trainer-info-actions .tri-header-btn,
.tri-companion-info-actions .tri-header-btn,
.tri-trainer-info-actions .tri-header-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Favoriten-Link radikal als Link, nicht als Button/Pill */
#tri-companion-info-content a.tri-fav-link,
#tri-trainer-info-content a.tri-fav-link,
.tri-companion-info-actions a.tri-fav-link,
.tri-trainer-info-actions a.tri-fav-link,
.tri-vcoach-buttons a.tri-fav-link,
a.tri-fav-link {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-radius: 0 !important;
  color: var(--tri-blue, #3aa7c8) !important;
  font: inherit !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

#tri-companion-info-content a.tri-fav-link:hover,
#tri-companion-info-content a.tri-fav-link:focus,
#tri-trainer-info-content a.tri-fav-link:hover,
#tri-trainer-info-content a.tri-fav-link:focus,
.tri-companion-info-actions a.tri-fav-link:hover,
.tri-companion-info-actions a.tri-fav-link:focus,
.tri-trainer-info-actions a.tri-fav-link:hover,
.tri-trainer-info-actions a.tri-fav-link:focus,
.tri-vcoach-buttons a.tri-fav-link:hover,
.tri-vcoach-buttons a.tri-fav-link:focus,
a.tri-fav-link:hover,
a.tri-fav-link:focus {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--tri-blue, #3aa7c8) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

#tri-companion-info-content a.tri-fav-link img,
#tri-trainer-info-content a.tri-fav-link img,
.tri-companion-info-actions a.tri-fav-link img,
.tri-trainer-info-actions a.tri-fav-link img,
.tri-vcoach-buttons a.tri-fav-link img,
a.tri-fav-link img {
  width: 18px !important;
  height: 18px !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  flex: 0 0 18px !important;
}

/* Miniheadlines Companion/Trainer + Coach-Info-Popup */
#tri-companion-info-content .tri-companion-info-label,
#tri-companion-info-content .tri-companion-info-section > p:first-child,
#tri-trainer-info-content .tri-trainer-info-label,
#tri-trainer-info-content .tri-trainer-info-section > p:first-child,
#tri-trainer-info-content .tri-split h3,
#tri-trainer-info-content h3,
#tri-vcoach-popup-content .tri-vcoach-popup-section h3,
#tri-vcoach-popup-content .tri-popup-columns h3 {
  color: var(--tri-blue, #3aa7c8) !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] #tri-companion-info-content .tri-companion-info-label,
html[data-theme="dark"] #tri-companion-info-content .tri-companion-info-section > p:first-child,
html[data-theme="dark"] #tri-trainer-info-content .tri-trainer-info-label,
html[data-theme="dark"] #tri-trainer-info-content .tri-trainer-info-section > p:first-child,
html[data-theme="dark"] #tri-trainer-info-content .tri-split h3,
html[data-theme="dark"] #tri-trainer-info-content h3,
html[data-theme="dark"] #tri-vcoach-popup-content .tri-vcoach-popup-section h3,
html[data-theme="dark"] #tri-vcoach-popup-content .tri-popup-columns h3 {
  color: var(--tri-blue, #3aa7c8) !important;
}
/* === RESTART_33 INFO POPUP CSS FINAL v146 END === */
