/* ============================================================
   EZ Rankings AI Mode — Main Page Styles
   Theme: Light/Dark with #f7c812 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:           #f7c812;
    --accent-hover:     #e6b800;
    --accent-dark:      #d4a800;
    --accent-text:      #1a1a1a;
    --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:     #f7c812;
    --chat-user-text:   #1a1a1a;
    --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:         #f7c812;
    --accent-hover:   #ffe040;
    --accent-dark:    #e6b800;
    --accent-text:    #0d0d0d;
    --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:   #f7c812;
    --chat-user-text: #0d0d0d;
    --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(247,200,18,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 (Left) ── */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 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, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 4px rgba(247,200,18,0.2);
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.welcome-avatar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(247,200,18,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(247,200,18,0.03);
}
[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: linear-gradient(135deg, #1e293b, #0f172a);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.message-avatar-user {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--accent-text);
    box-shadow: 0 2px 8px rgba(247,200,18,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(212,168,0,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(247,200,18,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), #f0c000);
    color: var(--accent-text);
    padding: 11px 18px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 12px rgba(247,200,18,0.3);
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 520px;
    flex: none;
}

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

/* ── 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(247,200,18,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);
}

/* Numbered list variant */
.message-text .ai-list-ol {
    list-style: none;
    counter-reset: ai-ol;
}

.message-text .ai-list-ol li {
    counter-increment: ai-ol;
    padding-left: 2.4em;
    position: relative;
}

.message-text .ai-list-ol li::before {
    content: counter(ai-ol);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* Service section headings inside AI bubbles */
.message-text .ai-heading {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 16px 0 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    letter-spacing: 0.01em;
}

.message-text .ai-heading:first-child {
    margin-top: 4px;
}

.message-text .ai-subheading {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 10px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

[data-theme="dark"] .message-text .ai-heading {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

[data-theme="dark"] .message-text .ai-subheading {
    color: var(--text-secondary);
}
.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(247,200,18,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(247,200,18,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(247,200,18,0.12);
    border: 1px solid rgba(247,200,18,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(247,200,18,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(247,200,18,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(247,200,18,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(247,200,18,0.35);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.07);
    box-shadow: 0 4px 16px rgba(247,200,18,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 (Right)
   ============================================================ */
.sidebar-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    border-left: 1px solid var(--border);
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

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

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

.sidebar-section-title i {
    color: var(--accent);
    font-size: 11px;
    background: rgba(247,200,18,0.12);
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.service-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.service-group.open {
    border-color: rgba(247,200,18,0.5);
    box-shadow: 0 2px 12px rgba(247,200,18,0.1);
}

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

.service-group-header:hover {
    background: var(--bg-hover);
}

.service-group.open .service-group-header {
    background: linear-gradient(90deg, rgba(247,200,18,0.08), transparent);
    border-bottom: 1px solid var(--border);
}

.group-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.service-group.open .group-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 2px 8px rgba(247,200,18,0.4);
}

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

.group-count {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1px 7px;
    border-radius: 20px;
    letter-spacing: 0;
    min-width: 22px;
    text-align: center;
}

.service-group.open .group-count {
    background: rgba(247,200,18,0.12);
    border-color: rgba(247,200,18,0.4);
    color: var(--accent-dark);
}

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

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

/* ── Service list — collapsible ── */
.service-group-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px;
    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: 6px;
}

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

.service-list-item::before {
    content: '';
    width: 5px;
    height: 5px;
    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: var(--bg-hover);
    color: var(--text-primary);
    padding-left: 14px;
}

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

.service-list-item.active {
    background: rgba(247,200,18,0.12);
    color: var(--text-primary);
    font-weight: 600;
    padding-left: 14px;
}

.service-list-item.active::before {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(247,200,18,0.22);
}

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

/* ── Blog Cards ── */
.blog-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

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

.blog-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.blog-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(247, 200, 18, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--accent-dark);
    flex-shrink: 0;
}

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

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

.blog-card p {
    font-size: 11.5px;
    color: var(--text-secondary);
    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: 10px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 2px;
    cursor: pointer;
    font-size: 12.5px;
    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: 11px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.faq-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding-left: 14px;
}

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

/* ── 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);
}

/* ── 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));
    }

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

    .sidebar-panel {
        width: 100%;
        height: auto;
        max-height: 400px;
    }

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

    .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; }
}

/* ============================================================
   WEBSITE AUDIT REPORT
   ============================================================ */

/* ── Scan indicator ── */
.audit-scan-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 2px;
}

.audit-scan-spinner {
    font-size: 22px;
    color: var(--accent);
    animation: auditSpin 1.4s linear infinite;
}

@keyframes auditSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.audit-scan-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13.5px;
}

.audit-scan-text strong { color: var(--text-primary); }
.audit-scan-text span   { color: var(--text-muted); font-size: 12px; }

/* ── Report wrapper ── */
.audit-report {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 13px;
    line-height: 1.6;
}

/* ── Header ── */
.ar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid var(--border);
}

.ar-header-left {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
}

.ar-header-icon {
    width: 38px;
    height: 38px;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ar-header-info { min-width: 0; }

.ar-domain {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ar-url {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
    transition: color 0.15s;
}
.ar-url:hover { color: var(--accent-dark); }

.ar-timestamp {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ── Grade badge ── */
.ar-grade {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.18);
    letter-spacing: -0.5px;
}

/* ── Score rings ── */
.ar-scores-row {
    display: flex;
    gap: 18px;
    justify-content: center;
    padding: 4px 0;
}

.ar-score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.ar-ring {
    --pct: 0;
    --sc: #22c55e;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: conic-gradient(var(--sc) calc(var(--pct) * 1%), var(--border) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.ar-ring::after {
    content: '';
    position: absolute;
    inset: 8px;
    background: var(--bg-card);
    border-radius: 50%;
}

[data-theme="dark"] .ar-ring::after { background: var(--bg-card); }

.ar-ring-num {
    position: relative;
    z-index: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.ar-ring-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Meta chips ── */
.ar-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ar-chip {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ar-chip-good { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #16a34a; }
.ar-chip-bad  { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #dc2626; }

[data-theme="dark"] .ar-chip-good { color: #4ade80; }
[data-theme="dark"] .ar-chip-bad  { color: #f87171; }

/* ── Sections ── */
.ar-section { display: flex; flex-direction: column; gap: 8px; }

.ar-section-hd {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 5px;
    border-bottom: 1.5px solid var(--border);
}

.ar-section-count {
    margin-left: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
}

/* ── Issues ── */
.ar-issues-list { display: flex; flex-direction: column; gap: 6px; }

.ar-issue {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 12.5px;
    line-height: 1.5;
}

.ar-issue-high {
    background: rgba(239,68,68,0.05);
    border-color: rgba(239,68,68,0.2);
}

.ar-issue-med {
    background: rgba(245,158,11,0.05);
    border-color: rgba(245,158,11,0.2);
}

[data-theme="dark"] .ar-issue-high { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); }
[data-theme="dark"] .ar-issue-med  { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); }

.ar-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    margin-top: 1px;
}

.ar-badge-high { background: #fee2e2; color: #dc2626; }
.ar-badge-med  { background: #fef3c7; color: #d97706; }

[data-theme="dark"] .ar-badge-high { background: rgba(220,38,38,0.2); color: #f87171; }
[data-theme="dark"] .ar-badge-med  { background: rgba(217,119,6,0.2);  color: #fbbf24; }

.ar-issue-text { color: var(--text-secondary); }
.ar-issue-text strong { color: var(--text-primary); font-weight: 600; }

/* ── Check rows ── */
.ar-checks-list { display: flex; flex-direction: column; gap: 1px; }

.ar-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.15s;
}

.ar-check-row:hover { background: var(--bg-hover); }

.chk-good { border-color: transparent; }
.chk-warn { border-color: transparent; }
.chk-err  { border-color: transparent; }

.ar-check-icon {
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.chk-good .ar-check-icon { color: #22c55e; }
.chk-warn .ar-check-icon { color: #f59e0b; }
.chk-err  .ar-check-icon { color: #ef4444; }

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

.ar-check-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.ar-check-val {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin: 1px 0;
    word-break: break-all;
}

.ar-check-msg {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Strengths ── */
.ar-strengths {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ar-strength-chip {
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.25);
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

[data-theme="dark"] .ar-strength-chip {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.2);
    color: #4ade80;
}

/* ── CTA ── */
.ar-cta {
    background: linear-gradient(135deg, rgba(247,200,18,0.12) 0%, rgba(247,200,18,0.04) 100%);
    border: 1.5px solid rgba(247,200,18,0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.ar-cta-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 11px;
}

.ar-cta-text strong { color: var(--text-primary); }

.ar-cta-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
}

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

/* ── Audit disclaimer ── */
.ar-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 7px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    gap: 7px;
    align-items: flex-start;
}

.ar-disclaimer i { margin-top: 1px; flex-shrink: 0; font-size: 12px; }
.ar-disclaimer strong { color: var(--text-secondary); }

/* ── Section headings inside AI messages (service replies) ── */
.message-text h5.ai-heading {
    display: block;
}

/* ── Info check row ── */
.chk-info .ar-check-icon { color: #3b82f6; }

[data-theme="dark"] .chk-info .ar-check-icon { color: #60a5fa; }

/* ── Priority Actions box ── */
.ar-priority-box {
    background: linear-gradient(135deg, rgba(239,68,68,0.06) 0%, rgba(245,158,11,0.04) 100%);
    border: 1.5px solid rgba(239,68,68,0.22);
    border-radius: 12px;
    padding: 13px 14px;
}

[data-theme="dark"] .ar-priority-box {
    background: rgba(239,68,68,0.07);
    border-color: rgba(239,68,68,0.25);
}

.ar-priority-hd {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #dc2626;
    margin-bottom: 10px;
}

[data-theme="dark"] .ar-priority-hd { color: #f87171; }

.ar-priority-hd i { font-size: 11px; }

.ar-priority-list { display: flex; flex-direction: column; gap: 8px; }

.ar-priority-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ar-priority-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

[data-theme="dark"] .ar-priority-num { background: #b91c1c; }

.ar-priority-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.ar-priority-msg {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 1px;
}

/* ── Action buttons row ── */
.ar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1.5px solid;
    transition: all 0.15s ease;
    line-height: 1;
}

.ar-btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-secondary);
}

.ar-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

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

.ar-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(247,200,18,0.35);
}

/* ── Email form ── */
.ar-email-form {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ar-email-input {
    flex: 1;
    min-width: 180px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s ease;
}

.ar-email-input:focus { border-color: var(--accent); }
.ar-email-input::placeholder { color: var(--text-muted); }

[data-theme="dark"] .ar-email-input {
    background: var(--bg-input);
    border-color: rgba(255,255,255,0.1);
}

/* ── Email success ── */
.ar-email-success {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #16a34a;
    padding: 6px 0;
}

.ar-email-success i { font-size: 16px; }

[data-theme="dark"] .ar-email-success { color: #4ade80; }

/* ── Print styles ── */
@media print {
    .ar-actions,
    .ar-email-form,
    .ar-email-success,
    .ar-cta-btn {
        display: none !important;
    }

    .audit-report {
        font-size: 12px;
    }

    .ar-ring {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Compact audit report on very small screens */
@media (max-width: 480px) {
    .ar-scores-row { gap: 12px; }
    .ar-ring { width: 64px; height: 64px; }
    .ar-ring-num { font-size: 15px; }
    .ar-grade { width: 44px; height: 44px; font-size: 16px; }
    .ar-domain { font-size: 13px; }
    .ar-actions { gap: 6px; }
    .ar-btn { padding: 6px 11px; font-size: 12px; }
}
