/* ---- Team (Layout nach NEXORA Voice Mode): Bot-Leiste unten, Profil darueber, Chat rechts ---- */
.main:has(.tmx){padding:0}
.main:has(.tmx) .topbar{display:none}
.tmx{display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:0}
.tmx-load{margin:auto}
.tmx-stage{flex:1;min-height:0;display:flex;align-items:stretch;padding:26px clamp(14px,3vw,40px) 14px}

/* Spalten Steckbrief / Balken (blenden bei offenem Chat aus) */
/* schmaler (Sascha 31.10.); Leuchten des Avatars liegt UEBER beiden Bloecken (Sascha-Wunsch) */
.tmx-col{flex:0 1 390px;min-width:0;margin:0 9px;overflow:auto;border-radius:14px;
  transition:flex-grow .55s ease,margin .55s ease,padding .55s ease,opacity .35s ease,border-width .55s}
.tmx-col h2{margin:0 0 6px}
.tmx-stage.open .tmx-col{flex:0 0 0;margin:0;padding-left:0;padding-right:0;border-width:0;opacity:0;pointer-events:none;overflow:hidden}
.tm-field{display:flex;flex-direction:column;gap:2px;padding:10px 0;border-bottom:1px solid var(--line)}
.tm-field:last-child{border-bottom:0}
.tm-field dt{font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.tm-field dd{margin:0;font-size:17px;overflow-wrap:anywhere}
.tmx-fields dl{margin:0}

/* Mitte: grosser Avatar mit Leuchtring (Platz fuer spaeteren 3D-Avatar) */
.tmx-mid{flex:0 0 calc(max(280px,min(clamp(280px,34vw,520px),100dvh - 340px)) + 120px);padding:0 60px;box-sizing:border-box;margin:0 auto;/* 60px Glow-Zone je Seite, Bloecke ueberdecken das Leuchten nicht */min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;
  transition:flex-basis .55s ease}
.tmx-stage.open .tmx-mid{flex-grow:0;margin:0;padding:0;flex-basis:clamp(240px,26vw,340px);justify-content:flex-start;padding-top:30px;box-sizing:border-box}
.tmx-av{position:relative;display:block;width:min(100%,calc(100dvh - 340px));max-width:100%;aspect-ratio:1;padding:0;border:0;background:none;border-radius:50%;
  cursor:pointer;color:inherit;-webkit-tap-highlight-color:transparent;transition:width .55s ease,transform .2s}
.tmx-stage.open .tmx-av{width:max(140px,min(100%,calc(100dvh - 560px)));cursor:default}
.tmx-av:disabled{cursor:default}
.tmx-av:not(:disabled):active{transform:scale(.98)}
.tmx-ring{position:absolute;inset:0;border-radius:50%;border:2px solid var(--a1);
  box-shadow:0 0 38px rgba(168,85,247,.5),0 0 90px rgba(236,72,153,.18),inset 0 0 34px rgba(168,85,247,.38);animation:tmxglow 4s ease-in-out infinite}
.tmx-ring::before{content:"";position:absolute;inset:-14px;border-radius:50%;border:1px solid rgba(168,85,247,.3)}
.tmx-ring::after{content:"";position:absolute;inset:-28px;border-radius:50%;border:1px solid rgba(168,85,247,.12)}
@keyframes tmxglow{50%{box-shadow:0 0 52px rgba(168,85,247,.72),0 0 110px rgba(236,72,153,.28),inset 0 0 44px rgba(168,85,247,.5)}}
.tmx-photo{position:absolute;inset:9%;border-radius:50%;overflow:hidden;background:var(--card2)}
.tmx-photo img{width:100%;height:100%;object-fit:cover;display:block}
.tmx-tap{font-size:13px;letter-spacing:.06em}

/* Chat-Info-Karte (Desktop: unter dem Avatar; iPhone: schmale Leiste unter dem Chat-Kopf) */
.tmx-info{width:100%;box-sizing:border-box;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px 14px;animation:tmxin .5s ease both}
@keyframes tmxin{from{opacity:0;transform:translateY(8px)}}
.tmx-info .tm-bar{padding:4px 0 6px}
.tmx-advice{margin:6px 0 10px;font-size:12px;color:var(--muted)}
.tmx-advice.warn{color:#fb923c;font-weight:600}
.tmx-cmp{display:flex;align-items:center;gap:10px;font-size:12px}
.tmx-cmp .btn[disabled]{opacity:.45;cursor:default}
.tmx-chat .tmx-info{display:none}

/* Chat rechts */
.tmx-chat{flex:0 0 0;min-width:0;margin:0;overflow:hidden;opacity:0;border-radius:16px;border:0 solid var(--line);background:var(--bg2);
  transition:flex-grow .55s ease,margin .55s ease,opacity .45s ease .1s}
.tmx-stage.open .tmx-chat{flex:1 1 0;margin-left:18px;opacity:1;border-width:1px}
.tmx-chat .chat{min-width:420px}
.tmx-chat .chathead{padding-top:10px}
.tmx-chat .chathead .avwrap{display:none}
.tm-closebtn{display:none}

/* Bot-Leiste unten */
.tmx-bar{flex:none;display:flex;gap:4px;overflow-x:auto;overflow-y:hidden;padding:12px 14px 10px;border-top:1px solid var(--line);background:var(--bg2);
  scrollbar-width:thin;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.tmx-b:first-child{margin-left:auto}.tmx-b:last-child{margin-right:auto}
.tmx-b{flex:none;width:78px;display:flex;flex-direction:column;align-items:center;gap:7px;padding:4px 0;background:none;border:0;color:var(--muted);font:inherit;
  cursor:pointer;-webkit-tap-highlight-color:transparent}
.tmx-bav{position:relative;display:block;width:60px;height:60px;border-radius:50%;opacity:.72;transform:scale(.92);transition:opacity .2s,transform .2s,box-shadow .25s}
.tmx-b:hover .tmx-bav{opacity:1}
.tmx-b.active .tmx-bav{opacity:1;transform:scale(1);box-shadow:0 0 0 2px var(--bg2),0 0 0 4px var(--a1),0 0 20px 4px rgba(168,85,247,.65)}
.tmx-bn{font-size:12px;max-width:76px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tmx-b.active .tmx-bn{color:var(--text);font-weight:600}
.tmx-nb{position:absolute;top:-4px;right:-4px;margin:0;z-index:2}

/* Balken */
.tm-bar{padding:10px 0 12px}
.tm-barhead{display:flex;justify-content:space-between;gap:10px;font-size:14px;margin-bottom:7px}
.tm-barhead b{font-variant-numeric:tabular-nums;font-weight:600}
.tm-track{height:10px;border-radius:10px;background:var(--card2);border:1px solid var(--line);overflow:hidden}
.tm-track i{display:block;height:100%;border-radius:10px;background:var(--accent);transition:width .5s}
.tm-track.mid i{background:linear-gradient(90deg,#f59e0b,#f97316)}
.tm-track.hi i{background:linear-gradient(90deg,#ef4444,#ec4899)}
.tm-track.none{border-style:dashed;background:transparent}
.tm-sub{font-size:12px;margin-top:5px}
.tm-bar.cp .tm-barhead{font-size:13px;margin-bottom:5px}
.tm-bar.cp .tm-track{height:8px}

/* Tastatur/Chat-Hoehe wie im Messenger (siehe STAND.md Abschnitt 9) */
.shell.inchat .tmx{height:100%}
html:not(.kbd) .shell.inchat .tmx{height:100dvh}

/* ---- iPhone hoch ---- */
@media (max-width:820px){
  .main:has(.tmx){padding:0 0 calc(50px + var(--safe-b))}
  .shell.inchat .main:has(.tmx){padding-bottom:0}
  .tmx{height:calc(var(--vvh,100dvh) - 50px - var(--safe-b))}
  .shell.inchat .tmx{height:100%}
  html:not(.kbd) .shell.inchat .tmx{height:100dvh}
  .tmx-stage{flex-direction:column;overflow-y:auto;padding:calc(18px + var(--safe-t)) 14px 12px;gap:12px;overscroll-behavior:contain}
  .tmx-mid{order:-1;flex:none;width:100%;margin:0;padding:10px 0 6px;justify-content:flex-start;padding:10px 0 6px}
  .tmx-av{width:min(66vw,34dvh)}
  .tmx-col{flex:none;margin:0;overflow:visible}
  .tmx-chat{display:none}
  .tmx-bar{padding:8px 10px 6px}
  .tmx-b{width:70px}.tmx-bav{width:56px;height:56px}.tmx-bav .avwrap{width:56px!important;height:56px!important}

  /* Chat offen: Steckbrief/Balken/Avatar/Bot-Leiste weg, Chat-Kopf mit Zurueck-Pfeil, Infos als schmale Leiste */
  .tmx.chat-open .tmx-bar{display:none}
  .tmx-stage.open{padding:0;gap:0;overflow:hidden}
  .tmx-stage.open .tmx-col,.tmx-stage.open .tmx-mid{display:none}
  .tmx-stage.open .tmx-chat{display:block;flex:1 1 0;margin:0;border-width:0;border-radius:0;background:none}
  .tmx-chat .chat{min-width:0}
  .tmx-chat .chathead{padding-top:calc(10px + var(--safe-t))}
  .tmx-chat .chathead .avwrap{display:inline-block}
  .tm-closebtn{display:inline-flex}.tm-closetxt{display:none}
  .tmx-chat .tmx-info{display:grid;grid-template-columns:1fr 1fr auto;grid-template-areas:"t c b" "a a a";gap:2px 12px;align-items:center;
    border-radius:0;border-width:0 0 1px;background:var(--bg2);padding:6px 14px 8px;animation:none}
  .tmx-chat .tmx-info>.tm-bar:nth-child(1){grid-area:t}.tmx-chat .tmx-info>.tm-bar:nth-child(2){grid-area:c}
  .tmx-chat .tmx-info .tmx-cmp{grid-area:b;flex-direction:column;align-items:flex-end;gap:2px;font-size:10px}
  .tmx-chat .tmx-info .tmx-cmp .btn{padding:6px 10px;font-size:12px}
  .tmx-chat .tmx-info .tm-barhead{flex-direction:column;gap:0;font-size:11px;margin-bottom:3px}
  .tmx-chat .tmx-info .tmx-advice{grid-area:a;margin:2px 0 0;font-size:11px}
  .tmx-chat .tmx-info .tmx-advice:not(.warn){display:none}
}
@media (min-width:821px){.tmx-chat .chat .backbtn{display:none}}
