.tk-chat {
  --tk-bg: #0d1538;
  --tk-surface: #141b3d;
  --tk-line: #606c98;
  --tk-text: #e8eaf0;
  --tk-muted: #b8bfd6;
  --tk-gold: #c9a84c;
  background: var(--tk-bg);
  color: var(--tk-text);
  font:
    1rem/1.5 system-ui,
    sans-serif;
  padding: 1rem;
  border: 1px solid var(--tk-line);
  border-radius: 1rem;
  min-width: 0;
}
.tk-chat *,
.tk-chat *::before,
.tk-chat *::after {
  box-sizing: border-box;
}
.tk-chat p {
  margin: 0.5rem 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tk-chat label {
  display: block;
  margin: 0.5rem 0;
}
.tk-chat button,
.tk-chat select,
.tk-chat textarea,
.tk-chat input[type="file"] {
  font: inherit;
  color: var(--tk-text);
  background: var(--tk-surface);
  border: 1px solid var(--tk-line);
  border-radius: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  max-width: 100%;
}
.tk-chat button {
  cursor: pointer;
}
.tk-chat button:disabled {
  opacity: 0.65;
  cursor: default;
}
.tk-chat button[aria-pressed="true"],
.tk-chat button[aria-checked="true"] {
  border: 2px solid var(--tk-gold);
}
.tk-chat :focus-visible {
  outline: 3px solid var(--tk-gold);
  outline-offset: 3px;
}
.tk-chat select,
.tk-chat textarea {
  display: block;
  width: 100%;
}
.tk-chat textarea {
  resize: vertical;
}
.tk-chat textarea::placeholder {
  color: var(--tk-muted);
  opacity: 1;
}
.tk-chat input[type="checkbox"] {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.tk-chat .tk-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.5rem 0;
}
.tk-chat .tk-row > button,
.tk-chat .tk-grow {
  flex: 1;
  min-width: 100px;
}
.tk-chat [hidden] {
  display: none !important;
}
.tk-chat .tk-primary {
  background: var(--tk-gold);
  color: #0d1538;
  font-weight: 700;
}
.tk-chat .tk-status,
.tk-chat .tk-caption,
.tk-chat .tk-footnote {
  color: var(--tk-muted);
  font-size: 0.875rem;
}
.tk-chat .tk-notice {
  border-left: 3px solid var(--tk-gold);
  padding: 0.5rem 0.75rem;
}
.tk-chat details {
  border-top: 1px solid var(--tk-line);
  padding: 0.5rem 0;
}
.tk-chat summary {
  cursor: pointer;
  padding: 0.5rem 0;
  min-height: 44px;
}
.tk-chat .tk-messages {
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.5rem 0.2rem;
}
.tk-chat .tk-bubble {
  background: var(--tk-surface);
  border: 1px solid var(--tk-line);
  padding: 0.75rem;
  border-radius: 0.75rem;
}
.tk-chat .tk-user {
  margin-left: 1.5rem;
}
.tk-chat .tk-action {
  border-bottom: 1px solid var(--tk-line);
  padding: 0.75rem 0;
}
.tk-chat .tk-action button {
  margin: 0.25rem;
}
.tk-chat dialog {
  color: var(--tk-text);
  background: var(--tk-bg);
  border: 2px solid var(--tk-gold);
  border-radius: 1rem;
  width: min(560px, calc(100vw - 32px));
  max-height: 85dvh;
  overflow-y: auto;
  padding: 1.25rem;
}
.tk-chat dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}
.tk-chat[data-shades="on"] {
  --tk-gold: #c8cedf;
  --tk-surface: #111831;
}
@media (prefers-reduced-motion: reduce) {
  .tk-chat *,
  #takota-widget-panel,
  #takota-widget-btn {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 380px) {
  .tk-chat {
    padding: 0.75rem;
  }
  .tk-chat .tk-row > button {
    flex-basis: 40%;
  }
}
