/* Same Barlow, olive and amber palette as the Kuzenler lobby. */
.chat-widget { --chat-lift: 0px; position: relative; z-index: 70; }
.chat-launcher {
  position: fixed; right: max(20px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom) + var(--chat-lift));
  display: flex; align-items: center; gap: 9px; min-height: 50px;
  padding: 0 18px; border: 1px solid #f4c571; border-radius: 4px;
  background: var(--sand); color: #1d2118; font-weight: 600;
  box-shadow: 0 5px 24px #0006;
}
.chat-launcher:hover { background: #f4c571; }
.chat-badge { min-width: 22px; padding: 3px 5px; border-radius: 3px; background: #202820; color: var(--text); font-size: 12px; }
.chat-panel {
  position: fixed; right: max(20px, env(safe-area-inset-right));
  bottom: calc(80px + env(safe-area-inset-bottom) + var(--chat-lift));
  width: min(388px, calc(100vw - 24px));
  height: min(540px, calc(var(--chat-vh, 100dvh) - 104px - env(safe-area-inset-bottom)));
  display: flex; flex-direction: column; min-height: 0;
  background: var(--paper); border: 1px solid #55604d; border-radius: 5px;
  box-shadow: 0 12px 50px #0008; overflow: hidden;
}
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); flex: none; }
.chat-header h2 { font-family: var(--display); font-size: 25px; line-height: 1.1; margin: 0 0 3px; }
.chat-header p { color: var(--muted); font-size: 12px; margin: 0; }
.chat-header .icon-button { flex: none; }
.chat-log { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; overflow-anchor: none; padding: 14px 16px; scrollbar-width: thin; }
.chat-history { width: 100%; margin-bottom: 12px; font-size: 13px; }
.chat-message { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; margin: 0 0 17px; }
.chat-message:last-child { margin-bottom: 0; }
.chat-message .steam-avatar { width: 28px; height: 28px; min-width: 28px; margin-top: 2px; }
.chat-message-meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chat-message-meta strong { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.chat-message-meta time { color: var(--muted); font-size: 11px; flex: none; margin-left: auto; }
.chat-message[data-own="true"] .chat-message-meta strong { color: var(--sand); }
.chat-message p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-empty { color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; margin: 35px 0; }
.chat-jump { flex: none; border: 0; border-top: 1px solid var(--line); background: #303c30; color: var(--sand); min-height: 36px; font-size: 13px; }
.chat-composer { flex: none; border-top: 1px solid var(--line); padding: 12px; background: #181f1b; }
.chat-composer form { display: flex; align-items: end; gap: 8px; }
.chat-composer textarea { flex: 1; width: 0; min-width: 0; height: 64px; max-height: 120px; resize: vertical; padding: 10px; background: #242e26; color: var(--text); border: 1px solid #4a564b; border-radius: 3px; font: 16px/1.35 Barlow, sans-serif; }
.chat-composer textarea::placeholder { color: #a4afa7; }
.chat-composer textarea:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.chat-send { padding: 10px; min-width: 46px; }
.chat-composer .chat-login { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.chat-login p { font-size: 12px; line-height: 1.4; color: var(--muted); margin: 0; }
.chat-login a { flex: none; font-size: 13px; padding: 10px; text-decoration: none; }
.chat-feedback { color: var(--muted); font-size: 12px; line-height: 1.35; margin: 0; padding: 0 12px; background: #181f1b; flex: none; }
.chat-feedback:not(:empty) { padding-bottom: 10px; }
.chat-feedback[data-error="true"] { color: #efb4a8; }
.chat-retry { flex: none; border: 0; border-top: 1px solid var(--line); color: var(--sand); background: #28312b; }
@media (max-width: 600px) {
  .chat-launcher { right: max(12px, env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom) + var(--chat-lift)); min-height: 46px; padding: 0 14px; }
  .chat-panel { right: max(12px, env(safe-area-inset-right)); bottom: calc(68px + env(safe-area-inset-bottom) + var(--chat-lift)); height: min(520px, calc(var(--chat-vh, 100dvh) - 84px - env(safe-area-inset-bottom))); }
  .chat-log { padding: 12px; }
}
@media (max-height: 450px) {
  .chat-panel { bottom: calc(8px + var(--chat-lift)); height: calc(var(--chat-vh, 100dvh) - 16px); }
  .chat-widget[data-open="true"] .chat-launcher { visibility: hidden; }
  .chat-header { padding-top: 5px; padding-bottom: 5px; }
  .chat-composer { padding: 8px; }
  .chat-composer textarea { height: 46px; }
}
@media (hover: none) and (pointer: coarse) {
  .chat-widget[data-keyboard="false"] .chat-launcher { visibility: visible; }
  @media (max-height: 450px) {
    .chat-panel { bottom: calc(68px + env(safe-area-inset-bottom) + var(--chat-lift)); height: calc(var(--chat-vh, 100dvh) - 84px - env(safe-area-inset-bottom)); }
  }
  .chat-widget[data-keyboard="true"] .chat-launcher { display: none; }
  .chat-widget[data-keyboard="true"] .chat-panel { bottom: var(--chat-lift); height: min(520px, calc(var(--chat-vh, 100dvh) - 12px)); }
  .chat-widget[data-keyboard="true"] .chat-header { padding-top: 5px; padding-bottom: 5px; }
  .chat-widget[data-keyboard="true"] .chat-composer { padding: 8px 12px; }
  .chat-widget[data-keyboard="true"] .chat-composer textarea { height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .chat-widget * { transition: none; scroll-behavior: auto; } }
