@import url("style-base.css");
@import url("brand.css");

/*
 * Tournament Manager core theme.
 *
 * Keep organizer/event branding out of this product stylesheet. A deployment
 * may override the shared CSS variables in brand.css without changing core
 * navigation, templates, or workflows.
 */

/* Shared compact action clusters used throughout staff tables. */
.roster-actions-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
  vertical-align: middle;
}

/* Public event branding belongs to uploaded tournament media and deployment
 * overrides. Core surfaces continue to use the shared product palette. */
.public-banner {
  background: var(--bg-elevated);
}

/* Tournament AI floating help chat */
.tm-ai-chat {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.tm-ai-chat-launcher {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent, #1f6feb);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.tm-ai-chat-launcher:focus-visible {
  outline: 2px solid var(--accent, #1f6feb);
  outline-offset: 3px;
}
.tm-ai-chat.is-open .tm-ai-chat-launcher {
  opacity: 0.85;
}
.tm-ai-chat-panel {
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated, #fff);
  color: var(--text, #111);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.tm-ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg, #f6f8fa);
}
.tm-ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}
.tm-ai-chat-bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 10px;
  white-space: pre-wrap;
  line-height: 1.35;
  font-size: 0.95rem;
}
.tm-ai-chat-user {
  align-self: flex-end;
  background: var(--accent, #1f6feb);
  color: #fff;
}
.tm-ai-chat-assistant {
  align-self: flex-start;
  background: var(--bg, #f0f2f5);
  color: var(--text, #111);
}
.tm-ai-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.tm-ai-chat-form textarea {
  resize: none;
  min-height: 44px;
  width: 100%;
}
.tm-ai-chat-form.is-busy {
  opacity: 0.7;
  pointer-events: none;
}
@media (max-width: 640px) {
  .tm-ai-chat-panel {
    width: min(100vw - 24px, 420px);
  }
}
