#angstrom-chatbot-widget,
#angstrom-chatbot-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  line-height: normal;
}

#angstrom-chatbot-widget .angstrom-chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: #5140a8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 999999;
}

#angstrom-chatbot-widget .angstrom-chatbot-toggle .icon-close {
  display: none;
}

#angstrom-chatbot-widget .angstrom-chatbot-toggle.is-open .icon-chat {
  display: none;
}

#angstrom-chatbot-widget .angstrom-chatbot-toggle.is-open .icon-close {
  display: block;
}

#angstrom-chatbot-widget .chatbot {
  position: fixed;
  bottom: 92px;
  right: 20px;
  width: 420px;
  height: 700px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 999999;
}

#angstrom-chatbot-widget .chat-header {
  background: #5140a8;
  color: #ffffff;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#angstrom-chatbot-widget .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#angstrom-chatbot-widget .header-icon-button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

#angstrom-chatbot-widget .header-icon-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

#angstrom-chatbot-widget .header-icon-button-close {
  padding: 6px;
}

#angstrom-chatbot-widget .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

#angstrom-chatbot-widget .logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #ffffff;
  color: #5140a8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

#angstrom-chatbot-widget .brand h1 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
}

#angstrom-chatbot-widget .brand p {
  font-size: 12px;
  margin-top: 3px;
  opacity: 0.8;
}

#angstrom-chatbot-widget .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

#angstrom-chatbot-widget .message {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

#angstrom-chatbot-widget .avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #5140a8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

#angstrom-chatbot-widget .message-content {
  max-width: 80%;
  min-width: 0;
}

/**
 * Added by wrapChatTables()/addMessage() in script.js when a bot message
 * contains a table -- a comparison table's columns are already sized as
 * generously as table-layout: fixed allows (see .chat-table-wrapper
 * table above), so capping its bubble at the normal 80% just makes
 * already-tight columns tighter for no benefit ordinary text bubbles
 * need. `flex: 1 1 auto` is required alongside max-width: a flex item's
 * default `flex: 0 1 auto` only ever shrinks from its content size, it
 * never grows to fill the row, so max-width alone would just raise the
 * ceiling without the bubble actually reaching it.
 */
#angstrom-chatbot-widget .message-content.has-table {
  max-width: 100%;
  flex: 1 1 auto;
}

#angstrom-chatbot-widget .message-bubble {
  background: #f0eff7;
  padding: 12px 15px;
  border-radius: 5px 15px 15px 15px;
  color: #333333;
  line-height: 1.5;
  font-size: 14px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

#angstrom-chatbot-widget .message-time {
  margin-top: 5px;
  font-size: 10px;
  color: #999999;
}

#angstrom-chatbot-widget .user-message {
  justify-content: flex-end;
}

#angstrom-chatbot-widget .user-message .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#angstrom-chatbot-widget .user-message .message-bubble {
  background: #5140a8;
  color: #ffffff;
  border-radius: 15px 5px 15px 15px;
  /**
   * User messages are inserted via textContent (see addMessage() in
   * script.js), so a literal newline the user typed is already present
   * in the DOM text node -- the shared .message-bubble rule's
   * white-space: normal is what collapses it visually. Scoped to user
   * messages only (not the shared .message-bubble rule used by bot
   * responses too): bot HTML is built from template-literal
   * concatenation with no incidental whitespace between tags, but the
   * model's own generated text could plausibly contain stray newlines
   * between HTML blocks, and pre-wrap would then introduce unwanted
   * extra blank lines there that don't exist today.
   */
  white-space: pre-wrap;
}

#angstrom-chatbot-widget .user-message .avatar {
  display: none;
}

#angstrom-chatbot-widget .suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  margin-bottom: 18px;
}

#angstrom-chatbot-widget .suggestions button {
  border: 1px solid #ddd8f5;
  background: #ffffff;
  color: #5140a8;
  padding: 9px 11px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
}

#angstrom-chatbot-widget .suggestions button:hover {
  background: #f0eff7;
}

#angstrom-chatbot-widget .suggestions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #ffffff;
}

#angstrom-chatbot-widget .chat-input-area {
  padding: 15px;
  border-top: 1px solid #eeeeee;
  display: flex;
  gap: 10px;
}

#angstrom-chatbot-widget .chat-input-area textarea {
  flex: 1;
  border: 1px solid #dddddd;
  border-radius: 20px;
  padding: 13px 17px;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  background: #ffffff;
  color: #333333;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  /**
   * Some Windows browsers render a textarea's overflow-y:auto scrollbar
   * as a full classic (non-overlay) scrollbar WITH up/down arrow
   * buttons, reserving that visible chrome even for a single line of
   * text that doesn't actually need to scroll yet -- that's the
   * unwanted right-side UI, not the resize handle (resize:none above
   * already removes that). scrollbar-width here is Firefox's thin-
   * scrollbar equivalent of the ::-webkit-scrollbar-* rules below.
   */
  scrollbar-width: thin;
  scrollbar-color: #cccccc transparent;
}

#angstrom-chatbot-widget .chat-input-area textarea::-webkit-scrollbar {
  width: 6px;
}

#angstrom-chatbot-widget .chat-input-area textarea::-webkit-scrollbar-track {
  background: transparent;
}

#angstrom-chatbot-widget .chat-input-area textarea::-webkit-scrollbar-thumb {
  background-color: #cccccc;
  border-radius: 3px;
}

/* Removes the up/down arrow buttons some browsers draw at each end of
   a classic (non-overlay) scrollbar. */
#angstrom-chatbot-widget .chat-input-area textarea::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

#angstrom-chatbot-widget .chat-input-area textarea:focus {
  border-color: #5140a8;
}

#angstrom-chatbot-widget .chat-input-area button {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border: none;
  border-radius: 50%;
  background: #5140a8;
  color: #ffffff;
  cursor: pointer;
  font-size: 18px;
}

#angstrom-chatbot-widget .chat-input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#angstrom-chatbot-widget .chatbot-disclaimer {
  padding: 4px 15px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #777777;
  text-align: center;
}

#angstrom-chatbot-widget .typing {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

#angstrom-chatbot-widget .typing span {
  width: 6px;
  height: 6px;
  background: #999999;
  border-radius: 50%;
  animation: angstrom-chatbot-typing 1s infinite;
}

#angstrom-chatbot-widget .typing span:nth-child(2) {
  animation-delay: 0.15s;
}

#angstrom-chatbot-widget .typing span:nth-child(3) {
  animation-delay: 0.3s;
}

#angstrom-chatbot-widget .typing p {
  font-size: 11px;
  color: #999999;
  margin-left: 5px;
}

#angstrom-chatbot-widget .hidden {
  display: none;
}

@keyframes angstrom-chatbot-typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-4px);
  }
}

@media (max-width: 500px) {
  #angstrom-chatbot-widget .chatbot {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
}

#angstrom-chatbot-widget .message-bubble a {
  color: #5140a8;
  font-weight: 600;
  font-size: 0.85em;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  margin-left: 4px;
}

#angstrom-chatbot-widget .message-bubble a:hover {
  text-decoration: underline;
}

#angstrom-chatbot-widget .follow-up-wrapper {
  margin: 4px 0 18px 42px;
  max-width: 80%;
}

#angstrom-chatbot-widget .follow-up-title {
  font-size: 11px;
  color: #777777;
  margin-bottom: 7px;
}

#angstrom-chatbot-widget .follow-up-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#angstrom-chatbot-widget .follow-up-button {
  border: 1px solid #ddd8f5;
  background: #ffffff;
  color: #5140a8;
  padding: 8px 11px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

#angstrom-chatbot-widget .follow-up-button:hover {
  background: #f0eff7;
}

#angstrom-chatbot-widget .follow-up-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #ffffff;
}

#angstrom-chatbot-widget .message-bubble p {
  margin: 0 0 10px;
}

#angstrom-chatbot-widget .message-bubble p:last-child {
  margin-bottom: 0;
}

#angstrom-chatbot-widget .message-bubble ul,
#angstrom-chatbot-widget .message-bubble ol {
  margin: 8px 0 10px 20px;
  padding: 0;
  max-width: 100%;
}

#angstrom-chatbot-widget .message-bubble li {
  margin-bottom: 6px;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#angstrom-chatbot-widget .message-bubble li:last-child {
  margin-bottom: 0;
}

#angstrom-chatbot-widget .message-bubble strong {
  font-weight: 700;
}

#angstrom-chatbot-widget .message-bubble h3 {
  font-size: 15px;
  margin: 0 0 8px;
  font-weight: 700;
}

#angstrom-chatbot-widget .message-bubble h3:not(:first-child) {
  margin-top: 14px;
}

/**
 * The model is instructed to produce an actual <table> when the user
 * explicitly asks for a tabular/table-format comparison (see the
 * backend's system prompt rule 38) -- script.js's wrapChatTables()
 * wraps any <table> it finds in a bot message in this div
 * automatically, so this is the only place a table needs handling.
 * `!important` plus the extra `.chatbot table` / `.message table`
 * fallback selectors below are deliberate belt-and-suspenders: this
 * selector is already specific enough on its own to win normally, but
 * a theme or other site-wide CSS loaded after this stylesheet could in
 * principle still carry its own `!important` on a table/th/td rule, so
 * every font-size declaration below is pinned explicitly rather than
 * relying on inheriting it once from the table element.
 *
 * `overflow-x: auto` turns this wrapper into its own horizontal
 * scroll container -- this is what makes table-layout: auto (below)
 * safe to use. table-layout: fixed was used here previously
 * specifically to PREVENT a table from ever exceeding the wrapper's
 * width (confirmed directly: a real response containing the 22-
 * character unbreakable token "Elongated/rectangular" made
 * table-layout: auto's own column-sizing algorithm grow the table 29px
 * past its 100% width, with nowhere for that overflow to go). Now that
 * this wrapper scrolls instead of clipping, that same growth is simply
 * made reachable by scrolling rather than prevented -- which is also
 * strictly better for a table with many columns, since fixed layout
 * was forced to squeeze every column into an equal, often unreadably
 * narrow share of 100% regardless of how much content it actually
 * held. `overflow-y: hidden` keeps this purely a horizontal scroller (a
 * table never needs its own vertical scrollbar here); `-webkit-
 * overflow-scrolling: touch` keeps the drag-to-scroll feel smooth on
 * iOS Safari, which does not use momentum scrolling by default on a
 * plain `overflow-x: auto` element.
 */
#angstrom-chatbot-widget .chat-table-wrapper {
  max-width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #ddd8f5;
  border-radius: 8px;
  box-sizing: border-box;
}

/**
 * `width: auto` on table-layout: auto, not `width: max-content` --
 * confirmed directly in testing that `max-content` computes a table's
 * width ignoring the available space entirely, which gave even a
 * trivial 2-column table a scrollbar it never needed. `width: auto`
 * instead lets the browser's own automatic table-layout algorithm pick
 * a width bounded by the available space, wrapping sentences within
 * each column (see the th/td rule below) rather than forcing every
 * column to its full unwrapped content width. `min-width: 100%` keeps
 * a short, few-column table filling the full bubble width (as it
 * always has) rather than rendering narrower than its container just
 * because its content happens to be short; `max-width: none` is what
 * lets a table that genuinely cannot fit -- many columns, or a single
 * unbreakable token like a URL (see the th/td rule below) -- actually
 * grow past 100% into the wrapper's horizontal scrollbar, instead of
 * being capped back down and forced to overlap or clip.
 */
#angstrom-chatbot-widget .chat-table-wrapper table,
#angstrom-chatbot-widget .chatbot table,
#angstrom-chatbot-widget .message table {
  width: auto;
  min-width: 100%;
  max-width: none;
  box-sizing: border-box;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 14px !important;
}

/**
 * Sentences and phrases must wrap naturally across multiple lines
 * (`white-space: normal`) -- but a WORD must never split mid-word to do
 * it. `overflow-wrap: anywhere` was tried and rejected for this exact
 * reason: it treats a genuinely unbreakable token (a long URL) and an
 * ordinary word identically, and will cut either one at an arbitrary
 * character the moment its column gets tight. `overflow-wrap: normal`
 * (the actual CSS default, set explicitly so a theme's own site-wide
 * rule can never reintroduce `anywhere`/`break-word` by inheritance)
 * only ever wraps at a genuine word boundary -- an unbreakable token
 * that doesn't fit is left intact and allowed to overflow its line
 * box instead, which for a table-layout: auto column means the COLUMN
 * grows to fit it (exactly the "expand horizontally for long
 * unbreakable words" behavior this is required to support), not that
 * the word gets cut. `hyphens: none` blocks CSS's own automatic
 * hyphenation from splitting a word at a soft hyphen point, the one
 * remaining way a "normal"-wrapping word could still split.
 *
 * `min-width: 100px` per cell is what makes a many-column table
 * actually scroll instead of merely compressing forever -- confirmed
 * directly in testing that WITHOUT a per-cell floor, table-layout:
 * auto has no reason to ever let an ordinary (breakable) sentence
 * exceed the wrapper's width: it can always wrap a sentence down onto
 * more and more lines to keep fitting, so an 8-column table of normal
 * sentences just kept compressing every column tighter and tighter
 * rather than ever triggering the scrollbar. A 100px floor is wide
 * enough for several words of a wrapped sentence per line (matching
 * the "Increased utilization with / minimal material waste for /
 * improved efficiency" wrapping this is required to produce) while
 * still being narrow enough that a handful of columns together
 * legitimately exceed the bubble width and scroll, exactly as a 2-3
 * column table (comfortably under that sum) continues to fit with no
 * scrollbar at all.
 *
 * word-break/overflow-wrap/hyphens are `!important` because the shared
 * `.message-bubble` rule every table cell lives inside sets
 * `overflow-wrap: anywhere; word-break: break-word;` on itself --
 * confirmed as the actual conflicting rule causing words like
 * "maintenance" to split mid-word intermittently inside table cells
 * specifically (a narrow, auto-sized column makes the break visible far
 * more often than it would in an ordinary text bubble). Without
 * `!important` here, this cell rule's normal/none values are a more
 * specific match and would ordinarily be expected to win on their own,
 * but `!important` removes any dependency on that specificity math
 * holding up against this or any future conflicting rule, guaranteeing
 * cells never inherit the bubble's word-splitting behavior.
 */
#angstrom-chatbot-widget .chat-table-wrapper th,
#angstrom-chatbot-widget .chat-table-wrapper td,
#angstrom-chatbot-widget .chatbot table th,
#angstrom-chatbot-widget .chatbot table td,
#angstrom-chatbot-widget .message table th,
#angstrom-chatbot-widget .message table td {
  font-size: 14px !important;
  line-height: 1.4;
  padding: 6px 4px;
  text-align: left;
  vertical-align: top;
  border: 1px solid #eeeeee;
  box-sizing: border-box;
  white-space: normal;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  min-width: 100px;
}

#angstrom-chatbot-widget .chat-table-wrapper th,
#angstrom-chatbot-widget .chatbot table th,
#angstrom-chatbot-widget .message table th {
  background: #f0eff7;
  color: #333333;
  font-size: 14px !important;
  font-weight: 600;
}

#angstrom-chatbot-widget .chat-table-wrapper td,
#angstrom-chatbot-widget .chatbot table td,
#angstrom-chatbot-widget .message table td {
  font-size: 14px !important;
  font-weight: 400;
}

#angstrom-chatbot-widget .product-cards-wrapper,
#angstrom-chatbot-widget .resource-cards-wrapper {
  margin: 4px 0 18px 42px;
  max-width: 80%;
}

#angstrom-chatbot-widget .cards-title {
  font-size: 11px;
  color: #777777;
  margin-bottom: 7px;
}

#angstrom-chatbot-widget .product-cards,
#angstrom-chatbot-widget .resource-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#angstrom-chatbot-widget .product-card {
  display: flex;
  gap: 10px;
  border: 1px solid #ddd8f5;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
}

/**
 * The generic `.hidden { display: none }` utility rule (used to hide
 * products 4+ until "Load More" is clicked -- see
 * PRODUCT_CARDS_INITIAL_VISIBLE in script.js) has the SAME selector
 * specificity as `.product-card` above (one ID + one class each), so
 * without this more specific override, the cascade falls back to
 * source order and `.product-card`'s own `display: flex` -- appearing
 * later in this file -- was winning over `.hidden`, silently rendering
 * every "hidden" extra product card anyway. This selector combines
 * both classes so it always wins regardless of source order.
 */
#angstrom-chatbot-widget .product-card.hidden {
  display: none;
}

#angstrom-chatbot-widget .product-card-image-link {
  display: block;
  width: 56px;
  height: 56px;
  min-width: 56px;
}

#angstrom-chatbot-widget .product-card-image {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0eff7;
}

#angstrom-chatbot-widget .product-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#angstrom-chatbot-widget .product-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #333333;
}

#angstrom-chatbot-widget .product-card-attributes {
  font-size: 11px;
  color: #555555;
  line-height: 1.4;
}

#angstrom-chatbot-widget .product-card-row {
  font-size: 11px;
  color: #555555;
}

#angstrom-chatbot-widget .product-card-label {
  color: #777777;
  margin-right: 3px;
}

#angstrom-chatbot-widget .product-card-price {
  font-size: 12px;
  font-weight: 700;
  color: #333333;
}

#angstrom-chatbot-widget .product-card-price.on-request {
  color: #5140a8;
  font-weight: 400;
  font-style: italic;
}

#angstrom-chatbot-widget .product-card-link {
  align-self: flex-start;
  margin-top: 4px;
  color: #ffffff;
  background: #5140a8;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 16px;
}

#angstrom-chatbot-widget .product-card-link:hover {
  background: #443590;
}

#angstrom-chatbot-widget .load-more-products-button {
  align-self: flex-start;
  margin-top: 4px;
  border: 1px solid #ddd8f5;
  background: #ffffff;
  color: #5140a8;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 18px;
  cursor: pointer;
}

#angstrom-chatbot-widget .load-more-products-button:hover {
  background: #f0eff7;
}

#angstrom-chatbot-widget .resource-card {
  display: block;
  border: 1px solid #ddd8f5;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
}

#angstrom-chatbot-widget a.resource-card:hover {
  background: #f0eff7;
}

#angstrom-chatbot-widget .resource-card-type {
  font-size: 10px;
  color: #5140a8;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

#angstrom-chatbot-widget .resource-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #333333;
}

#angstrom-chatbot-widget .resource-card-description {
  font-size: 11px;
  color: #555555;
  margin-top: 3px;
  line-height: 1.4;
}
