

:root {
  --sidebar-expanded: 15%;
  --sidebar-collapsed: 3%;
  --bg-shell: #f7f7f8;
  --bg-sidebar: #003468;
  --bg-main: #ffffff;
  --bg-composer: #ffffff;
  --border-light: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #6799c8;
}

* {
  box-sizing: border-box;
  font-family: "Arial", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Arial", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-shell);
  color: var(--text-primary);
}

.app-shell {
  width: 100%;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-expanded);
  min-width: 220px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid #0d4f8f;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
  min-width: 72px;
}

.sidebar-top {
  height: 64px;
  padding: 25px 20px;
  gap: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;

}

.sidebar-top span {
  white-space: nowrap;
}

.sidebar-logo {
  /* make logo take all remaining horizontal space in the sidebar
     except for the toggle button (34px). padding inside .sidebar-top
     is handled by the parent, so we simply subtract the toggle width here */
  width: calc(100% - 40px);
  height: 70px;
  max-width: calc(100% - 40px);
  flex-shrink: 0;
  object-fit: contain;
  padding-top: 5px;
}


.sidebar-toggle {
  border: none;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-menu {
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.signed-in-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #9ca3af;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-fallback {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
}

.user-display-name {
  color: #003468;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.menu-section-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-section-block h2 {
  margin: 0;
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9fc0e0;
  letter-spacing: 0.02em;
}

.menu-divider {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.35);
  margin: 1px 0;
}

.sidebar-action {
  width: 100%;
  border: none;
  background: transparent;
  color: #ffffff;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  cursor: pointer;
}

.sidebar-action:hover {
  background: rgba(103, 153, 200, 0.2);
}

.sidebar-action span {
  white-space: nowrap;
}

.chat-history-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 2px;
}

body.sso-overlay-active .chat-history-wrap,
body.sso-overlay-active .chat-history-list,
body.sso-overlay-active .chat-history-item {
  display: none !important;
}

body.sso-overlay-active .prechat-greeting {
  display: none !important;
}

.chat-history-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.chat-history-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chat-history-item.active {
  border-color: rgba(255, 255, 255, 0.45);
  background: #6799C8;
  color: #212121
}

.chat-history-title {
  font-size: 0.8rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-history-delete {
  border: none;
  background: transparent;
  /* match the text color of the containing item */
  color: inherit;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  /* hide by default until the parent is hovered or active */
  opacity: 0;
  transition: opacity 0.2s;
}

/* show the button when item is hovered or selected */
.chat-history-item:hover .chat-history-delete,
.chat-history-item.active .chat-history-delete {
  opacity: 1;
}

.chat-history-delete:hover {
  background: rgba(255, 255, 255, 0.22);
  /* keep hover color same as text so x remains visible against the button background */
  color: inherit;
}

.chat-history-empty {
  color: #d7e8fa;
  font-size: 0.76rem;
  opacity: 0.9;
  padding: 4px 2px;
}

.app-shell.sidebar-collapsed .sidebar-logo,
.app-shell.sidebar-collapsed .sidebar-top span,
.app-shell.sidebar-collapsed .menu-section-block h2,
.app-shell.sidebar-collapsed .sidebar-action span,
.app-shell.sidebar-collapsed .menu-divider,
.app-shell.sidebar-collapsed .chat-history-wrap {
  display: none;
}


.app-shell.sidebar-collapsed .sidebar-action {
  justify-content: center;
  padding: 10px 0;
}

.app-shell.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.chat-main {
  flex: 1;
  min-width: 0;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
}

.chat-main-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* group logo and title on left */
.header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 10px;
}

.header-auth-btn {
  border: 1px solid #003468;
  background: #ffffff;
  color: #003468;
  border-radius: 18px;
  padding: 6px 12px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.header-auth-btn:hover {
  background: #003468;
  color: #ffffff;
}

.chat-main-header h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: bold;
  color: #003468;
}

/* header help button */
.chat-main-header #help-button {
  border: none;
  background: transparent;
  color: #003468;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  gap: 8px
}
.chat-main-header #help-button svg {
  width: 25px;
  height: 25px;
}

.chat-main-header img {
  width: 32px;
  height: 32px;
  margin-right: 12px;
}

.chat-main-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.chat-main-body .webchat-wrapper {
  width: min(980px, 100%);
  height: 100%;
  position: relative;
}

#webchat {
  width: 100%;
  height: 100%;
  /* prevent native scrollbar from appearing */
  overflow: hidden;
}

#webchat ::-webkit-scrollbar {
  display: none;
}
#webchat {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Top-anchor transcript: messages start at the top, not the bottom. */

/* 1. Collapse the aria-hidden "filler" div that Web Chat inserts to push
      messages toward the bottom of the scroll viewport. */
#webchat .webchat__basic-transcript__filler {
  flex: 0 !important;
  height: 0 !important;
}

/* 2. Remove the auto-margin fallback on the stacked message list. */
#webchat .webchat__stacked-layout__content {
  margin-top: 0 !important;
}

/* 3. Ensure the stacked layout itself aligns from the start. */
#webchat .webchat__stacked-layout {
  min-height: 0 !important;
  justify-content: flex-start !important;
}

.prechat-greeting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  pointer-events: auto;
  color: #003468;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-line;
}

.prechat-greeting-text {
  margin: 0;
  max-width: 760px;
}

.prechat-suggested-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  width: min(100%, 980px);
  justify-items: stretch;
}

@media (max-width: 1140px) {
  .prechat-suggested-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .prechat-suggested-grid {
    grid-template-columns: 1fr;
  }
}

.prechat-suggested-hidden {
  display: none;
}

.prechat-suggested-grid .suggested-btn {
  padding: 16px;
  text-align: left;
  white-space: normal;
  line-height: 1.5;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.prechat-suggested-grid .suggested-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

.prechat-suggested-grid .suggested-btn .suggested-btn-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.prechat-suggested-grid .suggested-btn .suggested-btn-content {
  font-size: 0.9rem;
  color: #475569;
  word-wrap: break-word;
  flex: 1;
}

.prechat-greeting-hidden {
  display: none;
}

@keyframes ascent-sso-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.ascent-sso-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(14, 20, 33, 0.45);
  backdrop-filter: blur(1.5px);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.ascent-sso-loading-overlay.is-visible {
  display: flex;
}

.ascent-sso-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  min-width: 220px;
}

.ascent-sso-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #d3d9e3;
  border-top-color: #2a6bf4;
  animation: ascent-sso-spin 0.85s linear infinite;
}

.ascent-sso-loading-text {
  font-size: 14px;
  font-weight: 600;
  color: #1f2a3d;
}

.signed-out-empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #003468;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  gap: 16px;
}

.signed-out-login-action {
  display: flex;
  justify-content: center;
}

.signed-out-login-action .header-auth-btn {
  padding: 10px 18px;
  font-size: 0.95rem;
}

/* move webchat into wrapper via JS or manual markup */

.composer-area {
  padding: 12px 20px 16px;
  background: var(--bg-main);
}

.composer-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  min-height: 50px;
  border-radius: 100px;
  background: var(--bg-composer);
  border: 1px solid #e6e6e8;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px 8px 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.footer {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  min-height: 50px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px 8px 10px;
  text-align: center; /* ensure any text children are centered */
}

.footer-note {
  font-size: 0.75rem;
  font-weight: 300;
  color: #003468;
  margin: 0;
  line-height: 2.5;
}

.chat-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  min-height: 50px;
  max-height: 150px;
  line-height: 1.4;
  padding: 12px 8px;
  font-size: 0.96rem;
  color: #111827;
  overflow-y: auto;
}

.chat-input::placeholder {
  color: #9ca3af;
}

.composer-icon {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.attach-icon {
  background: transparent;
  color: #003468;
  align-self: center;
}

.attach-icon:hover {
  background: #e2ebf5;
}

.attach-icon.has-attachment {
  background: #e2ebf5;
  color: #003468;
}

/* Attachment preview chip (shown above composer when a file is staged) */
.attachment-preview {
  width: min(980px, 100%);
  margin: 0 auto 6px;
  padding: 0 12px;
  display: flex;
  align-items: center;
}

.attachment-preview[hidden] {
  display: none;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e2ebf5;
  border: 1px solid #b6ccdf;
  border-radius: 12px;
  padding: 5px 10px 5px 8px;
  font-size: 0.85rem;
  color: #003468;
  max-width: 100%;
}

.attachment-chip-name {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #003468;
  padding: 0 0 0 4px;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  flex-shrink: 0;
}

.attachment-chip-remove:hover {
  opacity: 1;
  background: #b6ccdf;
}

.send-icon {
  background: #003468;
  color: #ffffff;
  align-self: center;
  /* start hidden; JS will display when input is nonempty */
  display: none;
}

.send-icon:hover {
  background: #6799C8;
}

.suggest-wrap {
  position: relative;
  align-self: center;
}

.suggest-icon {
  background: #e2ebf5;
  color: #003468;
}

.suggest-icon:hover {
  background: #6799c8;
  color: #ffffff;
}

.suggested-prompts {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 240px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: none;
  z-index: 20;
}

.suggested-prompts.visible {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggested-btn {
  border: none;
  background: #f3f4f6;
  color: #1f2937;
  text-align: left;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.86rem;
  cursor: pointer;
}

.suggested-btn:hover {
  background: #e2ebf5;
}

.webchat-overlay {
  background: rgba(255, 255, 255, 0.88);
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

#webchat .webchat__bubble {
  border-radius: 14px !important;
  max-width: 100% !important;
  position: relative;
}


#webchat .webchat__stacked-layout__message .webchat__bubble {
  max-width: 100% !important;
}

#webchat .webchat__stacked-layout__message--from-bot .webchat__bubble,
#webchat .webchat__stacked-layout__message--from-bot .webchat__bubble {
  width: 100% !important;
  max-width: 100% !important;
}

#webchat .webchat__stacked-layout__message--from-user .webchat__bubble,
#webchat .webchat__stacked-layout__message--from-user .webchat__bubble {
  width: min(50%, 760px) !important;
  max-width: min(50%, 760px) !important;
  min-width: 220px;
}

#webchat .webchat__stacked-layout__message--from-user {
  justify-content: flex-end !important;
}

#webchat .webchat__stacked-layout__message--from-bot {
  justify-content: flex-start !important;
}





#webchat .webchat__bubble__content,
#webchat .webchat__basic-transcript__content {
  font-family: "Arial", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  text-rendering: optimizeLegibility;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

#webchat .webchat__bubble__content h1,
#webchat .webchat__bubble__content h2,
#webchat .webchat__bubble__content h3,
#webchat .webchat__basic-transcript__content h1,
#webchat .webchat__basic-transcript__content h2,
#webchat .webchat__basic-transcript__content h3 {
  color: #003468 !important;
  line-height: 1.3 !important;
  margin: 8px 0 10px !important;
}

#webchat .webchat__bubble__content h1,
#webchat .webchat__basic-transcript__content h1 {
  font-size: 22px !important;
}

#webchat .webchat__bubble__content h2,
#webchat .webchat__basic-transcript__content h2 {
  font-size: 19px !important;
}

#webchat .webchat__bubble__content h3,
#webchat .webchat__basic-transcript__content h3 {
  font-size: 17px !important;
}

#webchat .webchat__bubble__content h4,
#webchat .webchat__bubble__content h5,
#webchat .webchat__bubble__content h6,
#webchat .webchat__basic-transcript__content h4,
#webchat .webchat__basic-transcript__content h5,
#webchat .webchat__basic-transcript__content h6 {
  color: #6799c8 !important;
  line-height: 1.35 !important;
  margin: 7px 0 9px !important;
}

#webchat .webchat__bubble__content h4,
#webchat .webchat__basic-transcript__content h4 {
  font-size: 15px !important;
}

#webchat .webchat__bubble__content h5,
#webchat .webchat__basic-transcript__content h5 {
  font-size: 14px !important;
}

#webchat .webchat__bubble__content h6,
#webchat .webchat__basic-transcript__content h6 {
  font-size: 13px !important;
}

#webchat .webchat__bubble__content p,
#webchat .webchat__basic-transcript__content p {
  margin: 0 0 12px !important;
}

#webchat .webchat__bubble__content p:last-child,
#webchat .webchat__basic-transcript__content p:last-child {
  margin-bottom: 0 !important;
}

#webchat .webchat__bubble__content ul,
#webchat .webchat__bubble__content ol,
#webchat .webchat__basic-transcript__content ul,
#webchat .webchat__basic-transcript__content ol {
  margin: 10px 0 12px !important;
  padding-left: 22px !important;
}

#webchat .webchat__bubble__content li,
#webchat .webchat__basic-transcript__content li {
  margin: 6px 0 !important;
}

#webchat .webchat__bubble__content a,
#webchat .webchat__basic-transcript__content a {
  color: #003468 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

#webchat .webchat__bubble__content table,
#webchat .webchat__basic-transcript__content table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 12px 0 !important;
  border: 1px solid #c7d8ea !important;
  background: #ffffff !important;
}

#webchat .webchat__bubble__content th,
#webchat .webchat__bubble__content td,
#webchat .webchat__basic-transcript__content th,
#webchat .webchat__basic-transcript__content td {
  border: 1px solid #c7d8ea !important;
  padding: 8px 10px !important;
  text-align: left !important;
  vertical-align: top !important;
}

#webchat .webchat__bubble__content th,
#webchat .webchat__basic-transcript__content th {
  background: #edf4fb !important;
  color: #003468 !important;
  font-weight: 600 !important;
}

#webchat .webchat__bubble__content tr:nth-child(even) td,
#webchat .webchat__basic-transcript__content tr:nth-child(even) td {
  background: #f9fbfe !important;
}

#webchat .webchat__bubble__content pre,
#webchat .webchat__basic-transcript__content pre {
  border-radius: 8px !important;
  background: #ebefff !important;
  border: 1px solid #d6e4f3 !important;
  padding: 12px 14px !important;
  overflow-x: auto !important;
}

#webchat .webchat__bubble__content code,
#webchat .webchat__basic-transcript__content code {
  background: #ebefff !important;
  border-radius: 6px !important;
  padding: 1px 6px !important;
}

.webchat__send-box,
.webchat__send-box-text-box,
.webchat__send-button {
  display: none !important;
}

/* ============================================================
   ADAPTIVE CARD ISOLATION
   The prose rules above use !important on element selectors
   (table, th, td, h1-h6, p, ul, a, code …) which beats inline
   styles set by the Adaptive Cards JS renderer.  The rules
   below use a higher-specificity ancestor (.ac-adaptiveCard)
   to restore neutral values for each affected element type.
   IMPORTANT: do NOT add "color: initial !important" here –
   that would override the renderer's own inline style="color:…"
   attributes, making light-on-dark text invisible.
   ============================================================ */

#webchat .webchat__bubble__content .ac-adaptiveCard table,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-table {
  width: auto !important;
  border-collapse: separate !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard th,
#webchat .webchat__bubble__content .ac-adaptiveCard td,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-tableCell {
  border: none !important;
  padding: 6px 8px !important;
  background: transparent !important;
  font-weight: inherit !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard tr:nth-child(even) td {
  background: transparent !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard h1,
#webchat .webchat__bubble__content .ac-adaptiveCard h2,
#webchat .webchat__bubble__content .ac-adaptiveCard h3,
#webchat .webchat__bubble__content .ac-adaptiveCard h4,
#webchat .webchat__bubble__content .ac-adaptiveCard h5,
#webchat .webchat__bubble__content .ac-adaptiveCard h6 {
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard p {
  margin: 0 !important;
  padding: 0 !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard ul,
#webchat .webchat__bubble__content .ac-adaptiveCard ol {
  padding-left: revert !important;
  margin: 0 !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard li {
  padding: 10px !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard a {
  text-decoration: underline !important;
}

#webchat .webchat__bubble__content .ac-adaptiveCard pre,
#webchat .webchat__bubble__content .ac-adaptiveCard code {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* Images inside Adaptive Cards — let the AC renderer control sizing;
   only prevent overflow, do not override explicit width/height/display
   that the renderer sets via inline styles on icon images. */
#webchat .webchat__bubble__content .ac-adaptiveCard img {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* The .ac-image container wraps Image elements — allow inline-block so
   icons in ColumnSet columns stay side-by-side. */
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-image {
  display: inline-block !important;
  line-height: 0 !important;  /* collapse whitespace under img */
}

/* Icon images rendered by the AC renderer inside action buttons.
   The renderer wraps them in .ac-actionIcon (older) or places them
   directly under .ac-pushButton (newer).  Force correct sizing and
   visibility regardless of which structure the renderer uses. */
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton img,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-actionIcon,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton-icon {
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
}

/* CSS-filter fallback: if the SVG icon is loaded from CDN (uncolored)
   rather than as a colorized data URI, tint it to match the button text.
   - Positive / destructive buttons: white text → white icon
   - Default / outline buttons: brand blue text → brand blue icon
   These filters only affect <img> elements inside buttons, so they
   won't interfere with the colorized data URIs baked in by the middleware. */
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-positive img,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-positive .ac-actionIcon,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-destructive img,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-destructive .ac-actionIcon {
  filter: brightness(0) invert(1) !important;
}
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-default img,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-default .ac-actionIcon,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton:not([class*="style-"]) img,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton:not([class*="style-"]) .ac-actionIcon {
  /* Approximate tint to brand navy #003468 starting from black */
  filter: brightness(0) invert(1) sepia(1) saturate(400%) hue-rotate(188deg) brightness(0.42) !important;
}

/* SVG icons (Icon element, inline icons on buttons) — must be visible. */
#webchat .webchat__bubble__content .ac-adaptiveCard svg {
  display: inline-block !important;
  overflow: visible !important;
  vertical-align: middle !important;
}

/* Adaptive Card action buttons — reset ASCENT global button chrome.
   The adaptivecards renderer adds .ac-pushButton on every action button,
   plus a style variant class: .style-positive, .style-destructive,
   or .style-default (absent = default).
   We ALSO cover the inline-style path (older renderer versions set style
   via the host-config colours rather than class names). */

/* Base reset — remove browser's default gray button background. */
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton {
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 6px 16px !important;
  border-radius: 10px !important;
  border: 1px solid #003468 !important;
  background-color: transparent !important;
  color: #003468 !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* Positive (primary / filled) style — brand blue */
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-positive {
  background-color: #003468 !important;
  color: #ffffff !important;
  border-color: #003468 !important;
}
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-positive:hover {
  background-color: #6799C8 !important;
  border-color: #6799C8 !important;
}

/* Destructive style — red */
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-destructive {
  background-color: #A4262C !important;
  color: #ffffff !important;
  border-color: #A4262C !important;
}
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-destructive:hover {
  background-color: #822027 !important;
  border-color: #822027 !important;
}

/* Default / outline style */
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-default,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton:not([class*="style-"]) {
  background-color: transparent !important;
  color: #003468 !important;
  border-color: #003468 !important;
}
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton.style-default:hover,
#webchat .webchat__bubble__content .ac-adaptiveCard .ac-pushButton:not([class*="style-"]):hover {
  background-color: #EEF4FB !important;
}


@media (max-width: 1024px) {
  .sidebar {
    width: 28%;
    min-width: 190px;
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: 64px;
    min-width: 64px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 78px;
    min-width: 78px;
  }

  .sidebar-menu {
    padding: 12px 8px;
  }

  .header-auth {
    margin-right: 6px;
    gap: 6px;
  }

  .user-display-name {
    display: none;
    max-width: 0;
  }

  .header-auth-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .menu-section-block h2,
  .sidebar-action span,
  .menu-divider {
    display: none;
  }

  .sidebar-action {
    justify-content: center;
    padding: 10px 0;
  }

  .chat-main-header,
  .composer-area {
    padding-left: 12px;
    padding-right: 12px;
  }

  #webchat .webchat__row--from-user .webchat__bubble,
  #webchat .webchat__stacked-layout__message--from-user .webchat__bubble {
    width: min(50%) !important;
    max-width: min(50%) !important;
  }
}

/* ---------------------------------------------------------------
   Copy-button injected by activityMiddleware beneath bot messages
   --------------------------------------------------------------- */

/* Transparent wrapper — must not affect layout */
.ascent-copy-wrapper {
  display: contents;
}

.ascent-copy-button-row {
  display: flex;
  justify-content: flex-start;
  padding: 5px 5px 2px 2px;
  margin-left: 25px; /* align with bot bubble content inset */
}

/* During export load, hide all export buttons except the one in loading state */
.ascent-copy-button-row.ascent-export-loading .ascent-export-word-btn:not([data-loading]),
.ascent-copy-button-row.ascent-export-loading .ascent-export-pdf-btn:not([data-loading]),
.ascent-copy-button-row.ascent-export-loading .ascent-export-onenote-btn:not([data-loading]) {
  display: none;
}

.ascent-copy-button-row.ascent-export-loading .ascent-export-word-btn[data-loading],
.ascent-copy-button-row.ascent-export-loading .ascent-export-pdf-btn[data-loading],
.ascent-copy-button-row.ascent-export-loading .ascent-export-onenote-btn[data-loading] {
  display: inline-flex;
}

/* Icon-only square button */
.ascent-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #9ab5cc;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease;
  user-select: none;
}

/* Hover effect */
.ascent-copy-btn:hover {
  background: #eaf1f8;
  border-color: #c8d8e8;
  color: #003468;
}

/* Click / pressed effect */
.ascent-copy-btn:active {
  transform: scale(0.84);
  background: #d6e8f5;
  border-color: #6799c8;
  color: #003468;
}

.ascent-copy-btn:focus-visible {
  outline: 2px solid #6799c8;
  outline-offset: 2px;
}

/* Copied confirmation state */
.ascent-copy-btn--copied {
  color: #2e7d32;
  background: #eaf5ea;
  border-color: #6abf69;
}

.ascent-copy-btn--copied:hover {
  background: #d8edd8;
  border-color: #4caf50;
  color: #1b5e20;
}

/* Icon swap: show copy icon by default, check icon when copied */
.ascent-copy-icon--check {
  display: none;
}

.ascent-copy-btn--copied .ascent-copy-icon--copy {
  display: none;
}

.ascent-copy-btn--copied .ascent-copy-icon--check {
  display: block;
}

/* ── Unified action bar (copy button) ─────────────────────────────── */

.ascent-action-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 0 4px 2px;
}

/* Base style shared by copy and reaction buttons in the action bar */
.ascent-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #4c4c4c;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease;
  user-select: none;
}

/* ── Export to Word/PDF/OneNote button ─────────────────────────────────────────── */

.ascent-more-options-btn:hover {
  background: #eaf1f8;
  border-color: #c8d8e8;
  color: #003468;
}

.ascent-more-options-btn:active {
  transform: scale(0.84);
  background: #d6e8f5;
  border-color: #6799c8;
  color: #003468;
}

.ascent-more-options-btn:focus-visible {
  outline: 2px solid #6799c8;
  outline-offset: 2px;
}

/* ── More options dropdown menu ─────────────────────────────────────────────── */

.ascent-more-options-wrapper {
  position: relative;
}

.ascent-more-options-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  padding: 4px;
  min-width: 170px;
  z-index: 500;
}

.ascent-more-options-menu.is-open {
  display: flex;
}

.ascent-more-options-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #1f2a3d;
  text-align: left;
  white-space: nowrap;
}

.ascent-more-options-menu-item:hover {
  background: #f0f4f8;
}

.ascent-more-options-menu-item:active {
  background: #e2ecf5;
}

.ascent-export-word-btn:hover,
.ascent-export-pdf-btn:hover,
.ascent-export-onenote-btn:hover {
  background: #eaf1f8;
  border-color: #c8d8e8;
  color: #003468;
}

.ascent-export-word-btn:active,
.ascent-export-pdf-btn:active,
.ascent-export-onenote-btn:active {
  transform: scale(0.84);
  background: #d6e8f5;
  border-color: #6799c8;
  color: #003468;
}

.ascent-export-word-btn:focus-visible,
.ascent-export-pdf-btn:focus-visible,
.ascent-export-onenote-btn:focus-visible {
  outline: 2px solid #6799c8;
  outline-offset: 2px;
}

/* Loading state */
.ascent-export-word-btn[data-loading],
.ascent-export-pdf-btn[data-loading],
.ascent-export-onenote-btn[data-loading] {
  cursor: wait;
  opacity: 0.7;
  pointer-events: none;
}


/* Hide/show icons based on loading state */
.ascent-export-word-spinner,
.ascent-export-pdf-spinner,
.ascent-export-onenote-spinner {
  display: none;
}

.ascent-export-word-btn[data-loading] .ascent-export-word-icon,
.ascent-export-pdf-btn[data-loading] .ascent-export-pdf-icon,
.ascent-export-onenote-btn[data-loading] .ascent-export-onenote-icon {
  display: none;
}


.ascent-export-word-btn[data-loading] .ascent-export-word-spinner,
.ascent-export-pdf-btn[data-loading] .ascent-export-pdf-spinner,
.ascent-export-onenote-btn[data-loading] .ascent-export-onenote-spinner {
  display: block;
  animation: ascent-spin 0.8s linear infinite;
}


@keyframes ascent-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Refresh / Regenerate button ──────────────────────────────────────────── */

.ascent-refresh-btn:hover {
  background: #eaf1f8;
  border-color: #c8d8e8;
  color: #003468;
}

.ascent-refresh-btn:active {
  transform: scale(0.84);
  background: #d6e8f5;
  border-color: #6799c8;
  color: #003468;
}

.ascent-refresh-btn:focus-visible {
  outline: 2px solid #6799c8;
  outline-offset: 2px;
}

.ascent-refresh-btn:disabled {
  cursor: default;
  pointer-events: none;
}

.ascent-refresh-btn--loading .ascent-refresh-icon {
  animation: ascent-spin 0.7s linear infinite;
}

/* ── Export progress popup ─────────────────────────────────────────────────── */

.ascent-export-popup {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(14, 20, 33, 0.45);
  backdrop-filter: blur(1.5px);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.ascent-export-popup.is-visible {
  display: flex;
}

.ascent-export-popup-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  width: min(40vw, 460px);
  max-width: 520px;
}

.ascent-export-popup-spinner {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #d3d9e3;
  border-top-color: #2a6bf4;
  animation: ascent-spin 0.85s linear infinite;
}

.ascent-export-popup-text {
  font-size: 14px;
  font-weight: 600;
  color: #1f2a3d;
  white-space: nowrap;
}

/* ── Video player modal ─────────────────────────────────────────────────────── */

.ascent-video-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}

.ascent-video-modal.is-visible {
  display: flex;
}

.ascent-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 20, 33, 0.72);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.ascent-video-modal__panel {
  position: relative;
  z-index: 1;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  width: min(90vw, 960px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ascent-video-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ascent-video-modal__close:hover {
  background: rgba(0, 0, 0, 0.82);
}

.ascent-video-modal__player {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.ascent-video-modal__player iframe,
.ascent-video-modal__player video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  border-radius: 0 0 10px 10px;
}


