/* ============================================================
   ISHRAE AI Mode — Main Page Styles
   Theme: Light/Dark with #1e40af accent
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
    --bg-primary:       #ffffff;
    --bg-secondary:     #f5f6f8;
    --bg-card:          #ffffff;
    --bg-input:         #f8f9fa;
    --bg-hover:         #f0f1f3;
    --text-primary:     #111111;
    --text-secondary:   #555555;
    --text-muted:       #9ca3af;
    --accent:           #1e40af;
    --accent-hover:     #2563eb;
    --accent-dark:      #1e3a8a;
    --accent-text:      #ffffff;
    --border:           #e8eaed;
    --border-light:     #f1f3f5;
    --shadow-sm:        0 1px 4px rgba(0,0,0,0.06);
    --shadow-md:        0 4px 18px rgba(0,0,0,0.09);
    --shadow-lg:        0 8px 36px rgba(0,0,0,0.12);
    --chat-user-bg:     #1e40af;
    --chat-user-text:   #ffffff;
    --chat-ai-bg:       #f0f1f3;
    --chat-ai-text:     #111111;
    --header-bg:        #ffffff;
    --sidebar-bg:       #f8f9fa;
    --radius:           14px;
    --radius-sm:        9px;
    --radius-xs:        5px;
    --transition:       all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height:    68px;
    --font:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
    --bg-primary:     #0d0d0d;
    --bg-secondary:   #141414;
    --bg-card:        #1c1c1c;
    --bg-input:       #1e1e1e;
    --bg-hover:       #252525;
    --text-primary:   #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted:     #555555;
    --accent:         #3b82f6;
    --accent-hover:   #60a5fa;
    --accent-dark:    #2563eb;
    --accent-text:    #ffffff;
    --border:         #2a2a2a;
    --border-light:   #1e1e1e;
    --shadow-sm:      0 1px 4px rgba(0,0,0,0.35);
    --shadow-md:      0 4px 18px rgba(0,0,0,0.5);
    --shadow-lg:      0 8px 36px rgba(0,0,0,0.65);
    --chat-user-bg:   #3b82f6;
    --chat-user-text: #ffffff;
    --chat-ai-bg:     #1e1e1e;
    --chat-ai-text:   #f0f0f0;
    --header-bg:      #0d0d0d;
    --sidebar-bg:     #111111;
}

/* ── Base Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.35s ease, color 0.35s ease;
    height: 100vh;
    overflow: hidden;
}

/* ── Scrollbar Styling ── */
::-webkit-scrollbar        { width: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   HEADER
   ============================================================ */
.ai-header {
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: relative;
    z-index: 100;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-badge i { font-size: 10px; }

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
    transform: rotate(15deg);
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
    flex-shrink: 0;
}

.header-icon-btn:hover {
    background: rgba(30,64,175,0.08);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.header-icon-btn.danger:hover {
    background: rgba(239,68,68,0.08);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-back:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.ai-main {
    height: calc(100vh - var(--header-height));
    display: flex;
    overflow: hidden;
}

/* ── Chat Panel (Right) ── */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: var(--bg-primary);
    min-width: 0;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

/* ── Scroll to Bottom Button ── */
.scroll-bottom-btn {
    position: absolute;
    bottom: 110px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 50;
}

.scroll-bottom-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}


/* ── Typing Cursor ── */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--text-primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blinkCursor 0.7s steps(1) infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Welcome Screen ── */
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    text-align: center;
}

.chat-welcome.hidden { display: none; }

.welcome-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(30,64,175,0.4), 0 0 0 4px rgba(30,64,175,0.15);
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.welcome-avatar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(30,64,175,0.4);
    animation: pulse-ring 2.5s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%       { transform: scale(1.08); opacity: 0.15; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 420px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.welcome-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 480px;
}

.starter-chip {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.starter-chip:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-text);
    transform: translateY(-1px);
}

/* ── Chat Messages Area ── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-primary);
}

/* ── Message Row ── */
.message {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: 6px 0;
    animation: fadeUp 0.25s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── AI Message — full-width row with light tint ── */
.message-assistant {
    background: var(--msg-ai-row);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 20px 0;
    align-self: stretch;
    width: 100%;
}

:root {
    --msg-ai-row: rgba(30,64,175,0.025);
}
[data-theme="dark"] {
    --msg-ai-row: rgba(255,255,255,0.02);
}

/* ── User Message — right aligned ── */
.message-user {
    justify-content: flex-end;
    padding: 16px 28px;
    align-self: stretch;
}

/* ── Inner content wrapper (constrains width) ── */
.message-inner {
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.message-user .message-inner {
    padding: 0;
    max-width: 100%;
    margin: 0;
    justify-content: flex-end;
}

/* ── Avatars ── */
.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.message-avatar-ai {
    background: #0277bd;
    color: #badc58;
    box-shadow: 0 2px 8px rgba(2,119,189,0.35);
}

.message-avatar-user {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--accent-text);
    box-shadow: 0 2px 8px rgba(30,64,175,0.35);
}

/* ── Bubble content ── */
.message-bubble {
    flex: 1;
    max-width: 100%;
    word-break: break-word;
    line-height: 1.7;
}

/* Links inside AI responses */
.ai-link {
    color: var(--accent-dark);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(30,64,175,0.4);
    word-break: break-all;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ai-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-dark);
}

[data-theme="dark"] .ai-link {
    color: var(--accent);
    border-bottom-color: rgba(30,64,175,0.35);
}

[data-theme="dark"] .ai-link:hover {
    color: #fff;
    border-bottom-color: var(--accent);
}

/* AI bubble — no bubble at all, just clean text */
.message-bubble-ai {
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    border: none;
    box-shadow: none;
}

/* User bubble — compact pill */
.message-bubble-user {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--accent-text);
    padding: 11px 18px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 12px rgba(30,64,175,0.3);
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 520px;
    flex: none;
}

.message-bubble-user .message-text,
.message-bubble-user .message-time {
    color: #ffffff;
}

[data-theme="dark"] .message-bubble-user,
[data-theme="dark"] .message-bubble-user .message-text,
[data-theme="dark"] .message-bubble-user .message-time {
    color: #ffffff;
}

/* ── AI sender label ── */
.message-sender {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

/* ── Message text ── */
.message-text {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-primary);
}

.message-text p { margin-bottom: 10px; }
.message-text p:last-child { margin-bottom: 0; }
.message-text strong { font-weight: 600; color: var(--text-primary); }
.message-text ul,
.message-text ol {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-text .ai-list li {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 9px 13px;
    line-height: 1.65;
    font-size: 14px;
    margin-bottom: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.message-text .ai-list li:hover {
    background: rgba(30,64,175,0.05);
    border-color: var(--border);
    border-left-color: var(--accent-dark);
}

[data-theme="dark"] .message-text .ai-list li {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
    border-left-color: var(--accent);
}
.message-text a {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Timestamp ── */
.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.6;
}

.message-user .message-time {
    text-align: right;
    padding-right: 2px;
    margin-top: 5px;
}

/* ── Message Footer (time + actions) ── */
.msg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}

.msg-footer .message-time { margin-top: 0; }

.message-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-assistant:hover .message-actions { opacity: 1; }

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s ease;
    font-family: var(--font);
    padding: 0;
}

.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: rgba(30,64,175,0.08);
}

.action-btn.active-up {
    background: rgba(34,197,94,0.12);
    border-color: #22c55e;
    color: #22c55e;
}

.action-btn.active-down {
    background: rgba(239,68,68,0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* ── Related Questions ── */
.related-qs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 7px;
    padding: 14px 28px 18px calc(28px + 48px);
    max-width: 780px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.related-qs-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    margin-bottom: 2px;
}

.related-qs-label i { color: var(--accent); }

.related-q-chip {
    padding: 6px 13px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    line-height: 1.4;
}

.related-q-chip:hover {
    border-color: var(--accent);
    background: rgba(30,64,175,0.08);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ── History Banner ── */
.history-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    width: 100%;
}

.history-banner i { color: var(--accent-dark); font-size: 14px; flex-shrink: 0; }

.history-banner span {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 100px;
}

.history-btn-continue {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.history-btn-continue:hover { background: var(--accent-hover); }

.history-btn-new {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.history-btn-new:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* ── Typing Indicator ── */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: typingBounce 1.4s ease-in-out infinite;
    opacity: 0.7;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%           { transform: translateY(-8px); opacity: 1; }
}

/* ── Inquiry Form inside Chat ── */
.inquiry-form-bubble {
    max-width: 500px;
    padding: 0;
}

.inquiry-form-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.inquiry-form-header i {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--accent-text);
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.inquiry-form-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* Form card container */
.inquiry-form {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

[data-theme="dark"] .inquiry-form {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.07);
}

/* Inputs & select */
.inquiry-form .form-control,
.inquiry-form .form-select {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    border-radius: 10px;
    padding: 10px 14px;
    height: auto;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.inquiry-form .form-control:focus,
.inquiry-form .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(247, 200, 18, 0.15);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
}

.inquiry-form .form-control::placeholder {
    color: var(--text-muted);
    font-size: 13px;
    opacity: 1;
}

/* Custom select arrow */
.inquiry-form .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

.inquiry-form .form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Dark mode overrides */
[data-theme="dark"] .inquiry-form .form-control,
[data-theme="dark"] .inquiry-form .form-select {
    background: var(--bg-input);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

[data-theme="dark"] .inquiry-form .form-control:focus,
[data-theme="dark"] .inquiry-form .form-select:focus {
    background: var(--bg-input);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(247, 200, 18, 0.12);
}

[data-theme="dark"] .inquiry-form .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23555555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-color: var(--bg-input);
}

[data-theme="dark"] .inquiry-form .form-select option {
    background: var(--bg-card);
}

.btn-accent {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    padding: 10px 20px;
    transition: var(--transition);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: var(--accent-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(247, 200, 18, 0.4);
}

.btn-accent:disabled {
    opacity: 0.7;
    transform: none;
}

/* Compact success inside form bubble */
.inquiry-success-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    font-size: 14px;
    font-weight: 600;
    color: #16a34a;
}

.inquiry-success-compact i {
    font-size: 22px;
    flex-shrink: 0;
}

/* Thank-you AI chat bubble */
.ty-bubble {
    border-left-color: #22c55e !important;
    padding: 20px 22px;
    max-width: 420px;
}

.ty-check {
    font-size: 38px;
    color: #22c55e;
    margin-bottom: 10px;
    line-height: 1;
}

.ty-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ty-service-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(30,64,175,0.12);
    border: 1px solid rgba(30,64,175,0.4);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.ty-body {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.ty-body strong {
    color: var(--text-primary);
}

.ty-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ty-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.ty-btn:hover {
    border-color: var(--accent);
    background: rgba(30,64,175,0.08);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ── Suggestions Dropdown ── */
.suggestions-dropdown {
    position: fixed;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 9999;
    display: none;
}

.suggestions-dropdown.visible {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s ease, color 0.1s ease, padding-left 0.1s ease;
    line-height: 1.4;
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item i {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    transition: color 0.1s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding-left: 20px;
}

.suggestion-item:hover i,
.suggestion-item.active i {
    color: var(--accent-dark);
}

.suggestion-highlight {
    font-weight: 700;
    color: var(--accent-dark);
}

/* ── Chat Input Area ── */
.chat-input-area {
    flex-shrink: 0;
    padding: 16px 28px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
}

.chat-input-inner {
    max-width: 720px;
    margin: 0 auto;
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 14px 100px 14px 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.14), 0 2px 16px rgba(0,0,0,0.07);
}

.chat-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font);
    line-height: 1.6;
    resize: none;
    min-height: 52px;
    max-height: 180px;
    padding: 0;
}

.chat-input::placeholder { color: var(--text-muted); }

.mic-btn {
    position: absolute;
    right: 54px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mic-btn:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: rgba(30,64,175,0.08);
}

.mic-btn.recording {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: pulseMic 1.2s ease-in-out infinite;
}

@keyframes pulseMic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    50%       { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.send-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 2px 10px rgba(30,64,175,0.35);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.07);
    box-shadow: 0 4px 16px rgba(30,64,175,0.55);
}

.send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 9px;
    font-size: 11px;
    color: var(--text-muted);
    gap: 4px;
    letter-spacing: 0.1px;
}

.chat-input-footer a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 500;
}

.chat-input-footer a:hover { text-decoration: underline; }

.consult-shortcut {
    background: none;
    border: 1px solid var(--border);
    padding: 2px 9px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.consult-shortcut:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* ============================================================
   SIDEBAR PANEL (Left)
   ============================================================ */
.sidebar-panel {
    width: 300px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    border-right: 1px solid var(--border);
}

/* ── Sidebar Header ── */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    flex-shrink: 0;
}

.sidebar-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-header-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px;
}

.sidebar-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74,222,128,0.3);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(74,222,128,0.3); }
    50%       { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
}

.sidebar-section {
    margin-bottom: 22px;
}

.sidebar-section-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section-title i {
    color: #fff;
    font-size: 10px;
    background: var(--accent);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Service Groups — accordion ── */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.service-group {
    background: transparent;
    border: none;
    border-radius: 0;
    border-left: 2px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s ease;
    margin-left: 2px;
}

.service-group.open {
    border-left-color: var(--accent);
}

/* ── Group header — the accordion toggle button ── */
.service-group-header {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px 9px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    text-align: left;
    transition: background 0.15s ease;
    border-radius: 0 6px 6px 0;
}

.service-group-header:hover {
    background: rgba(30,64,175,0.05);
}

.service-group.open .service-group-header {
    background: rgba(30,64,175,0.07);
}

.group-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(30,64,175,0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.service-group.open .group-icon {
    background: var(--accent);
    color: #fff;
}

.group-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.1px;
    flex: 1;
}

.group-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.service-group.open .group-count {
    background: rgba(30,64,175,0.12);
    color: var(--accent);
}

.group-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.service-group.open .group-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

/* ── Service list — collapsible ── */
.service-group-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.2s ease;
}

.service-group.open .service-group-list {
    max-height: 500px;
    padding: 4px 0 6px 0;
}

/* ── Individual service item ── */
.service-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 7px 10px 7px 12px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.35;
    position: relative;
}

.service-list-item::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.service-list-item i { display: none; }

.service-list-item span { flex: 1; }

.service-list-item:hover {
    background: rgba(30,64,175,0.05);
    color: var(--text-primary);
}

.service-list-item:hover::before {
    background: var(--accent);
}

.service-list-item.active {
    background: rgba(30,64,175,0.08);
    color: var(--accent-dark);
    font-weight: 600;
}

.service-list-item.active::before {
    background: var(--accent);
    width: 6px;
    height: 6px;
}

.service-list-item.active::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    color: var(--accent);
}

/* ── Blog Cards ── */
.blog-card {
    background: transparent;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    padding: 9px 10px 9px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    margin-left: 2px;
    border-radius: 0 6px 6px 0;
}

.blog-card:last-child { margin-bottom: 0; }

.blog-card:hover {
    border-left-color: var(--accent);
    background: rgba(30,64,175,0.05);
}

.blog-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(30,64,175,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--accent);
    flex-shrink: 0;
}

.blog-card-body { flex: 1; min-width: 0; }

.blog-card h6 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-card p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-card-link {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
    flex-shrink: 0;
    transition: var(--transition);
}

.blog-card-link:hover { color: var(--accent-dark); }

/* ── FAQ Items ── */
.faq-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0 6px 6px 0;
    padding: 8px 10px 8px 12px;
    margin-bottom: 3px;
    margin-left: 2px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font);
    transition: all 0.15s ease;
    line-height: 1.5;
}

.faq-item:last-child { margin-bottom: 0; }

.faq-item i {
    color: var(--text-muted);
    margin-top: 3px;
    font-size: 10px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.faq-item:hover {
    background: rgba(30,64,175,0.05);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.faq-item:hover i {
    color: var(--accent);
}

/* ── Quick Topic Chips ── */
.quick-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.topic-chip {
    padding: 7px 14px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}

.topic-chip:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-text);
    transform: translateY(-1px);
}

/* ── Shop Link List (Books / E-Books sidebar) ── */
.shop-link-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shop-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: var(--transition);
}

.shop-link-item:hover {
    border-color: var(--gold);
    background: rgba(245, 196, 0, 0.07);
    color: var(--text-primary);
    transform: translateX(3px);
    text-decoration: none;
}

.shop-link-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(245, 196, 0, 0.12);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: var(--transition);
}

.shop-link-item:hover .shop-link-icon {
    background: var(--gold);
    color: #000;
}

.shop-link-label {
    flex: 1;
    font-size: 12.5px;
}

.shop-link-arrow {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition);
}

.shop-link-item:hover .shop-link-arrow {
    opacity: 1;
    color: var(--gold);
}

/* ── Empty state ── */
.sidebar-empty {
    font-size: 12.5px;
    color: var(--text-muted);
    padding: 8px 0;
    font-style: italic;
}

/* ── Clear Chat Confirmation Modal ── */
.ez-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ez-modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.ez-modal {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    transform: scale(0.88) translateY(16px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 64px rgba(0,0,0,0.22);
}

.ez-modal-overlay.visible .ez-modal {
    transform: scale(1) translateY(0);
}

.ez-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(239,68,68,0.1);
    border: 1.5px solid rgba(239,68,68,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #ef4444;
    margin: 0 auto 18px;
}

.ez-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: var(--font);
}

.ez-modal-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    font-family: var(--font);
}

.ez-modal-actions {
    display: flex;
    gap: 10px;
}

.ez-modal-btn {
    flex: 1;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1.5px solid transparent;
}

.ez-modal-cancel {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-secondary);
}

.ez-modal-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.ez-modal-confirm {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.ez-modal-confirm:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239,68,68,0.4);
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
.mobile-sidebar-toggle {
    display: none;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

@media (max-width: 991.98px) {
    body { overflow: auto; }

    .ai-main {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - var(--header-height));
    }

    .sidebar-panel {
        width: 100%;
        height: auto;
        max-height: 380px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        order: 2;
    }

    .chat-panel {
        height: 75vh;
        min-height: 400px;
        border-left: none;
        border-top: 1px solid var(--border);
        order: 1;
    }

    .sidebar-scroll { max-height: 320px; }

    .services-grid { display: flex; flex-direction: column; }

    .mobile-sidebar-toggle { display: flex; }

    .btn-back span { display: none; }

    .header-badge .badge-text { display: none; }
}

@media (max-width: 575.98px) {
    .ai-header { padding: 0 16px; }
    .chat-messages { padding: 16px; }
    .chat-input-area { padding: 10px 14px 14px; }
    .services-grid { display: flex; flex-direction: column; }
    .chat-panel { height: 70vh; }
    .message { max-width: 95%; }
    .inquiry-form-bubble { max-width: 100%; }
    .welcome-title { font-size: 20px; }
}

/* ============================================================
   RESOURCE CARD — Knowledge Base match UI
   ============================================================ */
:root {
    --gold: #F5C400;
    --gold-dark: #c9a000;
}

.resource-card-bubble { border-left: 3px solid var(--gold) !important; }

.resource-card {
    display: flex;
    gap: 14px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px;
    margin-top: 8px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}
.resource-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.rc-cover {
    flex-shrink: 0;
    width: 70px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-cover-img { width: 100%; height: 100%; object-fit: cover; }

.rc-cover-placeholder {
    color: rgba(255,255,255,0.9);
    font-size: 28px;
}

.rc-body { flex: 1; min-width: 0; }

.rc-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245,196,0,0.15);
    border: 1px solid rgba(245,196,0,0.4);
    color: var(--gold-dark);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 10.5px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

[data-theme="dark"] .rc-type-badge {
    background: rgba(245,196,0,0.1);
    color: var(--gold);
}

.rc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 5px;
}

.rc-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.rc-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    border: none;
}

.rc-btn-url {
    background: var(--accent);
    color: #fff;
}
.rc-btn-url:hover { background: var(--accent-hover); color: #fff; }

.rc-btn-pdf {
    background: transparent;
    color: #dc2626;
    border: 1.5px solid #dc2626;
}
.rc-btn-pdf:hover { background: #dc2626; color: #fff; }

@media (max-width: 480px) {
    .resource-card { flex-direction: column; }
    .rc-cover { width: 100%; height: 120px; }
}

/* ── Person Card (President / Leadership) ── */
.person-card-bubble { border-left: 3px solid var(--gold) !important; }

.person-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 16px;
    margin-top: 8px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}
.person-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.person-photo-wrap {
    flex-shrink: 0;
    width: 100px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    border: 2.5px solid var(--gold);
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(245,196,0,0.25);
}

.person-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.person-photo-fallback {
    color: rgba(255,255,255,0.85);
    font-size: 40px;
    align-items: center;
    justify-content: center;
}

.person-info { flex: 1; min-width: 0; }

.person-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(245,196,0,0.18), rgba(245,196,0,0.08));
    border: 1px solid rgba(245,196,0,0.5);
    color: var(--gold-dark);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 10.5px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
[data-theme="dark"] .person-badge { color: var(--gold); }

.person-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.person-designation {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.person-term {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.person-msg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.person-msg-btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

@media (max-width: 480px) {
    .person-card { flex-direction: column; align-items: center; text-align: center; }
    .person-photo-wrap { width: 110px; height: 120px; }
    .person-badge { margin: 0 auto 8px; }
}

/* ── Action Card (Training / Member Types / Join) ── */
.action-card-bubble { border-left: 3px solid var(--accent) !important; }

.ac-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 10px;
}

/* Links grid (training & join) */
.ac-links-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.ac-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}
.ac-link-item:hover {
    border-color: var(--accent);
    background: rgba(30,64,175,0.05);
    transform: translateX(3px);
}
.ac-link-item.ac-link-primary {
    border-color: var(--accent);
    background: rgba(30,64,175,0.06);
}
[data-theme="dark"] .ac-link-item:hover,
[data-theme="dark"] .ac-link-item.ac-link-primary {
    background: rgba(96,165,250,0.08);
}

.ac-link-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.ac-link-text { flex: 1; min-width: 0; }

.ac-link-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.ac-link-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.ac-link-arrow {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.15s;
}
.ac-link-item:hover .ac-link-arrow { transform: translateX(3px); color: var(--accent); }

/* Member type tabs */
.ac-member-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.ac-member-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.ac-member-tab:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30,64,175,0.3);
}

.ac-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.ac-view-all-btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

@media (max-width: 480px) {
    .ac-member-tab { padding: 6px 11px; font-size: 12px; }
}
