#dam-chat { display: contents; font-family: system-ui, sans-serif; font-size: 15px; color: var(--text, #171a23); }
#dam-chat *, #dam-chat *::before { box-sizing: border-box; }
#dam-chat [hidden] { display: none !important; }
#dam-chat button, #dam-chat input, #dam-chat select, #dam-chat textarea { font: inherit; color: inherit; }
#dam-chat button { cursor: pointer; border: 1px solid var(--border, #e6e8ef); border-radius: 10px; padding: 8px 12px; background: var(--surface, white); }
#dam-chat button:disabled { cursor: wait; opacity: .6; }
#dam-chat :focus-visible { outline: 3px solid var(--primary, #4338ca); outline-offset: 2px; }

#dam-chat .dc-launcher { position: fixed; right: 18px; bottom: 18px; z-index: 999; width: 56px; height: 56px; padding: 14px; border-radius: 50%; border: 3px solid var(--surface, white); background: var(--primary, #4338ca); color: #fff; box-shadow: 0 6px 22px #0003; transition: transform .15s; }
#dam-chat .dc-launcher:hover { transform: translateY(-2px); }
#dam-chat .dc-launcher svg { width: 100%; height: 100%; display: block; }
#dam-chat .dc-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--danger, #be123c); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; border: 2px solid var(--surface, white); }
html.dc-open #dam-chat .dc-launcher { transform: scale(.9); opacity: 0; pointer-events: none; }

#dam-chat .dc-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 998; width: min(430px, 100%); min-width: 0; max-width: 100%; display: flex; flex-direction: column; background: var(--surface, white); border-left: 1px solid var(--border, #e6e8ef); box-shadow: -18px 0 60px #0002; animation: dc-in .18s ease-out; }
@keyframes dc-in { from { transform: translateX(24px); opacity: 0; } }
#dam-chat .dc-resize { position: absolute; top: 0; left: -6px; width: 12px; height: 100%; cursor: col-resize; touch-action: none; }
#dam-chat .dc-resize::after { content: ''; position: absolute; top: 0; left: 5px; width: 3px; height: 100%; background: transparent; border-radius: 3px; transition: background .15s; }
#dam-chat .dc-resize:hover::after, #dam-chat .dc-resize:focus-visible::after, #dam-chat .dc-resize.is-active::after { background: var(--primary, #4338ca); }
html.dc-resizing, html.dc-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 600px) {
  #dam-chat .dc-resize { display: none; }
}
#dam-chat .dc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 76px 20px 12px; border-bottom: 1px solid var(--border, #e6e8ef); }
#dam-chat .dc-eyebrow { display: block; font-size: 10px; font-weight: 750; letter-spacing: .15em; color: var(--primary, #4338ca); }
#dam-chat h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
#dam-chat .dc-close { border: 0; padding: 2px 10px; font-size: 24px; line-height: 1; background: transparent; }
#dam-chat .dc-status { margin: 0; padding: 0 20px; font-size: 13px; color: var(--danger, #be123c); }
#dam-chat .dc-status:not(:empty) { padding: 10px 20px 0; }
#dam-chat .dc-main { flex: 1; overflow-y: auto; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
#dam-chat .dc-primary { background: var(--primary, #4338ca); color: #fff; border: 0; font-weight: 600; }

#dam-chat .dc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
#dam-chat .dc-filter { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-alt, #f0f2f7); }
#dam-chat .dc-filter button { border: 0; padding: 6px 10px; font-size: 12px; background: transparent; }
#dam-chat .dc-filter [aria-pressed=true] { background: var(--surface, white); color: var(--primary, #4338ca); box-shadow: 0 1px 4px #0001; }
#dam-chat .dc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#dam-chat .dc-item { position: relative; width: 100%; text-align: left; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border-radius: 12px; }
#dam-chat .dc-item:hover { border-color: var(--primary-border, var(--primary, #4338ca)); }
#dam-chat .dc-item-title { font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
#dam-chat .dc-unread { background: var(--primary-light, #eef0ff); }
#dam-chat .dc-unread .dc-item-title::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--primary, #4338ca); vertical-align: middle; }
#dam-chat .dc-meta, #dam-chat .dc-count, #dam-chat time, #dam-chat .dc-hint { font-size: 12px; color: var(--text-muted, #5c6478); }
#dam-chat .dc-chips:empty { display: none; }
#dam-chat .dc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
#dam-chat .dc-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-alt, #f0f2f7); color: var(--text-muted, #5c6478); }
#dam-chat .dc-ok { background: #dcfce7; color: #166534; }
#dam-chat .dc-pin { background: var(--warning-light, #fef3c7); color: var(--warning, #92400e); }
#dam-chat .dc-empty { text-align: center; padding: 24px 8px; color: var(--text-muted, #5c6478); }
#dam-chat .dc-empty p { margin: 0 0 10px; line-height: 1.5; }
#dam-chat .dc-empty strong { color: var(--text, #171a23); }

#dam-chat .dc-back { align-self: flex-start; border: 0; padding: 4px 0; background: transparent; color: var(--primary, #4338ca); font-size: 13px; font-weight: 600; }
#dam-chat .dc-form { display: flex; flex-direction: column; gap: 12px; }
#dam-chat .dc-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
#dam-chat input, #dam-chat select, #dam-chat textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border, #e6e8ef); background: var(--surface-alt, #f0f2f7); font-weight: 400; }
#dam-chat textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
#dam-chat .dc-hint { margin: 0; }

#dam-chat .dc-thread { display: flex; flex-direction: column; gap: 10px; }
#dam-chat .dc-thread h3 { margin: 0; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
#dam-chat .dc-count { margin: 6px 0 0; font-weight: 600; }
#dam-chat .dc-post { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border, #e6e8ef); }
#dam-chat .dc-first { background: var(--surface-alt, #f0f2f7); }
#dam-chat .dc-solution { border: 2px solid #16a34a; }
#dam-chat .dc-post header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: 13px; }
#dam-chat .dc-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--primary, #4338ca); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
#dam-chat .dc-body { line-height: 1.55; overflow-wrap: anywhere; }
#dam-chat .dc-body a { color: var(--primary, #4338ca); }
#dam-chat .dc-body code { font-family: var(--font-code, ui-monospace, monospace); font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--code-inline-bg, #eef0f5); color: var(--code-inline-text, inherit); }
#dam-chat .dc-body pre { margin: 8px 0; padding: 10px 12px; overflow-x: auto; border-radius: 8px; background: var(--code-bg, #1e2230); color: var(--code-text, #e6e8ef); }
#dam-chat .dc-body pre code { padding: 0; background: none; color: inherit; }
#dam-chat .dc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#dam-chat .dc-actions button { padding: 4px 9px; font-size: 12px; }
#dam-chat .dc-reply { position: sticky; bottom: -20px; margin: 4px -20px -20px; padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 8px; background: var(--surface, white); border-top: 1px solid var(--border, #e6e8ef); }
#dam-chat .dc-reply .dc-primary { align-self: flex-end; }
#dam-chat .dc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#dam-chat .dc-ai-button { border-color: var(--primary, #4338ca); color: var(--primary, #4338ca); font-weight: 650; }
#dam-chat .dc-ai-scope { padding: 12px 14px; border-radius: 12px; background: var(--surface-alt, #f0f2f7); display: grid; gap: 7px; }
#dam-chat .dc-ai-messages { display: flex; flex-direction: column; gap: 12px; }
#dam-chat .dc-ai-user { margin-left: 22px; background: var(--surface-alt, #f0f2f7); }
#dam-chat .dc-ai-answer { border-left: 3px solid var(--primary, #4338ca); }
#dam-chat .dc-ai-sources { margin-top: 12px; font-size: 12px; }
#dam-chat .dc-ai-sources summary { cursor: pointer; font-weight: 600; }
#dam-chat .dc-ai-sources ul { padding-left: 18px; }
#dam-chat .dc-ai-sources a { color: var(--primary, #4338ca); }

@media (max-width: 600px) {
  #dam-chat .dc-launcher { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  #dam-chat .dc-head { padding-top: 72px; }
}
