/* The assistant's design, shared by the platform's widget and the employees' full view. theme.css lays out both
   views; this file gives them the widget's look. Three marks on <html>, from the widest to the narrowest:
   - [data-hdm-look] (light.js, every page): colours and components;
   - [data-hdm-panel] (shell.js: inside the platform's frame, or any page below 768px): the panel layout;
   - [data-hdm-embedded] (shell.js: inside the platform's frame only): room for the dashboard's close button and no
     account menu (the platform owns sign-out).
   Keep the 56px header and the host's 32px close button (12px inset) on the same grid. No docking or dashboard layout
   rules belong here. Selectors target LibreChat v0.8.8. */
html[data-hdm-look].light {
  --hdm-text: #040404;
  --hdm-text-secondary: #444;
  --hdm-text-tertiary: #666;
  --hdm-icon: #666;
  --hdm-border: rgb(4 4 4 / 12%);
  --hdm-border-strong: rgb(4 4 4 / 12%);
  --hdm-ground: #fff;
  --hdm-surface-subtle: #efefef;
  --hdm-hover: #f7f7f7;
  --hdm-accent-soft: #f5f7fa;
  --hdm-accent-strong: #040404;
  --hdm-accent-deep: #040404;
  --hdm-shadow-sm: 0 2px 5px rgb(0 0 0 / 10%);
  --hdm-shadow-md: var(--hdm-shadow-sm);
  --surface-submit: 4 4 4;
  --surface-submit-hover: 45 45 45;
  --surface-active-alt: 239 239 239;
  --surface-hover: 247 247 247;
  --text-primary: 4 4 4;
  --text-secondary: 68 68 68;
  --text-tertiary: 102 102 102;
}

html[data-hdm-look].light :focus-visible { outline: 2px solid #040404; outline-offset: 2px; }
html[data-hdm-panel].light main div.absolute.top-0:has([data-testid='model-selector-button']) {
  height: 56px; gap: 0; padding: 0 56px 0 14px;
  border-bottom: 1px solid rgb(4 4 4 / 8%); background: #fff;
}
html[data-hdm-embedded].light main div.absolute.top-0:has([data-testid='model-selector-button']) { padding-right: 84px; }
html[data-hdm-panel].light [data-testid='model-selector-button'] {
  display: flex; align-items: center; gap: 10px; min-width: 0; width: auto; height: 56px;
}
/* The design's header (Figma "Ask Assistant"): the sparkle, then the call to ask in the page's language, both in the AI
   purple (#8e52da), in place of the model spec's label (librechat.yaml), which LibreChat does not translate. */
html[data-hdm-panel].light [data-testid='model-selector-button'] > div {
  flex: none; width: 20px; height: 20px; border-radius: 0;
  background: url('/assets/hdm-sparkle-ai.svg') center / contain no-repeat; box-shadow: none;
}
html[data-hdm-panel].light [data-testid='model-selector-button'] > div > div { visibility: hidden; }
html[data-hdm-panel].light [data-testid='model-selector-button'] > span {
  display: flex; overflow: hidden; height: 20px; align-items: center; color: #8e52da; font-size: 0; line-height: 20px;
  text-overflow: ellipsis;
}
html[data-hdm-panel].light [data-testid='model-selector-button'] > span::before {
  content: 'Ask Agent'; font-size: 14px; font-weight: 700; line-height: 20px;
}
html[data-hdm-panel][lang^='fr'].light [data-testid='model-selector-button'] > span::before { content: "Demander à l'Agent"; }
html[data-hdm-panel].light [data-testid='model-selector-button']::after { content: none; }
html[data-hdm-panel].light #open-sidebar-button,
html[data-hdm-panel].light #mobile-drawer > div:first-child > button:is([aria-label='Close sidebar'], [aria-label='Fermer la barre latérale']) {
  top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 6px; color: #444;
}
html[data-hdm-embedded].light #open-sidebar-button,
html[data-hdm-embedded].light #mobile-drawer > div:first-child > button:is([aria-label='Close sidebar'], [aria-label='Fermer la barre latérale']) { right: 48px; }
html[data-hdm-look].light :is(#open-sidebar-button, #close-sidebar-button, [data-testid='open-sidebar-button'])::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l3 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l3 2'/%3E%3C/svg%3E");
}

/* Static welcome (shell.js), no orb or letter animation: near the composer in the panel, centred in the full view. */
html[data-hdm-panel].light main div.flex.h-full.transform-gpu:has(p.split-parent) {
  flex: 1 1 auto; align-items: flex-start; justify-content: flex-end;
  min-height: 0; padding: 80px 20px 24px;
}
html[data-hdm-panel].light main div.flex.flex-col.items-center.gap-0.p-2:has(p.split-parent),
html[data-hdm-panel].light main div:has(> p.split-parent) { align-items: flex-start; text-align: left; }
html[data-hdm-look].light main div:has(> .icon-xl > img[src='/assets/mark.png']) { display: none; }
html[data-hdm-look].light main p.split-parent { display: none; }
html[data-hdm-look].light main p.hdm-greeting {
  display: block; width: 100%; margin: 0; color: #040404; font: 400 40px/48px var(--hdm-serif);
  letter-spacing: -.01em; text-align: center;
}
html[data-hdm-panel].light main p.hdm-greeting { font-size: 26px; line-height: 32px; text-align: left; }
html[data-hdm-look].light .hdm-greeting em { font-synthesis: style; }
html[data-hdm-look].light .hdm-welcome-description {
  max-width: 560px; margin: 12px auto 0; color: #666; font-size: 15px; line-height: 24px; text-align: center;
}
html[data-hdm-panel].light .hdm-welcome-description { max-width: none; margin: 12px 0 0; font-size: 13px; line-height: 20px; text-align: left; }
html[data-hdm-panel].light main div:has(> button > span.line-clamp-2) { gap: 8px; margin-bottom: 16px; padding: 0 16px; }
html[data-hdm-look].light main div:has(> button > span.line-clamp-2)::before {
  content: 'Start with'; margin: 0 0 2px 4px; padding: 0; background: none; color: #666;
  font-size: 12px; font-weight: 700; line-height: 16px;
}
html[data-hdm-look].light main button:has(> span.line-clamp-2) {
  flex-direction: row; align-items: center; gap: 12px; min-height: 56px; padding: 9px 12px;
  border-radius: 12px; border-color: rgb(4 4 4 / 12%); background: #fff;
  box-shadow: none; transition: background 140ms, border-color 140ms;
}
html[data-hdm-look].light main button:has(> span.line-clamp-2):hover { border-color: #040404; background: #fff; box-shadow: none; transform: none; }
html[data-hdm-look].light main button:has(> span.line-clamp-2)::after {
  position: static; flex: none; width: 14px; height: 14px; margin-left: auto; background: none; opacity: 1;
  content: '›'; color: #666; font-size: 20px; line-height: 12px;
}
html[data-hdm-look].light main button > span.line-clamp-2 { gap: 2px; font-size: 14px; font-weight: 700; line-height: 20px; }
html[data-hdm-look].light main button > span.line-clamp-2::after { display: block; color: #666; font-size: 12px; font-weight: 400; line-height: 16px; }
html[data-hdm-look].light main button:nth-child(1) > span.line-clamp-2::after { content: 'Upload an export, get a synthesis'; }
html[data-hdm-look].light main button:nth-child(2) > span.line-clamp-2::after { content: 'Objectives, KPIs and audience'; }
html[data-hdm-look].light main button:nth-child(3) > span.line-clamp-2::after { content: 'Ad recall, consideration, uplift…'; }

html[data-hdm-panel].light main form:has(#prompt-textarea) {
  width: calc(100% - 32px); margin: 0 16px calc(44px + env(safe-area-inset-bottom, 0px)); padding: 0;
}
html[data-hdm-look].light [data-testid='composer-surface'] {
  padding: 8px 4px 2px 10px; border-radius: 12px; border-color: rgb(4 4 4 / 12%);
  box-shadow: 0 2px 5px rgb(0 0 0 / 6%);
}
html[data-hdm-look].light [data-testid='composer-surface']:focus-within { border-color: #438bee; box-shadow: 0 0 0 3px rgb(67 139 238 / 25%); }
/* 22 to 200px of text. The box is border-box with LibreChat's 13px vertical padding: a 22px floor let its
   height recompute (after an answer) shrink the box below one line and clip the placeholder. */
html[data-hdm-panel].light #prompt-textarea { min-height: 48px; max-height: 226px; font-size: 14px; line-height: 22px; }
html[data-hdm-look].light :is(#send-button, [data-testid='stop-generation-button'], [data-testid='composer-stop-button']) { border-radius: 50%; background: #040404; color: #fff; box-shadow: none; }
html[data-hdm-look].light #send-button:hover { background: #2d2d2d; }
html[data-hdm-panel].light :is(#send-button, [data-testid='stop-generation-button'], [data-testid='composer-stop-button']) { width: 32px; height: 32px; }
html[data-hdm-look].light #send-button:disabled { background: #efefef; color: #818181; opacity: 1; }
html[data-hdm-look].light #attach-file-button { border: 0; background: transparent; color: #666; }
html[data-hdm-look].light form:has(#prompt-textarea)::after {
  content: 'AI agent – answers may contain errors. Do not share personal or sensitive data.'; margin-top: 8px; color: #666; font-size: 11px; line-height: 16px;
}

html[data-hdm-panel].light main .flex.flex-col.pb-9.pt-14 { padding-top: 72px; }
/* The last answer's end (its actions, or its follow-ups) 16px above the composer, as the opening suggestions: the message's
   own 12px + 4px. */
html[data-hdm-panel].light main .flex.flex-col.pb-9.pt-14 { padding-bottom: 4px; }
html[data-hdm-panel].light .message-render { padding: 0 16px; }
html[data-hdm-look].light .user-turn [data-testid='message-body'] { border-radius: 12px 12px 4px 12px; background: rgb(4 4 4 / 3%); }
html[data-hdm-panel].light .user-turn [data-testid='message-body'] { padding: 9px 13px; }
html[data-hdm-look].light .user-turn [data-testid='message-body'] .message-content,
html[data-hdm-look].light .user-turn [data-testid='message-body'] .message-content :is(p, a, li, strong),
html[data-hdm-look].light .agent-turn .message-content { color: #040404; }
html[data-hdm-look].light :is(.user-turn, .agent-turn) .message-content { font-family: var(--hdm-font); letter-spacing: 0; }
html[data-hdm-look].light .agent-turn .message-content a { color: #2f6fc0; }
html[data-hdm-panel].light .user-turn [data-testid='message-body'] .message-content,
html[data-hdm-panel].light .user-turn [data-testid='message-body'] .message-content :is(p, a, li, strong),
html[data-hdm-panel].light .agent-turn .message-content { font-size: 13px; font-weight: 400; line-height: 20px; }
html[data-hdm-panel].light .agent-turn .message-content p { margin-bottom: 6px; }
html[data-hdm-panel].light .agent-turn .message-content :is(ul, ol) { padding-left: 18px; }
html[data-hdm-look].light .agent-turn [data-testid='read-aloud-button'] { display: none !important; }
html[data-hdm-look].light :is(.agent-turn, .user-turn) .group.flex.justify-center.gap-0\.5 > button { width: 28px; height: 28px; border-radius: 6px; }
html[data-hdm-look].light .message-render:has(~ .message-render .agent-turn) .agent-turn .group.flex.justify-center.gap-0\.5 { opacity: 0; }
html[data-hdm-look].light .message-render:is(:hover, :focus-within) .agent-turn .group.flex.justify-center.gap-0\.5 { opacity: 1; }

html[data-hdm-look].light .hdm-thinking-toggle { color: #666; font-size: 12px; line-height: 16px; }
html[data-hdm-look].light .hdm-thinking-glint { color: #666; }
html[data-hdm-look].light .hdm-thinking.is-streaming { padding: 12px; border: 1px solid rgb(4 4 4 / 12%); border-radius: 12px; }
html[data-hdm-look].light .hdm-thinking.is-streaming :is(.hdm-thinking-label, .hdm-thinking-glint) { background: none; color: #666; animation: none; }
html[data-hdm-look].light .hdm-thinking-step svg { color: #666; stroke-width: 1.75; }
html[data-hdm-look].light .hdm-thinking:has([aria-expanded='true']) ~ .hdm-followups { display: none; }
html[data-hdm-look].light .hdm-followups { flex-direction: column; align-items: stretch; gap: 8px; }
html[data-hdm-look].light .hdm-followups > span { margin: 0 0 2px 4px; color: #666; font-size: 12px; font-weight: 700; line-height: 16px; }
html[data-hdm-look].light .hdm-followups button {
  justify-content: space-between; gap: 12px; min-height: 56px; padding: 9px 12px;
  border: 1px solid rgb(4 4 4 / 12%); border-radius: 12px; background: #fff; color: #040404;
  font-size: 13px; font-weight: 500; line-height: 20px; letter-spacing: 0; transition: border-color 140ms;
}
html[data-hdm-look].light .hdm-followups button:hover { border-color: #040404; background: #fff; color: #040404; }
html[data-hdm-look].light .hdm-followups-arrow { order: 2; width: 14px; height: 14px; background: none; }
html[data-hdm-look].light .hdm-followups-arrow::before { content: '›'; color: #666; font-size: 20px; line-height: 12px; }

/* Keep LibreChat's native alert and retry behavior while matching the panel surfaces. */
html[data-hdm-look].light .agent-turn [role='alert'] {
  padding: 14px; border: 1px solid rgb(4 4 4 / 12%); border-radius: 12px;
  background: #fff; color: #040404; font-size: 13px; line-height: 20px; text-align: left;
}
html[data-hdm-look].light .agent-turn [role='alert'] svg { color: #c1366b; }
html[data-hdm-look].light .agent-turn [role='alert'] button {
  min-height: 32px; padding: 4px 14px; border: 1.5px solid #040404; border-radius: 999px;
  background: #fff; color: #040404; font-size: 13px;
}

/* History: covers the whole panel; in the full view, LibreChat's side panel with the same rows. */
html[data-hdm-panel].light #mobile-drawer { width: 100%; max-width: none; background: #fff; }
html[data-hdm-panel].light #mobile-drawer > div:first-child { height: 56px; min-height: 56px; gap: 0; padding: 0 56px 0 14px; border-bottom: 1px solid rgb(4 4 4 / 8%); }
html[data-hdm-embedded].light #mobile-drawer > div:first-child { padding-right: 84px; }
html[data-hdm-panel].light #mobile-drawer > div:first-child::before { width: 100%; height: 56px; padding-left: 30px; background: url('/assets/hdm-sparkle-ai.svg') left center / 20px 20px no-repeat; content: 'Ask Agent'; color: #8e52da; font-size: 14px; font-weight: 700; line-height: 56px; }
html[data-hdm-panel][lang^='fr'].light #mobile-drawer > div:first-child::before { content: "Demander à l'Agent"; }
html[data-hdm-embedded].light #mobile-drawer [data-testid='nav-user'] { display: none; }
html[data-hdm-panel].light #mobile-drawer > nav { padding-bottom: 16px; }
html[data-hdm-panel]:not([data-hdm-embedded]).light #mobile-drawer > nav { padding-bottom: 84px; }
/* As much room above New chat, under the header's rule, as below it. */
html[data-hdm-panel].light #mobile-drawer > div:has(> a[data-testid='nav-new-chat-fab']) { padding: 12px 16px; }
html[data-hdm-look].light :is(a[data-testid='nav-new-chat-fab'], aside a[data-testid='new-chat-button']) { height: 40px; border-radius: 999px; background: #040404; box-shadow: none; }
html[data-hdm-look].light :is(a[data-testid='nav-new-chat-fab'], aside a[data-testid='new-chat-button']):hover { background: #2d2d2d; }
html[data-hdm-look].light [data-testid='convo-item'] { border-radius: 6px; }
html[data-hdm-look].light [data-testid='convo-item'].bg-surface-active-alt { background: #efefef; }
html[data-hdm-look].light [data-testid='convo-item'] button.grow { padding: 8px 10px; font-size: 14px; }
html[data-hdm-look].light [data-testid='convo-item'] button.grow > div:first-child { display: none; }
html[data-hdm-look].light [data-testid='convo-item'].bg-surface-active-alt button.grow { font-weight: 700; }

/* Full view: the disclaimer sits under the suggestions on the home page (theme.css). */
html[data-hdm-look]:not([data-hdm-panel]).light main div:has(> form #prompt-textarea) > div:has(> button > span.line-clamp-2)::after {
  content: 'AI agent – answers may contain errors. Do not share personal or sensitive data.'; color: #666; font-size: 11px; line-height: 16px;
}

html[data-hdm-look][lang^='fr'].light main div:has(> button > span.line-clamp-2)::before { content: 'Pour commencer'; }
html[data-hdm-look][lang^='fr'].light main button:nth-child(1) > span.line-clamp-2::after { content: 'Envoyez un export, recevez la synthèse'; }
html[data-hdm-look][lang^='fr'].light main button:nth-child(2) > span.line-clamp-2::after { content: 'Objectifs, KPI et audience'; }
html[data-hdm-look][lang^='fr'].light main button:nth-child(3) > span.line-clamp-2::after { content: 'Mémorisation, considération, uplift…'; }
html[data-hdm-look][lang^='fr'].light form:has(#prompt-textarea)::after,
html[data-hdm-look][lang^='fr']:not([data-hdm-panel]).light main div:has(> form #prompt-textarea) > div:has(> button > span.line-clamp-2)::after { content: 'Agent IA – les réponses peuvent contenir des erreurs. Ne partagez pas de données personnelles ou sensibles.'; }

@media (max-height: 650px) {
  html[data-hdm-panel].light main div.flex.h-full.transform-gpu:has(p.split-parent) { flex: none; padding-top: 72px; padding-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-hdm-look].light *, html[data-hdm-look].light *::before, html[data-hdm-look].light *::after { animation: none !important; scroll-behavior: auto !important; }
}
/* A platform page's suggestions (shell.js) are whole questions, not titles: the opening message's size, no prompt line
   (the lines above describe the default starters). */
html[data-hdm-page][data-hdm-look][lang].light main button > span.line-clamp-2 { font-size: 13px; font-weight: 500; }
html[data-hdm-page][data-hdm-look][lang].light main button > span.line-clamp-2::after { content: none; }
/* Menus (a chat's actions, the answer's feedback reasons) and tooltips: white, 12px, no stroke, #f5f7fa on hover, the
   chat's 13px type. The menu itself takes focus when it opens: no ring around it, its items keep theirs. */
html[data-hdm-look].light :is([role='menu'], [role='listbox'], [role='dialog'].popover-animate) {
  border: 0; border-radius: 12px; background: #fff;
}
html[data-hdm-look].light :is([role='menu'], [role='listbox'], [role='dialog'].popover-animate):focus-visible { outline: none; }
html[data-hdm-look].light [role='dialog'].popover-animate button { color: #040404; font-size: 13px; font-weight: 400; }
html[data-hdm-look].light [role='dialog'].popover-animate button:hover { background: #f5f7fa; }
html[data-hdm-look].light [role='menuitem'] { font-size: 13px; }
/* Legal's AI notice (librechat.yaml), as the design's pop-up: the dialog scrolls as a whole, so the title goes up with
   the text; 13px text under a 16px bold title, 10px between the two buttons. */
html[data-hdm-look].light [role='dialog']:has(> div > section[tabindex='0']) h2 { font-size: 16px; font-weight: 700; line-height: 1.35; }
html[data-hdm-look].light [role='dialog'] > div > section[tabindex='0'] { max-height: none; overflow: visible; }
html[data-hdm-look].light [role='dialog'] > div > section[tabindex='0'] .prose { font-size: 13px; }
html[data-hdm-look].light [role='dialog']:has(> div > section[tabindex='0']) > div:has(> button) { gap: 10px; }
html[data-hdm-look].light [role='dialog']:has(> div > section[tabindex='0']) > div:has(> button) > button { margin: 0; }
html[data-hdm-look].light .tooltip { font: 400 13px/18px var(--hdm-font); letter-spacing: 0; }
