/**
 * myCred AI Assistant — v2 conversational UI (token card shell).
 */

 body.mycred_page_mycred-ai-assistant #wpcontent,
 body.mycred_page_mycred-ai-assistant #wpbody,
 body.mycred_page_mycred-ai-assistant #wpbody-content,
 body.toplevel_page_mycred-ai-assistant #wpcontent,
 body.toplevel_page_mycred-ai-assistant #wpbody,
 body.toplevel_page_mycred-ai-assistant #wpbody-content {
	 background-color: var(--mycred-bg, #f8f6ff) !important;
	 background-image: none !important;
 }
 
 .mycred-ai-assistant-wrapper {
	 box-sizing: border-box;
	 display: flex;
	 flex-direction: column;
	 width: 100% !important;
	 max-width: none !important;
	 margin: 0 !important;
	 padding: 0 0 32px !important;
	 background: transparent !important;
	 border: none !important;
	 box-shadow: none !important;
	 border-radius: 0 !important;
	 font-family: var(--mycred-font-sans, "Figtree", "Inter", sans-serif);
	 color: var(--mycred-text-primary, #2d1572);
	 min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px) - 180px);
 }
 
 .mycred-ai-assistant-wrapper *,
 .mycred-ai-assistant-wrapper *::before,
 .mycred-ai-assistant-wrapper *::after {
	 box-sizing: border-box;
 }
 
 @supports (height: 100dvh) {
	 .mycred-ai-assistant-wrapper {
		 min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px) - 180px);
	 }
 }
 
 .mycred-ai-page {
	 display: flex;
	 flex-direction: column;
	 flex: 1;
	 width: 100%;
	 max-width: 1440px;
	 margin: 0 auto;
	 padding: 16px 24px 0;
	 min-height: 0;
 }
 
 /* Shell — white token card */
 .mycred-ai-shell {
	 display: flex;
	 flex-direction: column;
	 flex: 1;
	 min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px) - 180px);
	 padding: 24px;
	 background: var(--mycred-paper, #ffffff);
	 border: 1px solid var(--mycred-border, #e2ddee);
	 border-radius: var(--mycred-radius-section, 14px);
	 box-shadow: var(--mycred-shadow-content-card, 0 1px 3px rgba(45, 21, 114, 0.06));
	 overflow: visible;
 }
 
 @supports (height: 100dvh) {
	 .mycred-ai-shell {
		 min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px) - 180px);
	 }
 }
 
 .mycred-ai-shell.is-can-open {
	 position: relative;
	 z-index: 2;
 }
 
 /* Mode: empty */
 .mycred-ai-shell[data-mode="empty"] {
	 justify-content: center;
	 align-items: center;
	 padding: 48px 24px;
	 gap: 0;
 }
 
 .mycred-ai-shell[data-mode="empty"] .mycred-ai-thread-view {
	 display: none;
 }
 
 .mycred-ai-shell[data-mode="empty"] .mycred-ai-composer-hint {
	 display: none;
 }
 
 .mycred-ai-shell[data-mode="empty"] .mycred-ai-empty-stage {
	 flex: 0 0 auto;
 }
 
 .mycred-ai-shell[data-mode="empty"] .mycred-ai-composer-slot {
	 width: 100%;
	 max-width: 640px;
	 margin: 45px auto 0;
 }
 
 /* Mode: thread */
 .mycred-ai-shell[data-mode="thread"] .mycred-ai-empty-stage,
 .mycred-ai-shell[data-mode="thread"] .mycred-ai-chips {
	 display: none;
 }
 
 .mycred-ai-shell[data-mode="thread"] .mycred-ai-thread-view {
	 flex: 1;
	 min-height: 0;
	 display: flex;
	 flex-direction: column;
	 width: 100%;
	 max-width: 720px;
	 margin: 0 auto;
 }
 
 .mycred-ai-shell[data-mode="thread"] .mycred-ai-composer-slot {
	 flex-shrink: 0;
	 width: 100%;
	 max-width: 720px;
	 margin: 0 auto;
	 padding-top: 12px;
 }
 
 /* Empty stage */
 .mycred-ai-empty-stage {
	 width: 100%;
	 max-width: 640px;
	 margin: 0 auto;
	 display: flex;
	 flex-direction: column;
	 align-items: center;
	 text-align: center;
 }
 
 .mycred-ai-empty-inner {
	 width: 100%;
 }
 
 .mycred-ai-empty-mascot {
	 width: 56px;
	 height: 56px;
	 margin: 0 auto 24px;
	 display: flex;
	 align-items: center;
	 justify-content: center;
 }
 
 .mycred-ai-empty-mascot img {
	 width: 56px;
	 height: 56px;
	 object-fit: contain;
	 display: block;
 }
 
 .mycred-ai-empty-greeting {
	 margin: 0;
	 font-size: 28px;
	 font-weight: 600;
	 line-height: 1.2;
	 letter-spacing: -0.02em;
	 color: var(--mycred-text-primary, #2d1572);
 }
 
 .mycred-ai-empty-lede {
	 margin: 8px 0 0;
	 font-size: 22px;
	 font-weight: 500;
	 line-height: 1.3;
	 color: var(--mycred-text-secondary, #6b57a1);
 }
 
 .mycred-ai-prompt-cards {
	 display: grid;
	 grid-template-columns: repeat(3, minmax(0, 1fr));
	 gap: 12px;
	 width: 100%;
	 margin: 28px 0 0;
	 padding: 0;
	 list-style: none;
 }
 
 .mycred-ai-prompt-cards > li {
	 margin: 0;
	 padding: 0;
 }
 
 .mycred-ai-prompt-card {
	 display: flex;
	 flex-direction: column;
	 align-items: flex-start;
	 gap: 12px;
	 width: 100%;
	 min-height: 120px;
	 margin: 0;
	 padding: 16px;
	 border: 1px solid var(--mycred-border, #e8e0f5);
	 border-radius: var(--mycred-radius-section, 12px);
	 background: var(--mycred-paper, #fff);
	 box-shadow: var(--mycred-shadow-content-card, 0 1px 2px rgba(45, 21, 114, 0.06));
	 color: var(--mycred-text-primary, #2d1572);
	 font-family: inherit;
	 font-size: 13px;
	 font-weight: 500;
	 line-height: 1.4;
	 text-align: left;
	 cursor: pointer;
 }
 
 .mycred-ai-prompt-card svg {
	 color: var(--mycred-primary, #6b3fa0);
	 flex-shrink: 0;
 }
 
 .mycred-ai-prompt-card:hover,
 .mycred-ai-prompt-card:focus-visible {
	 border-color: var(--mycred-border-input, #d4c8e8);
	 background: var(--mycred-hover, #f8f5fc);
	 outline: none;
 }
 
 /* Thread bar */
 .mycred-ai-thread-bar {
	 display: flex;
	 align-items: center;
	 justify-content: space-between;
	 gap: 16px;
	 flex-shrink: 0;
	 padding: 0 0 16px;
	 border-bottom: 1px solid var(--mycred-border, #e2ddee);
 }
 
 .mycred-ai-thread-bar h3 {
	 margin: 0;
	 font-size: 16px;
	 font-weight: 600;
	 line-height: 1.2;
	 color: var(--mycred-text-primary, #2d1572);
 }
 
 /* Messages */
 .mycred-ai-chat-messages {
	 flex: 1;
	 min-height: 0;
	 overflow-y: auto;
	 display: flex;
	 flex-direction: column;
	 gap: 24px;
	 padding: 24px 0;
 }
 
 .mycred-ai-msg-user {
	 align-self: flex-end;
	 max-width: 75%;
	 margin: 0;
	 padding: 10px 16px;
	 border-radius: var(--mycred-radius-section, 14px);
	 background: var(--mycred-primary-light, #ebe4ff);
	 font-size: 14px;
	 font-weight: 500;
	 line-height: 20px;
	 color: var(--mycred-text-primary, #2d1572);
 }
 
 .mycred-ai-msg-ai {
	 display: flex;
	 gap: 12px;
	 align-items: flex-start;
	 max-width: 100%;
 }
 
 .mycred-ai-msg-avatar {
	 flex-shrink: 0;
	 width: 28px;
	 height: 28px;
	 min-width: 28px;
	 min-height: 28px;
	 border-radius: 0;
	 overflow: visible;
	 display: flex;
	 align-items: center;
	 justify-content: center;
	 background: transparent;
	 color: var(--mycred-primary, #5e2ced);
	 font-size: 10px;
	 font-weight: 700;
 }
 
 .mycred-ai-msg-avatar img {
	 width: 100%;
	 height: 100%;
	 object-fit: contain;
	 display: block;
 }
 
 .mycred-ai-msg-body {
	 flex: 1;
	 min-width: 0;
	 padding: 12px 16px;
	 background: var(--mycred-paper, #ffffff);
	 border: 1px solid var(--mycred-border, #e2ddee);
	 border-radius: var(--mycred-radius-lg, 12px);
	 font-size: 14px;
	 line-height: 22px;
	 color: var(--mycred-text-primary, #2d1572);
 }
 
 .mycred-ai-msg-body .message-content a {
	 color: var(--mycred-primary, #5e2ced);
	 font-weight: 600;
	 text-decoration: none;
 }
 
 .mycred-ai-msg-body .message-content a:hover {
	 text-decoration: underline;
 }
 
 .mycred-ai-msg-body .message-content p {
	 margin: 0 0 8px;
 }
 
 .mycred-ai-msg-body .message-content p:last-child {
	 margin: 0;
 }
 
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading {
	 margin: 12px 0 6px;
	 font-weight: 700;
	 color: var(--mycred-text-primary, #2d1572);
	 line-height: 1.35;
 }
 
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading:first-child {
	 margin-top: 0;
 }
 
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading--1 {
	 font-size: 16px;
 }
 
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading--2 {
	 font-size: 15px;
 }
 
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading--3,
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading--4,
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading--5,
 .mycred-ai-msg-body .message-content .mycred-ai-md-heading--6 {
	 font-size: 14px;
 }
 
 .mycred-ai-msg-body .message-content code {
	 background: var(--mycred-paper-muted, #f2effb);
	 padding: 2px 6px;
	 border-radius: var(--mycred-radius-xs, 4px);
	 font-size: 13px;
	 color: var(--mycred-primary, #5e2ced);
 }
 
 .mycred-ai-msg-body .message-content ul {
	 margin: 8px 0;
	 padding-left: 20px;
 }
 
 .mycred-ai-msg-body .message-content li {
	 margin-bottom: 4px;
 }
 
 /* Composer card */
 .mycred-ai-composer {
	 position: relative;
	 width: 100%;
	 margin: 0;
	 padding: 14px 14px 10px 16px;
	 background: var(--mycred-paper, #ffffff);
	 border: 1px solid var(--mycred-border-input, #ddd2f9);
	 border-radius: var(--mycred-radius-section, 14px);
	 box-shadow: var(--mycred-shadow-content-card, 0 1px 3px rgba(45, 21, 114, 0.06));
	 text-align: left;
	 transition: box-shadow 0.15s ease, border-color 0.15s ease;
 }
 
 .mycred-ai-composer:focus-within {
	 border-color: var(--mycred-radio-border, #c4b5fd);
	 box-shadow: var(--mycred-shadow-focus, 0 0 0 3px rgba(94, 44, 237, 0.12));
 }
 
 #mycred-ai-chat-input {
	 display: block;
	 width: 100%;
	 min-height: 72px;
	 max-height: 160px;
	 margin: 0;
	 padding: 0;
	 border: 0;
	 resize: none;
	 background: transparent;
	 color: var(--mycred-text-primary, #2d1572);
	 font-family: inherit;
	 font-size: 15px;
	 line-height: 22px;
	 box-shadow: none;
	 outline: none;
 }
 
 #mycred-ai-chat-input::placeholder {
	 color: var(--mycred-text-muted, #978abc);
 }
 
 .mycred-ai-composer-bar {
	 display: flex;
	 align-items: center;
	 justify-content: space-between;
	 gap: 8px;
	 margin-top: 8px;
 }
 
 .mycred-ai-ghost-btn {
	 display: inline-flex;
	 align-items: center;
	 gap: 6px;
	 height: 32px;
	 margin: 0;
	 padding: 0 10px;
	 border: 0;
	 border-radius: var(--mycred-radius-control, 8px);
	 background: transparent;
	 color: var(--mycred-text-secondary, #6b57a1);
	 font-family: inherit;
	 font-size: 13px;
	 font-weight: 500;
	 line-height: 1;
	 cursor: pointer;
 }
 
 .mycred-ai-ghost-btn svg {
	 display: block;
	 flex-shrink: 0;
 }
 
 .mycred-ai-ghost-btn:hover,
 .mycred-ai-ghost-btn:focus-visible,
 .mycred-ai-ghost-btn[aria-expanded="true"] {
	 background: var(--mycred-hover, #f8f6ff);
	 color: var(--mycred-primary, #5e2ced);
	 outline: none;
 }
 
 #mycred-ai-send-btn {
	 display: inline-flex;
	 align-items: center;
	 justify-content: center;
	 width: 36px;
	 height: 36px;
	 margin: 0;
	 padding: 0;
	 border: 0;
	 border-radius: var(--mycred-radius-control, 8px);
	 background: var(--mycred-primary, #5e2ced);
	 color: var(--mycred-white, #ffffff);
	 cursor: pointer;
	 line-height: 0;
	 transition: background 0.15s ease;
 }
 
 #mycred-ai-send-btn svg {
	 display: block;
 }
 
 #mycred-ai-send-btn:hover,
 #mycred-ai-send-btn:focus-visible {
	 background: var(--mycred-primary-hover, #6a47ff);
	 outline: none;
 }
 
 #mycred-ai-send-btn:disabled {
	 background: var(--mycred-primary-light, #ebe4ff);
	 color: var(--mycred-primary, #5e2ced);
	 cursor: not-allowed;
 }
 
 /* What I can do popover */
 .mycred-ai-can-popover {
	 position: absolute;
	 left: 8px;
	 bottom: calc(100% + 8px);
	 z-index: 5;
	 width: 300px;
	 padding: 12px 14px;
	 background: var(--mycred-paper, #ffffff);
	 border: 1px solid var(--mycred-border-popover, #e2ddee);
	 border-radius: var(--mycred-radius-lg, 12px);
	 box-shadow: var(--mycred-shadow-soft, 0 8px 24px rgba(45, 21, 114, 0.1));
	 text-align: left;
 }
 
 .mycred-ai-can-popover[hidden] {
	 display: none;
 }
 
 .mycred-ai-can-list {
	 margin: 0;
	 padding: 0;
	 list-style: none;
	 display: grid;
	 gap: 8px;
 }
 
 .mycred-ai-can-list li {
	 font-size: 13px;
	 line-height: 1.4;
	 color: var(--mycred-text-secondary, #6b57a1);
 }
 
 .mycred-ai-can-list strong {
	 display: block;
	 color: var(--mycred-text-primary, #2d1572);
	 font-weight: 600;
 }
 
 /* Starter chips */
 .mycred-ai-chips {
	 display: flex;
	 flex-wrap: wrap;
	 justify-content: center;
	 gap: 8px;
	 margin: 0;
	 padding: 0;
	 list-style: none;
 }
 
 .mycred-ai-composer .mycred-ai-chips {
	 margin: 12px 0 0;
	 padding-top: 12px;
	 border-top: 1px solid var(--mycred-border, #e2ddee);
	 justify-content: flex-start;
 }
 
 .mycred-ai-chips li {
	 margin: 0;
	 padding: 0;
 }
 
 .mycred-ai-chip {
	 display: inline-flex;
	 align-items: center;
	 gap: 6px;
	 height: 34px;
	 margin: 0;
	 padding: 0 14px;
	 border: 1px solid transparent;
	 border-radius: var(--mycred-radius-pill, 999px);
	 background: var(--mycred-paper-muted, #f2effb);
	 color: var(--mycred-text-primary, #2d1572);
	 font-family: inherit;
	 font-size: 13px;
	 font-weight: 500;
	 line-height: 1;
	 cursor: pointer;
	 transition: background 0.15s ease, border-color 0.15s ease;
 }
 
 .mycred-ai-chip svg {
	 color: var(--mycred-primary, #5e2ced);
	 flex-shrink: 0;
 }
 
 .mycred-ai-chip:hover,
 .mycred-ai-chip:focus-visible {
	 background: var(--mycred-primary-light, #ebe4ff);
	 border-color: var(--mycred-border-input, #ddd2f9);
	 outline: none;
 }
 
 .mycred-ai-composer-meta {
	 display: flex;
	 align-items: center;
	 justify-content: space-between;
	 gap: 12px;
	 margin: 8px 0 0;
 }

 .mycred-ai-composer-hint {
	 margin: 0;
	 font-size: 12px;
	 line-height: 16px;
	 color: var(--mycred-text-muted, #978abc);
 }

 .mycred-ai-composer-quota {
	 margin: 0 0 0 auto;
	 font-size: 12px;
	 line-height: 16px;
	 font-weight: 500;
	 color: var(--mycred-text-muted, #978abc);
	 white-space: nowrap;
 }
 
 /* Typing indicator */
 .mycred-ai-typing-content {
	 display: flex;
	 align-items: center;
	 min-height: 20px;
 }
 
 .mycred-ai-typing-indicator {
	 display: inline-flex;
	 gap: 6px;
	 align-items: center;
	 height: 12px;
 }
 
 .mycred-ai-typing-indicator span {
	 display: block;
	 width: 8px;
	 height: 8px;
	 border-radius: 50%;
	 background-color: var(--mycred-primary, #5e2ced);
	 animation: mycredAiTyping 1.2s infinite ease-in-out both;
 }
 
 .mycred-ai-typing-indicator span:nth-child(1) {
	 animation-delay: 0s;
 }
 
 .mycred-ai-typing-indicator span:nth-child(2) {
	 animation-delay: 0.15s;
 }
 
 .mycred-ai-typing-indicator span:nth-child(3) {
	 animation-delay: 0.3s;
 }
 
 @keyframes mycredAiTyping {
	 0%,
	 60%,
	 100% {
		 transform: translateY(0);
		 opacity: 0.35;
	 }
 
	 30% {
		 transform: translateY(-3px);
		 opacity: 1;
	 }
 }
 
 /* Tables in assistant replies */
 .mycred-ai-table-wrapper {
	 overflow-x: auto;
	 margin: 12px 0;
	 border-radius: var(--mycred-radius-card, 8px);
	 border: 1px solid var(--mycred-hook-card-border, #e5dff6);
	 background: var(--mycred-paper, #ffffff);
 }
 
 .mycred-ai-table {
	 width: 100%;
	 border-collapse: collapse;
	 font-size: 14px;
	 text-align: left;
 }
 
 .mycred-ai-table th,
 .mycred-ai-table td {
	 padding: 10px 14px;
	 border-bottom: 1px solid var(--mycred-border, #e2ddee);
	 color: var(--mycred-text-primary, #2d1572);
 }
 
 .mycred-ai-table th {
	 background: var(--mycred-hover, #f8f6ff);
	 font-weight: 600;
	 color: var(--mycred-table-header-text, #715da9);
 }
 
 .mycred-ai-table tr:last-child td {
	 border-bottom: none;
 }
 
 /* Scrollbars */
 .mycred-ai-assistant-wrapper .mycred-ai-chat-messages,
 .mycred-ai-assistant-wrapper #mycred-ai-chat-input {
	 scrollbar-width: none;
	 -ms-overflow-style: none;
 }
 
 .mycred-ai-assistant-wrapper .mycred-ai-chat-messages::-webkit-scrollbar,
 .mycred-ai-assistant-wrapper #mycred-ai-chat-input::-webkit-scrollbar {
	 display: none;
 }
 
 @media (max-width: 960px) {
	 .mycred-ai-assistant-wrapper {
		 min-height: 0;
	 }
 
	 .mycred-ai-page {
		 padding: 12px 12px 0;
	 }
 
	 .mycred-ai-shell {
		 flex: initial;
		 min-height: 0;
		 padding: 16px;
	 }
 
	 .mycred-ai-shell[data-mode="empty"] {
		 padding: 32px 16px;
		 gap: 0;
	 }
 
	 .mycred-ai-shell[data-mode="empty"] .mycred-ai-composer-slot {
		 margin-top: 48px;
	 }
 
	 #mycred-ai-chat-input {
		 min-height: 64px;
	 }
 
	 .mycred-ai-empty-greeting {
		 font-size: 22px;
	 }
 
	 .mycred-ai-empty-lede {
		 font-size: 18px;
	 }
 }
 
 @media (max-width: 720px) {
	 .mycred-ai-prompt-cards {
		 grid-template-columns: 1fr;
	 }
 
	 .mycred-ai-chips li:nth-child(n + 4) {
		 display: none;
	 }
 
	 .mycred-ai-msg-user {
		 max-width: 90%;
	 }
 }
 
 @media (prefers-reduced-motion: reduce) {
	 .mycred-ai-typing-indicator span {
		 animation: none;
		 opacity: 0.6;
	 }
 }
 