/* Customer-facing content shared by the widget and the public help page:
   formatted help articles, image previews and messages still being sent. */

/* Help articles in the widget (public/article-format.mjs). */
.article-view .article-body.is-formatted { white-space: normal; }
.article-view .article-body.is-formatted > :first-child { margin-top: 0; }
.article-view .article-body p { margin: 0 0 14px; }
.article-view .article-body h2 { margin: 22px 0 8px; font-size: 17px; font-weight: 650; line-height: 1.4; color: #1d4330; }
.article-view .article-body h3 { margin: 18px 0 6px; font-size: 15px; font-weight: 650; line-height: 1.45; color: #1d4330; }
.article-view .article-body :is(ul,ol) { margin: 0 0 14px; padding-left: 1.35em; }
.article-view .article-body li { margin: 0 0 6px; padding-left: 2px; }
.article-view .article-body li > :is(ul,ol) { margin: 6px 0 0; }
.article-view .article-body strong { font-weight: 650; color: #213f2e; }
.article-view .article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* Flattened tables («Header: value» lines) in both readers. */
.article-fields { display: grid; gap: 0; margin: 0 0 16px; border: 1px solid #dce9e0; border-radius: 10px; overflow: hidden; }
.article-fields > div { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 10px; padding: 8px 12px; border-top: 1px solid #e6efe9; }
.article-fields > div:first-child { border-top: 0; }
.article-fields dt { margin: 0; font-weight: 650; color: #24432f; overflow-wrap: anywhere; }
.article-fields dd { margin: 0; overflow-wrap: anywhere; }
.article-view .article-fields { font-size: 14px; line-height: 1.6; }
@media (max-width: 380px) { .article-fields > div { grid-template-columns: 1fr; gap: 2px; } }

/* Public /help reader additions. */
.reader-body h3 { font-size: 20px; letter-spacing: -.4px; color: #214c30; font-weight: 600; line-height: 1.4; margin: 32px 0 14px; scroll-margin-top: 110px; }
.reader-body strong { font-weight: 650; color: #1f3f2c; }
.reader-body li > :is(ul,ol) { margin: 10px 0 0; }
.reader-body .article-fields { margin-bottom: 27px; font-size: 16px; line-height: 1.7; }

/* Image thumbnails in the conversation open a preview (UX-21). */
/* A fixed box: the thread does not jump when the picture arrives (the chat scrolls smoothly to the end). */
.widget-message .widget-inline-image { position: relative; display: grid; place-items: center; width: min(100%, 280px); height: 190px; cursor: zoom-in; background: #f4f8f5; border: 1px solid #d8e6dd; }
.widget-message.customer .widget-inline-image { border-color: #ffffff55; }
.widget-message .widget-inline-image img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.widget-message .widget-inline-image span { color: #4c6656; overflow-wrap: anywhere; text-align: center; }
.widget-message .widget-inline-image:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.widget-image-viewer { width: min(calc(100% - 24px), 680px); max-width: none; max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 16px; background: #0d1f16; color: #f4faf6; overflow: hidden; }
.widget-image-viewer::backdrop { background: #061a1199; }
.widget-image-viewer .viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; }
.widget-image-viewer .viewer-bar strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.widget-image-viewer button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 8px 10px; color: #f4faf6; background: #ffffff14; border: 0; border-radius: 9px; font-size: 13px; cursor: pointer; }
.widget-image-viewer button:hover { background: #ffffff24; }
.widget-image-viewer button:focus-visible { outline: 3px solid #6ee7b7; outline-offset: 2px; }
.widget-image-viewer .icon { width: 17px; height: 17px; }
.widget-image-viewer .viewer-stage { display: grid; place-items: center; min-height: 160px; padding: 0 10px 10px; }
.widget-image-viewer .viewer-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 110px); object-fit: contain; border-radius: 8px; background: #ffffff; }
.widget-image-viewer .viewer-status { margin: 24px 12px; font-size: 13px; color: #cfe3d7; text-align: center; }
@media (max-width: 340px) { .widget-image-viewer .viewer-download span { display: none; } }

/* Messages queued in the composer while an earlier one is being sent (UX-24). */
.widget-message.is-pending .bubble { opacity: .78; }
.widget-message.is-failed .bubble { opacity: 1; background: #fff4f4; color: #6b1f28; border: 1px solid #efc7cc; }
.widget-message.is-pending .meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.widget-message .pending-file { display: block; margin-top: 4px; font-size: 12px; opacity: .9; }
.widget-message .pending-retry { min-height: 32px; padding: 4px 10px; color: var(--accent); background: transparent; border: 1px solid currentColor; border-radius: 8px; font-size: 12px; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .widget-message.is-pending:not(.is-failed) .meta { animation: pending-pulse 1.4s ease-in-out infinite; } }
@keyframes pending-pulse { 50% { opacity: .55; } }
/* Grid tables of imported articles (`| a | b |` rows), widget and /help. */
.article-table { margin: 0 0 16px; overflow-x: auto; }
.article-table table { width: 100%; border: 1px solid #c6c9c0; border-radius: 6px; border-collapse: separate; border-spacing: 0; font-size: inherit; }
.article-table td, .article-table th { padding: 8px; vertical-align: top; text-align: left; border-top: 1px solid #c6c9c0; border-left: 1px solid #c6c9c0; overflow-wrap: break-word; }
.article-table tr:first-child > * { border-top: 0; }
.article-table tr > *:first-child { border-left: 0; }
.article-view .article-table { font-size: 13px; line-height: 1.5; }

/* ── Batch 6 (audit 15/11/2026) ─────────────────────────────────────────────── */
/* CLI-10: callout boxes and rules of help articles, in both readers. Colours are Intercom's own (50% tint, 20% border). */
.article-callout { margin: 0 0 16px; padding: 12px 16px; border: 1px solid #73737633; border-radius: 8px; background: #e8e8e880; overflow-wrap: anywhere; }
.article-callout.is-yellow { background: #feedaf80; border-color: #fbc91633; }
.article-callout.is-blue { background: #e3e7fa80; border-color: #334bfa33; }
.article-callout.is-green { background: #d7efdc80; border-color: #1bb15733; }
.article-callout.is-red { background: #fed9db80; border-color: #fd3a5733; }
.article-callout > :first-child { margin-top: 0 !important; padding-top: 0 !important; }
.article-callout > :last-child { margin-bottom: 0 !important; }
.article-rule { height: 0; margin: 24px 0; border: 0; border-top: 1px solid #d9dfda; }
.article-view .article-body h4 { margin: 16px 0 6px; font-size: 14px; font-weight: 650; line-height: 1.45; color: #1d4330; }
.article-view .article-body a[data-help-nav] { cursor: pointer; }

/* CLI-11: «Did this answer your question?» (only for a company that turned it on). */
.article-reactions { margin: 28px 0 0; padding: 16px 12px; border-radius: 12px; background: #f4f6f5; text-align: center; }
.article-reactions p { margin: 0 0 6px; font-size: 14px; color: inherit; }
.article-reaction-faces { display: flex; justify-content: center; gap: 6px; }
.article-reactions button { width: 48px; height: 48px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 30px; line-height: 1; cursor: pointer; transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease; }
.article-reactions button:hover:not(:disabled) { transform: scale(1.14); }
.article-reactions button:disabled { cursor: default; opacity: .35; filter: grayscale(1); }
.article-reactions button[aria-pressed=true] { opacity: 1; filter: none; transform: scale(1.14); }
.article-reactions button:focus-visible { outline: 3px solid var(--accent, #087f5b); outline-offset: 2px; }
.article-reactions small { display: block; margin-top: 6px; font-size: 13px; }
:root[data-help-variant=dark] .article-reactions { background: var(--hc-soft, #06161f); color: var(--hc-ink, #fff); }
@media (prefers-reduced-motion: reduce) { .article-reactions button { transition: none; } }

/* Widget conversation. */
/* CLI-08: an answer that ends with its help article shows the article as a card that opens inside the widget. */
.widget-message .bubble.is-article-link { display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.widget-message .article-link-label { font-size: 12px; font-weight: 600; color: #5a6f62; }
.widget-message .bubble.is-article-link .home-suggested { width: 100%; justify-content: flex-start; gap: 9px; min-height: 44px; padding: 9px 11px; border: 1px solid #d5e4da; border-radius: 10px; background: #fff; text-align: left; font-weight: 600; line-height: 1.4; }
.widget-message .bubble.is-article-link .home-suggested > .icon:first-child { width: 18px; height: 18px; }
.widget-message .bubble.is-article-link .home-suggested > .icon:last-child { width: 14px; height: 14px; margin-left: auto; }
/* CLI-21: the emoji of a menu button keeps its own box, so a wide glyph never sits on the text. */
.choice-grid button > .choice-emoji { flex: 0 0 auto; min-width: 1.35em; margin-right: 1px; text-align: center; font-size: 1.08em; line-height: 1; }
.choice-grid button > .choice-text { flex: 1; min-width: 0; }
/* CLI-13: the chat header stays on one line; on a narrow panel the language button shows its globe only. */
.widget-header .widget-header-text strong, .widget-header .widget-header-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) {
  .widget-header .customer-language-trigger { width: 44px; min-width: 44px; padding: 0; gap: 0; }
  .widget-header .customer-language-trigger > span, .widget-header .customer-language-trigger .language-chevron { display: none; }
}
/* CLI-24: the rating is sent with the company's colour, like every other main action of the widget. */
.widget .visitor-survey button[type=submit] { background: var(--accent); color: #fff; }
.widget .visitor-survey button[type=submit]:hover:not(:disabled) { filter: brightness(.94); }
.widget .survey-rating input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
/* CLI-24: Home and the details form scroll clear of the bottom bar (the language button and «Save» were half covered). */
.widget-content > .home-language { flex-shrink: 0; margin-top: auto; padding-bottom: 20px; }
.widget-content > .home-header, .widget-content > .home-cards, .widget-content > .visitor-profile { flex-shrink: 0; }
