/* Jednoredna komandna traka, chat oblačić i sklopive kategorije podešavanja. */
.persistent-command-bar-controls {
  grid-template-columns: auto minmax(140px, 1fr) auto auto auto !important;
  grid-template-rows: minmax(44px, auto) !important;
  max-width: 1180px;
  overflow: visible;
}

.persistent-command-bar-controls > .persistent-command-button {
  box-sizing: border-box;
  min-width: 0;
  white-space: nowrap;
}

.persistent-upload-button {
  width: 100%;
}

#persistentSettingsButton svg {
  height: 22px;
  stroke-width: 1.8;
  width: 22px;
}

.workspace-chat-bubble {
  align-items: stretch;
  animation: workspace-chat-bubble-in .22s ease-out both;
  background: var(--theme-surface, #fff);
  border: 1px solid color-mix(in srgb, #159ddd 45%, var(--theme-border, #c9d8e3));
  border-radius: 18px 18px 5px 18px;
  bottom: 18px;
  box-shadow: 0 18px 46px color-mix(in srgb, #061725 25%, transparent);
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) 34px;
  padding: 7px;
  position: fixed;
  right: 18px;
  width: min(390px, calc(100vw - 28px));
  z-index: 10025;
}

.workspace-chat-bubble[hidden] {
  display: none;
}

html[data-command-bar-position="bottom"] .workspace-chat-bubble {
  bottom: calc(var(--persistent-command-bar-height, 64px) + 16px);
}

.workspace-chat-bubble::after {
  border-left: 10px solid transparent;
  border-top: 10px solid color-mix(in srgb, #159ddd 45%, var(--theme-border, #c9d8e3));
  bottom: -10px;
  content: "";
  position: absolute;
  right: 15px;
}

.workspace-chat-bubble-open,
.workspace-chat-bubble-close {
  background: transparent;
  border: 0;
  color: var(--theme-text, #142230);
  cursor: pointer;
}

.workspace-chat-bubble-open {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 5px;
  text-align: left;
}

.workspace-chat-bubble-open > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.workspace-chat-bubble-open strong {
  color: #087fc4;
  font-size: .82rem;
}

.workspace-chat-bubble-open small {
  color: var(--theme-muted, #627487);
  display: -webkit-box;
  font-size: .76rem;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workspace-chat-bubble-avatar {
  align-items: center;
  background: linear-gradient(145deg, #159ddd, #087fc4);
  border-radius: 13px;
  color: #fff;
  display: inline-flex;
  font: 950 1rem/1 system-ui, sans-serif;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.workspace-chat-bubble-close {
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
  min-height: 34px;
}

.workspace-chat-bubble-open:focus-visible,
.workspace-chat-bubble-close:focus-visible {
  outline: 2px solid #159ddd;
  outline-offset: 1px;
}

@keyframes workspace-chat-bubble-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-category {
  display: block;
  overflow: hidden;
  padding: 0 !important;
}

.settings-category-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--theme-text, #142230);
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  padding: 13px 14px;
  text-align: left;
  width: 100%;
}

.settings-category-toggle:hover,
.settings-category-toggle:focus-visible {
  background: color-mix(in srgb, #159ddd 8%, transparent);
  outline: none;
}

.settings-category-icon {
  align-items: center;
  background: color-mix(in srgb, #159ddd 13%, var(--theme-field, #fff));
  border: 1px solid color-mix(in srgb, #159ddd 35%, var(--theme-border, #c9d8e3));
  border-radius: 11px;
  color: #087fc4;
  display: inline-flex;
  font: 950 .82rem/1 system-ui, sans-serif;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.settings-category-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-category-copy h3 {
  margin: 0;
}

.settings-category-copy small {
  color: var(--theme-muted, #627487);
  font-size: .75rem;
  font-weight: 650;
}

.settings-category-toggle > b {
  color: #087fc4;
  font-size: 1.2rem;
  transition: transform .18s ease;
}

.settings-category-toggle.is-open > b {
  transform: rotate(180deg);
}

.settings-category-content {
  padding: 0 14px 14px;
}

@media (max-width: 620px) {
  .persistent-command-bar-controls {
    gap: 5px !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px 44px !important;
  }

  .persistent-command-button {
    min-height: 44px;
    padding-inline: 8px !important;
  }

  .persistent-upload-button {
    font-size: clamp(.68rem, 3.2vw, .82rem);
    gap: 5px;
  }

  .persistent-upload-button svg {
    height: 19px;
    width: 19px;
  }

  .workspace-chat-bubble {
    bottom: 14px;
    left: 14px;
    right: 14px;
    width: auto;
  }

  html[data-command-bar-position="bottom"] .workspace-chat-bubble {
    bottom: calc(var(--persistent-command-bar-height, 58px) + 12px);
  }
}

@media (max-width: 350px) {
  .persistent-command-bar-controls {
    grid-template-columns: 40px minmax(0, 1fr) 40px 40px 40px !important;
  }

  .persistent-command-button {
    padding-inline: 6px !important;
  }

  .persistent-upload-button svg {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-chat-bubble {
    animation: none;
  }

  .settings-category-toggle > b {
    transition: none;
  }
}
