/* ==========================================================================
   DMF Editorial Craft V5 — Quiet Editorial Concierge & Fuxie Stylesheet
   Isolated from Homepage A V2.6 parity mode (?revision=2.6)
   ========================================================================== */

html[data-revision="2.6"] [data-testid="dmf-global-chatbot-fab"],
html[data-revision="2.6"] .dmf-ai-fab,
html[data-revision="2.6"] .dmf-home-ai-section {
  display: none !important;
}

/* ==========================================================================
   1. HOMEPAGE QUIET EDITORIAL DESK BAR (HomeInlineAiAskBar)
   ========================================================================== */
.dmf-home-ai-section {
  margin-top: 12px;
  margin-bottom: 36px;
  position: relative;
  z-index: 5;
}

.dmf-home-ai-atelier {
  position: relative;
  background: var(--dmf-paper-warm, #efeae0);
  color: var(--dmf-navy, #092b48);
  border: 1px solid var(--dmf-hairline, #d4d8cc);
  border-radius: var(--dmf-radius-md, 12px);
  box-shadow: none;
  padding: 24px 28px;
  box-sizing: border-box;
  max-width: 100%;
}

.dmf-home-ai-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 16px;
}

.dmf-home-ai-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 320px;
}

.dmf-home-ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  flex-shrink: 0;
  overflow: hidden;
  display: block;
}

.dmf-home-ai-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.dmf-home-ai-heading-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.dmf-home-ai-eyebrow {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a561c;
  margin-bottom: 4px;
}

.dmf-home-ai-eyebrow-line {
  width: 18px;
  height: 1px;
  background: var(--dmf-brass, #9a7432);
  flex-shrink: 0;
}

.dmf-home-ai-headline {
  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--dmf-navy, #092b48);
  margin: 0;
}

.dmf-home-ai-headline span {
  color: var(--dmf-ink, #1b3246);
  font-weight: 600;
}

.dmf-home-ai-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.4;
  color: var(--dmf-muted, #546570);
  white-space: normal;
  overflow-wrap: anywhere;
}

.dmf-home-ai-brass-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--dmf-brass, #9a7432);
}

.dmf-home-ai-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
}

.dmf-home-ai-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  border-radius: var(--dmf-radius-sm, 4px);
  padding: 0 12px;
  min-height: 44px;
  transition: border-color 0.18s ease;
}

.dmf-home-ai-input-wrap:focus-within {
  border-color: var(--dmf-navy, #092b48);
  outline: 2px solid rgba(7, 87, 184, 0.22);
  outline-offset: 1px;
}

.dmf-home-ai-input-icon {
  color: var(--dmf-muted, #546570);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.dmf-home-ai-input-wrap input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--dmf-navy, #092b48);
  font-size: 14px;
  font-weight: 400;
  min-height: 42px;
  outline: none;
}

.dmf-home-ai-input-wrap input:focus-visible {
  outline: none;
}

.dmf-home-ai-input-wrap input::placeholder {
  color: var(--dmf-muted, #546570);
}

.dmf-home-ai-cta {
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--dmf-radius-sm, 4px);
  border: 1px solid var(--dmf-navy, #092b48);
  background: var(--dmf-navy, #092b48);
  color: #f8f6ef;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  flex-shrink: 0;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.dmf-home-ai-cta:hover {
  background: var(--dmf-navy-hover, #0d3a61);
  border-color: var(--dmf-navy-hover, #0d3a61);
}

.dmf-home-ai-cta:focus-visible {
  outline: 2px solid var(--dmf-accent, #0757b8);
  outline-offset: 2px;
}

.dmf-home-ai-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  max-width: 100%;
  min-width: 0;
}

.dmf-home-ai-chips-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--dmf-muted, #546570);
  margin-right: 2px;
}

.dmf-home-ai-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: var(--dmf-radius-sm, 4px);
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline, #d4d8cc);
  color: var(--dmf-ink, #1b3246);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.dmf-home-ai-chip:hover {
  background: var(--dmf-paper, #f6f3ec);
  border-color: var(--dmf-navy, #092b48);
  color: var(--dmf-navy, #092b48);
}

@media (max-width: 767px) {
  .dmf-home-ai-section {
    margin-top: 4px;
    margin-bottom: 28px;
  }
  .dmf-home-ai-atelier {
    padding: 18px 16px;
  }
  .dmf-home-ai-top {
    gap: 10px;
    margin-bottom: 14px;
  }
  .dmf-home-ai-identity {
    flex: 1 1 100%;
  }
  .dmf-home-ai-form {
    flex-direction: column;
    gap: 8px;
  }
  .dmf-home-ai-input-icon {
    display: none;
  }
  .dmf-home-ai-input-wrap {
    padding: 0 11px;
  }
  .dmf-home-ai-cta {
    width: 100%;
  }
  .dmf-home-ai-chips {
    gap: 6px;
  }
}

/* ==========================================================================
   2. FLOATING QUIET EDITORIAL CONCIERGE BUTTON (.dmf-ai-fab)
   ========================================================================== */
.dmf-ai-fab {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  max-width: calc(100vw - 28px);
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--dmf-navy, #092b48);
  background: var(--dmf-surface, #fcfaf5);
  color: var(--dmf-navy, #092b48);
  box-shadow: 0 2px 8px rgba(9, 43, 72, 0.08);
  cursor: pointer;
  font-family: Inter, system-ui, sans-serif;
  text-align: left;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dmf-ai-fab:hover {
  background: var(--dmf-paper-warm, #efeae0);
  box-shadow: 0 4px 12px rgba(9, 43, 72, 0.12);
  transform: translateY(-1px);
}

.dmf-ai-fab:focus-visible {
  outline: 2px solid var(--dmf-accent, #0757b8);
  outline-offset: 3px;
}

.dmf-ai-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dmf-navy, #092b48);
  flex-shrink: 0;
}

.dmf-ai-fab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dmf-brass, #9a7432);
  flex-shrink: 0;
}

.dmf-ai-fab-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}

.dmf-ai-fab-label {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--dmf-navy, #092b48);
  white-space: nowrap;
}

.dmf-ai-fab-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--dmf-muted, #546570);
  margin-top: 2px;
  white-space: nowrap;
}

body:has(dialog[open]) .dmf-ai-fab {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  body:has(.mobile-cta) .dmf-ai-fab {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }
  .dmf-ai-fab {
    right: 14px;
    min-height: 48px;
    padding: 8px 14px;
    gap: 8px;
  }
  .dmf-ai-fab-sub {
    display: none !important;
  }
}

/* ==========================================================================
   3. SLIDE-OVER EDITORIAL CONCIERGE DRAWER (.dmf-ai-drawer)
   ========================================================================== */
.dmf-ai-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(9, 43, 72, 0.24);
}

@media (min-width: 1100px) {
  .dmf-ai-drawer-backdrop {
    background: transparent;
    pointer-events: none;
  }
}

.dmf-ai-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(440px, calc(100vw - 32px));
  z-index: 115;
  display: flex;
  flex-direction: column;
  background: var(--dmf-surface, #fcfaf5);
  color: var(--dmf-ink, #1b3246);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  border-radius: var(--dmf-radius-md, 12px);
  box-shadow: 0 12px 36px rgba(9, 43, 72, 0.14);
  overflow: hidden;
  font-family: Inter, system-ui, sans-serif;
  animation: dmf-drawer-in 0.22s ease-out both;
}

@keyframes dmf-drawer-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 767px) {
  .dmf-ai-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(88dvh, 760px);
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
    animation: dmf-sheet-up 0.22s ease-out both;
  }
  @keyframes dmf-sheet-up {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* --- MASTHEAD HEADER --- */
.dmf-ai-masthead {
  position: relative;
  background: var(--dmf-navy, #092b48);
  color: #f8f6ef;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(248, 246, 239, 0.14);
  flex-shrink: 0;
}

.dmf-ai-masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dmf-ai-masthead-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dmf-ai-masthead-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--dmf-radius-sm, 4px);
  background: rgba(248, 246, 239, 0.1);
  border: 1px solid rgba(248, 246, 239, 0.28);
  color: #f8f6ef;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.dmf-ai-masthead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid rgba(248, 246, 239, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.dmf-ai-masthead-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.dmf-ai-masthead-text {
  min-width: 0;
}

.dmf-ai-masthead-title {
  display: block;
  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
  color: #f8f6ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dmf-ai-masthead-context {
  font-size: 11px;
  color: rgba(248, 246, 239, 0.78);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dmf-ai-masthead-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dmf-ai-reset-btn {
  min-height: 34px;
  padding: 5px 10px;
  border-radius: var(--dmf-radius-sm, 4px);
  border: 1px solid rgba(248, 246, 239, 0.26);
  background: transparent;
  color: #f8f6ef;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.dmf-ai-reset-btn:hover {
  background: rgba(248, 246, 239, 0.12);
}

.dmf-ai-close-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--dmf-radius-sm, 4px);
  border: 1px solid rgba(248, 246, 239, 0.26);
  background: transparent;
  color: #f8f6ef;
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.dmf-ai-close-btn:hover {
  background: rgba(248, 246, 239, 0.12);
}

/* --- THREAD & EDITORIAL CARDS --- */
.dmf-ai-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--dmf-surface, #fcfaf5);
}

.dmf-ai-welcome,
.dmf-ai-welcome-card {
  position: relative;
  background: var(--dmf-paper-warm, #efeae0);
  border: 1px solid var(--dmf-hairline, #d4d8cc);
  border-radius: var(--dmf-radius-md, 12px);
  padding: 16px;
  box-shadow: none;
}

.dmf-ai-welcome-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dmf-ai-welcome-copy {
  flex: 1;
  min-width: 0;
}

.dmf-ai-welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a561c;
  margin-bottom: 6px;
}

.dmf-ai-welcome-eyebrow-rule {
  width: 14px;
  height: 1px;
  background: var(--dmf-brass, #9a7432);
  display: inline-block;
  flex-shrink: 0;
}

.dmf-ai-welcome-headline {
  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--dmf-navy, #092b48);
  margin: 0 0 6px;
}

.dmf-ai-welcome-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.56;
  color: var(--dmf-ink, #1b3246);
}

.dmf-ai-welcome-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  overflow: hidden;
  flex-shrink: 0;
}

.dmf-ai-welcome-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.dmf-ai-welcome-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--dmf-hairline, #d4d8cc);
}

.dmf-ai-welcome-pillar {
  font-size: 11px;
  font-weight: 500;
  color: var(--dmf-ink, #1b3246);
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline, #d4d8cc);
  padding: 3px 8px;
  border-radius: var(--dmf-radius-sm, 4px);
}

.dmf-ai-welcome-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.dmf-ai-welcome-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dmf-navy, #092b48);
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  padding: 4px 10px;
  border-radius: var(--dmf-radius-sm, 4px);
  text-decoration: none;
}

.dmf-ai-welcome-link:hover {
  border-color: var(--dmf-navy, #092b48);
  color: var(--dmf-accent, #0757b8);
}

.dmf-ai-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dmf-ai-whisper-chip {
  display: inline-flex;
  align-items: center;
  text-align: left;
  max-width: 100%;
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline, #d4d8cc);
  border-radius: var(--dmf-radius-sm, 4px);
  padding: 6px 10px;
  color: var(--dmf-ink, #1b3246);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.38;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.dmf-ai-whisper-chip:hover:not(:disabled) {
  background: var(--dmf-paper-warm, #efeae0);
  border-color: var(--dmf-navy, #092b48);
  color: var(--dmf-navy, #092b48);
}

.dmf-ai-whisper-chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.dmf-ai-under18-banner {
  background: #faf5ea;
  border: 1px solid var(--dmf-hairline, #d4d8cc);
  border-left: 3px solid var(--dmf-brass, #9a7432);
  border-radius: var(--dmf-radius-sm, 4px);
  padding: 10px 12px;
  font-size: 12.2px;
  line-height: 1.55;
  color: var(--dmf-ink, #1b3246);
}

/* --- MESSAGE BUBBLES & MARKDOWN --- */
.dmf-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dmf-chat-msg-user {
  align-items: flex-end;
}

.dmf-chat-msg-assistant {
  align-items: flex-start;
}

.dmf-chat-sender {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-left: 2px;
}

.dmf-chat-sender-badge {
  width: 20px;
  height: 20px;
  border-radius: var(--dmf-radius-sm, 4px);
  background: var(--dmf-navy, #092b48);
  color: #f8f6ef;
  display: grid;
  place-items: center;
}

.dmf-chat-sender-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  flex-shrink: 0;
}

.dmf-chat-sender-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dmf-muted, #546570);
}

.dmf-chat-bubble-user {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--dmf-navy, #092b48);
  color: #f8f6ef;
  border: 1px solid var(--dmf-navy, #092b48);
  box-shadow: none;
  font-size: 13.8px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.dmf-chat-bubble-assistant {
  max-width: 96%;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--dmf-paper-warm, #efeae0);
  color: var(--dmf-ink, #1b3246);
  border: 1px solid var(--dmf-hairline, #d4d8cc);
  box-shadow: none;
  font-size: 13.8px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.dmf-chat-md-p {
  margin: 0 0 9px 0;
  line-height: 1.64;
  font-size: 13.8px;
  color: var(--dmf-ink, #1b3246);
}

.dmf-chat-md-p:last-child {
  margin-bottom: 0;
}

.dmf-chat-md-strong {
  font-weight: 700;
  color: var(--dmf-navy, #092b48);
}

.dmf-chat-md-em {
  font-style: italic;
  color: var(--dmf-navy, #092b48);
  font-weight: 500;
}

.dmf-chat-md-list {
  list-style: none;
  margin: 8px 0 10px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dmf-chat-md-list:last-child {
  margin-bottom: 0;
}

.dmf-chat-md-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--dmf-ink, #1b3246);
}

.dmf-chat-md-bullet-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dmf-brass, #9a7432);
  margin-top: 8px;
  flex-shrink: 0;
}

.dmf-chat-loading-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px;
}

.dmf-chat-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dmf-chat-loading-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dmf-navy, #092b48);
  animation: dmf-pulse-dot 1.2s infinite ease-in-out;
}

.dmf-chat-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dmf-chat-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.dmf-chat-loading-label {
  font-size: 12px;
  color: var(--dmf-muted, #546570);
  margin-left: 3px;
}

.dmf-chat-handover-badge {
  width: 96%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--dmf-radius-sm, 4px);
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  border-left: 3px solid var(--dmf-brass, #9a7432);
  color: var(--dmf-navy, #092b48);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

/* --- FOOTNOTE CITATION & ACTION CARD --- */
.dmf-ai-citations-wrap {
  width: 96%;
}

.dmf-ai-footnote-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--dmf-accent, #0757b8);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dmf-ai-footnote-link:hover {
  color: var(--dmf-navy, #092b48);
}

.dmf-ai-footnote-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dmf-chat-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 96%;
  background: var(--dmf-surface, #fcfaf5);
  color: var(--dmf-navy, #092b48);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  border-left: 3px solid var(--dmf-navy, #092b48);
  border-radius: var(--dmf-radius-sm, 4px);
  padding: 9px 12px;
  text-decoration: none;
  box-shadow: none;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.dmf-chat-action-card:hover {
  background: var(--dmf-paper-warm, #efeae0);
  border-color: var(--dmf-navy, #092b48);
}

.dmf-chat-action-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a561c;
}

.dmf-chat-action-label {
  font-size: 12.8px;
  font-weight: 600;
  color: var(--dmf-navy, #092b48);
  margin-top: 2px;
  line-height: 1.35;
}

.dmf-chat-action-arrow {
  font-size: 15px;
  font-weight: 600;
  color: var(--dmf-navy, #092b48);
  flex-shrink: 0;
}

/* --- COMPOSER FOOTER --- */
.dmf-ai-composer-shell {
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom, 0px));
  background: var(--dmf-paper-warm, #efeae0);
  border-top: 1px solid var(--dmf-hairline, #d4d8cc);
  flex-shrink: 0;
}

.dmf-ai-composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--dmf-surface, #fcfaf5);
  border: 1px solid var(--dmf-hairline-strong, #b7c0b0);
  border-radius: var(--dmf-radius-sm, 4px);
  padding: 6px 6px 6px 12px;
  transition: border-color 0.16s ease;
}

.dmf-ai-composer-box:focus-within {
  border-color: var(--dmf-navy, #092b48);
  outline: 2px solid rgba(7, 87, 184, 0.2);
  outline-offset: 1px;
}

.dmf-ai-composer-box textarea {
  flex: 1;
  min-height: 34px;
  max-height: 104px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--dmf-navy, #092b48);
  font-size: 13.8px;
  line-height: 1.45;
  padding: 5px 0;
  outline: none;
}

.dmf-ai-composer-box textarea:focus-visible {
  outline: none;
}

.dmf-ai-composer-box textarea::placeholder {
  color: var(--dmf-muted, #546570);
}

.dmf-ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--dmf-radius-sm, 4px);
  border: 0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.dmf-ai-send-btn[data-ready="true"] {
  background: var(--dmf-navy, #092b48);
  color: #f8f6ef;
  cursor: pointer;
}

.dmf-ai-send-btn[data-ready="true"]:hover {
  background: var(--dmf-navy-hover, #0d3a61);
}

.dmf-ai-send-btn[data-ready="false"] {
  background: #e4e0d5;
  color: var(--dmf-muted, #546570);
  cursor: default;
}

.dmf-ai-composer-meta {
  margin-top: 7px;
  padding-inline: 2px;
  font-size: 10.8px;
  color: var(--dmf-muted, #546570);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dmf-ai-composer-scope-link {
  color: var(--dmf-accent, #0757b8);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  flex-shrink: 0;
}

@keyframes dmf-pulse-dot {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dmf-ai-drawer,
  .dmf-chat-loading-dot {
    animation: none !important;
  }
}
