/* ============================================================
   ANVO LegalAI — chat-pro-style.css
   Aesthetic: Dark judicial + editorial gold. Refined legal authority.
   ============================================================ */

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
    --bg:            #08100d;
    --surface:       #0d1a14;
    --surface-2:     #111f17;
    --border:        rgba(255,255,255,0.07);
    --border-bright: rgba(255,255,255,0.12);

    --gold:          #c9a84c;
    --gold-dim:      rgba(201,168,76,0.12);
    --gold-glow:     rgba(201,168,76,0.22);

    --text:          #d8e0db;
    --text-muted:    #5e7068;
    --text-dim:      #3a4e41;

    --citizen:       #4ade80;
    --learner:       #60a5fa;
    --lawyer:        #c9a84c;

    --sidebar-w:     270px;
    --header-h:      60px;
    --radius:        14px;
    --radius-sm:     8px;
    --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* ── GRAIN CANVAS ─────────────────────────────────────────── */
#grainCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.025;
}

/* ── APP SHELL ─────────────────────────────────────────────── */
.app-shell {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition), margin var(--transition);
    overflow: hidden;
    z-index: 100;
}

.sidebar.collapsed {
    width: 0;
}

.sidebar-inner {
    width: var(--sidebar-w);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    gap: 20px;
    overflow: hidden;
}

/* Mobile: slide-over */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: var(--sidebar-w);
        transform: translateX(calc(-1 * var(--sidebar-w)));
        transition: transform var(--transition);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 12px 0 40px rgba(0,0,0,0.6);
    }
    .sidebar.collapsed { width: var(--sidebar-w); } /* override desktop collapsed for mobile */
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ── LOGO ──────────────────────────────────────────────────── */
.logo-mark {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 0;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: transparent;   /* remove the gold tinted background */
    border: none;               /* remove the border */
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.logo-name {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    color: var(--gold);
    letter-spacing: 0.05em;
    line-height: 1;
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* If you replace with an actual image */
.logo-image {
    height: 38px;
    width: 38px;
    object-fit: cover;
    border-radius: 10px;        /* rounded corners */
}

/* ── NEW CHAT BUTTON ───────────────────────────────────────── */
.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gold-dim);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    letter-spacing: 0.02em;
}
.new-chat-btn:hover {
    background: rgba(201,168,76,0.2);
    border-color: rgba(201,168,76,0.5);
}
.new-chat-btn svg { flex-shrink: 0; }

/* ── HISTORY ────────────────────────────────────────────────── */
.history-section { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

.history-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 10px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 10px; }

.history-item {
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
}
.history-item:hover, .history-item.active {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

/* ── SIDEBAR FOOTER ─────────────────────────────────────────── */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.jurisdiction-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-chip {
    width: 30px;
    height: 30px;
    background: var(--gold-dim);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold);
    flex-shrink: 0;
}

.u-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}
.u-status {
    display: block;
    font-size: 0.68rem;
    color: var(--citizen);
    letter-spacing: 0.03em;
}

/* ── MAIN AREA ──────────────────────────────────────────────── */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: radial-gradient(ellipse 80% 60% at 70% 0%, rgba(201,168,76,0.04) 0%, transparent 60%), var(--bg);
    position: relative;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.workspace-header {
    height: var(--header-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: rgba(8,16,13,0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4.5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger:hover span { background: var(--gold); }

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

.brand-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gold);
    background: var(--gold-dim);
    border: 1px solid rgba(201,168,76,0.25);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.corpus-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 600px) { .corpus-label { display: none; } }

.exit-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: 0.02em;
}
.exit-link:hover { color: var(--text); }

/* ── MESSAGES CONTAINER ─────────────────────────────────────── */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px 0 200px;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar { width: 4px; }
.messages-container::-webkit-scrollbar-track { background: transparent; }
.messages-container::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 10px; }

/* Center content */
.welcome-screen, .message-row {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ── WELCOME SCREEN ─────────────────────────────────────────── */
.welcome-screen {
    padding-top: 48px;
    text-align: center;
    animation: fadeUp 0.5s ease forwards;
}

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

.welcome-emblem {
    display: inline-flex;
    width: 72px;
    height: 72px;
    background: var(--gold-dim);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.welcome-heading {
    font-family: 'DM Serif Display', serif;
    font-size: 2.1rem;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.welcome-sub {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 520px;
    margin: 0 auto 36px;
}

.suggested-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
}

@media (max-width: 600px) { .suggested-grid { grid-template-columns: 1fr; } }

.suggest-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    color: var(--text-muted);
    font-size: 0.87rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}
.suggest-card:hover {
    border-color: rgba(201,168,76,0.3);
    background: var(--surface-2);
    color: var(--text);
    transform: translateY(-1px);
}

.suggest-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    font-family: 'JetBrains Mono', monospace;
}

/* ── MESSAGES ────────────────────────────────────────────────── */
.message-row {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
    animation: fadeUp 0.35s ease forwards;
}

.message-row.user { flex-direction: row-reverse; }

.msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.message-row.bot .msg-avatar {
    background: var(--gold-dim);
    border: 1px solid rgba(201,168,76,0.25);
    font-size: 14px;
}

.message-row.user .msg-avatar {
    background: rgba(74,222,128,0.12);
    border: 1px solid rgba(74,222,128,0.25);
    color: var(--citizen);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
}

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

.msg-mode-tag {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.msg-content {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
}

.message-row.user .msg-content {
    background: rgba(74,222,128,0.07);
    border: 1px solid rgba(74,222,128,0.15);
    color: #c5ddc9;
}

.message-row.bot .msg-content {
    background: var(--surface);
    border: 1px solid var(--border);
}

/* Markdown in bot messages */
.message-row.bot .msg-content h1,
.message-row.bot .msg-content h2,
.message-row.bot .msg-content h3 {
    font-family: 'DM Serif Display', serif;
    color: var(--gold);
    margin: 18px 0 8px;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.message-row.bot .msg-content h1:first-child,
.message-row.bot .msg-content h2:first-child { margin-top: 0; }

.message-row.bot .msg-content strong {
    color: rgba(201,168,76,0.85);
    font-weight: 600;
}

.message-row.bot .msg-content em { color: var(--text-muted); }

.message-row.bot .msg-content p { margin-bottom: 10px; }
.message-row.bot .msg-content p:last-child { margin-bottom: 0; }

.message-row.bot .msg-content ul,
.message-row.bot .msg-content ol {
    padding-left: 20px;
    margin-bottom: 10px;
}
.message-row.bot .msg-content li { margin-bottom: 5px; }

.message-row.bot .msg-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--gold);
}

.message-row.bot .msg-content pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-row.bot .msg-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    margin: 14px 0;
}

.message-row.bot .msg-content th {
    background: var(--surface-2);
    border: 1px solid var(--border-bright);
    padding: 8px 12px;
    text-align: left;
    color: var(--gold);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.message-row.bot .msg-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    color: var(--text-muted);
    vertical-align: top;
}

.message-row.bot .msg-content blockquote {
    border-left: 3px solid var(--gold);
    padding-left: 14px;
    color: var(--text-muted);
    font-style: italic;
    margin: 12px 0;
}

.message-row.bot .msg-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* Mode indicator on user message */
.mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 5px;
}
.mode-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.citizen-dot  { background: var(--citizen); box-shadow: 0 0 6px var(--citizen); }
.learner-dot  { background: var(--learner); box-shadow: 0 0 6px var(--learner); }
.lawyer-dot   { background: var(--lawyer);  box-shadow: 0 0 6px var(--lawyer);  }

/* ── SKELETON LOADING ────────────────────────────────────────── */
.skeleton-message {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 28px;
}

.skeleton-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-2);
    flex-shrink: 0;
    margin-top: 2px;
    animation: shimmer 1.6s ease-in-out infinite;
}

.skeleton-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 13px;
    border-radius: 6px;
    background: var(--surface-2);
    animation: shimmer 1.6s ease-in-out infinite;
}
.skeleton-line:nth-child(1) { width: 92%; animation-delay: 0s; }
.skeleton-line:nth-child(2) { width: 78%; animation-delay: 0.1s; }
.skeleton-line:nth-child(3) { width: 85%; animation-delay: 0.2s; }
.skeleton-line:nth-child(4) { width: 60%; animation-delay: 0.3s; }
.skeleton-line:nth-child(5) { width: 73%; animation-delay: 0.15s; }

.skeleton-block {
    height: 80px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    animation: shimmer 1.6s ease-in-out infinite;
    animation-delay: 0.25s;
    margin-top: 4px;
}

@keyframes shimmer {
    0%   { opacity: 0.4; }
    50%  { opacity: 0.8; }
    100% { opacity: 0.4; }
}

/* ── INPUT ZONE ──────────────────────────────────────────────── */
.input-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 0 28px;
    background: linear-gradient(transparent 0%, rgba(8,16,13,0.85) 30%, var(--bg) 60%);
    pointer-events: none;
}

.input-stage {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: all;
}

/* ============================================================
   anvo-cards.css
   Styles for <anvo-*> tag rendered card components.
   Import this alongside chat-pro-style.css
   ============================================================ */

/* ── BASE CARD ────────────────────────────────────────────────── */
.anvo-response {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.anvo-card {
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    animation: cardIn 0.3s ease forwards;
}

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

.anvo-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
}

.anvo-card__icon {
    font-size: 0.9rem;
    line-height: 1;
}

.anvo-card__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.anvo-card__body {
    padding: 13px 16px;
    font-size: 0.91rem;
    line-height: 1.7;
    color: var(--text);
}

/* ── PLAIN FALLBACK ───────────────────────────────────────────── */
.anvo-plain {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    padding: 10px 0;
}

/* ── CARD VARIANTS ────────────────────────────────────────────── */

/* ALERT — Urgent crimson pop */
/* ── PLAIN FALLBACK ───────────────────────────────────────────── */
.anvo-plain {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    padding: 10px 0;
}

/* ── REFINED HIGH-CONTRAST CARD VARIANTS ─────────────────────── */

/* ALERT — Urgent crimson pop */
.anvo-card--alert {
    border-color: rgba(239, 68, 68, 0.45);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(13, 26, 20, 0.85) 100%);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.05);
}
.anvo-card--alert .anvo-card__header {
    background: rgba(239, 68, 68, 0.18);
    border-bottom-color: rgba(239, 68, 68, 0.3);
}
.anvo-card--alert .anvo-card__label { color: #fca5a5; font-weight: 700; }
.anvo-card--alert .anvo-card__body  { color: #ffe4e4; }

/* ANSWER — Pure gold prominent card */
.anvo-card--answer {
    border-color: rgba(201, 168, 76, 0.55);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15) 0%, rgba(17, 31, 23, 0.9) 100%);
    box-shadow: 0 6px 24px rgba(201, 168, 76, 0.06);
}
.anvo-card--answer .anvo-card__header {
    background: rgba(201, 168, 76, 0.2);
    border-bottom-color: rgba(201, 168, 76, 0.3);
}
.anvo-card--answer .anvo-card__label { color: #f0d687; font-weight: 700; }
.anvo-card--answer .anvo-card__body  {
    font-size: 1rem;
    color: #f5eed3;
}

/* RIGHTS — Vibrant green guard rails */
.anvo-card--rights {
    border-color: rgba(74, 222, 128, 0.4);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.12) 0%, rgba(13, 26, 20, 0.85) 100%);
}
.anvo-card--rights .anvo-card__header {
    background: rgba(74, 222, 128, 0.14);
    border-bottom-color: rgba(74, 222, 128, 0.25);
}
.anvo-card--rights .anvo-card__label { color: #86efac; font-weight: 700; }

/* WARNING — Vivid warning gold */
.anvo-card--warning {
    border-color: rgba(251, 191, 36, 0.45);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(13, 26, 20, 0.85) 100%);
}
.anvo-card--warning .anvo-card__header {
    background: rgba(251, 191, 36, 0.15);
    border-bottom-color: rgba(251, 191, 36, 0.25);
}
.anvo-card--warning .anvo-card__label { color: #fde047; font-weight: 700; }

/* STEPS — Bright active blueprint blue */
.anvo-card--steps {
    border-color: rgba(96, 165, 250, 0.4);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(13, 26, 20, 0.85) 100%);
}
.anvo-card--steps .anvo-card__header {
    background: rgba(96, 165, 250, 0.12);
    border-bottom-color: rgba(96, 165, 250, 0.25);
}
.anvo-card--steps .anvo-card__label { color: #93c5fd; font-weight: 700; }

/* HELP — Deep clean teal focus */
.anvo-card--help {
    border-color: rgba(45, 212, 191, 0.4);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.1) 0%, rgba(13, 26, 20, 0.85) 100%);
}
.anvo-card--help .anvo-card__header {
    background: rgba(45, 212, 191, 0.12);
    border-bottom-color: rgba(45, 212, 191, 0.25);
}
.anvo-card--help .anvo-card__label { color: #5eead4; font-weight: 700; }

/* LAW — Refined legal framework purple */
.anvo-card--law {
    border-color: rgba(167, 139, 250, 0.35);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08) 0%, var(--surface) 100%);
}
.anvo-card--law .anvo-card__header {
    background: rgba(167, 139, 250, 0.12);
    border-bottom-color: rgba(167, 139, 250, 0.2);
}
.anvo-card--law .anvo-card__label { color: #c084fc; font-weight: 700; }

/* DOCTRINE — Analytical Slate */
.anvo-card--doctrine {
    border-color: rgba(148, 163, 184, 0.4);
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, var(--surface) 100%);
}
.anvo-card--doctrine .anvo-card__header { background: var(--surface-2); }
.anvo-card--doctrine .anvo-card__label { color: #cbd5e1; font-weight: 700; }

/* HISTORY — Antique Terracotta */
.anvo-card--history {
    border-color: rgba(249, 115, 22, 0.35);
    background: linear-gradient(135deg, rgba(249, 115, 橙, 0.08) 0%, var(--surface) 100%);
}
.anvo-card--history .anvo-card__header {
    background: rgba(249, 115, 22, 0.12);
    border-bottom-color: rgba(249, 115, 22, 0.2);
}
.anvo-card--history .anvo-card__label { color: #ffedd5; font-weight: 700; }

/* PROCEDURE — Polished Steel Blueprint */
.anvo-card--procedure {
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, var(--surface) 100%);
}
.anvo-card--procedure .anvo-card__header { background: var(--surface-2); }
.anvo-card--procedure .anvo-card__label { color: #7dd3fc; font-weight: 700; }

/* TABLE & FLAGS */
.anvo-card--table { border-color: rgba(201, 168, 76, 0.25); background: var(--surface-2); }
.anvo-card--table .anvo-card__label { color: #e2e8f0; font-weight: 700; }

.anvo-card--flag {
    border-color: rgba(249, 115, 22, 0.4);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(13, 26, 20, 0.85) 100%);
}
.anvo-card--flag .anvo-card__header { background: rgba(249, 115, 22, 0.12); }
.anvo-card--flag .anvo-card__label { color: #fdba74; font-weight: 700; }

/* ── MARKDOWN ENGINE STYLING FIXES ───────────────────────────── */
.anvo-card__body strong { 
    color: #ffffff !important; 
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
}

/* Force bullet rendering against CSS Resets */
.anvo-card__body ul {
    list-style-type: disc !important;
    padding-left: 22px !important;
    margin: 8px 0 !important;
}
.anvo-card__body ul li {
    display: list-item !important;
    margin-bottom: 6px;
    color: #e2e8f0;
}

/* FIX: Table row readability restoration */
.anvo-card__body td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    color: #e2e8f0 !important; /* Forces bright readable contrast over text-muted */
    font-size: 0.85rem;
    line-height: 1.5;
}
.anvo-card__body th {
    background: #050a07;
    color: var(--gold) !important;
    font-weight: 600;
    padding: 10px 12px;
}

/* ── DISCLAIMER BAR ───────────────────────────────────────────── */
.anvo-disclaimer-bar {
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.5;
    font-style: italic;
}

.anvo-disclaimer-bar p {
    margin: 0;
    display: inline;
}

/* ── MARKDOWN INSIDE CARDS ────────────────────────────────────── */
.anvo-card__body h1,
.anvo-card__body h2,
.anvo-card__body h3 {
    font-family: 'DM Serif Display', serif;
    color: var(--gold);
    margin: 14px 0 7px;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.anvo-card__body h1:first-child,
.anvo-card__body h2:first-child,
.anvo-card__body h3:first-child { margin-top: 0; }

.anvo-card__body strong { color: rgba(201,168,76,0.85); font-weight: 600; }
.anvo-card__body em     { color: var(--text-muted); }

.anvo-card__body p           { margin-bottom: 8px; }
.anvo-card__body p:last-child { margin-bottom: 0; }

.anvo-card__body ul,
.anvo-card__body ol {
    padding-left: 18px;
    margin-bottom: 8px;
}
.anvo-card__body li { margin-bottom: 5px; }

/* Numbered steps styling */
.anvo-card--steps .anvo-card__body ol {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}
.anvo-card--steps .anvo-card__body ol li {
    counter-increment: step-counter;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(96, 165, 250, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(96, 165, 250, 0.1);
}
.anvo-card--steps .anvo-card__body ol li::before {
    content: counter(step-counter);
    min-width: 22px;
    height: 22px;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--learner);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Tables inside cards */
.anvo-card__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin: 8px 0;
}
.anvo-card__body th {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-bright);
    padding: 7px 10px;
    text-align: left;
    color: var(--gold);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.anvo-card__body td {
    border: 1px solid var(--border);
    padding: 7px 10px;
    color: var(--text-muted);
    vertical-align: top;
}
.anvo-card__body tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

.anvo-card__body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--gold);
}

.anvo-card__body blockquote {
    border-left: 3px solid var(--gold);
    padding-left: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin: 10px 0;
}

.anvo-card__body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

/* ── MODE TINTS ───────────────────────────────────────────────── */
/* Subtle tint on the answer card per active mode */
.anvo-mode--citizen .anvo-card--answer {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.05);
}
.anvo-mode--citizen .anvo-card--answer .anvo-card__header {
    background: rgba(74, 222, 128, 0.08);
}
.anvo-mode--citizen .anvo-card--answer .anvo-card__label { color: var(--citizen); }

.anvo-mode--learner .anvo-card--answer {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(96, 165, 250, 0.05);
}
.anvo-mode--learner .anvo-card--answer .anvo-card__header {
    background: rgba(96, 165, 250, 0.08);
}
.anvo-mode--learner .anvo-card--answer .anvo-card__label { color: var(--learner); }

/* lawyer keeps gold — already default */

/* ── MODE SELECTOR ───────────────────────────────────────────── */
.mode-selector {
    display: flex;
    gap: 6px;
    align-self: flex-start;
}

.mode-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
}
.mode-pill:hover { border-color: var(--border-bright); color: var(--text); }

.mode-pill.active[data-mode="citizen"] {
    background: rgba(74,222,128,0.1);
    border-color: rgba(74,222,128,0.35);
    color: var(--citizen);
}
.mode-pill.active[data-mode="learner"] {
    background: rgba(96,165,250,0.1);
    border-color: rgba(96,165,250,0.35);
    color: var(--learner);
}
.mode-pill.active[data-mode="lawyer"] {
    background: rgba(201,168,76,0.12);
    border-color: rgba(201,168,76,0.35);
    color: var(--lawyer);
}

.mode-icon { font-size: 0.85rem; line-height: 1; }

/* ── INPUT GLASS ─────────────────────────────────────────────── */
.input-glass {
    background: var(--surface);
    border: 1px solid var(--border-bright);
    border-radius: 16px;
    padding: 10px 12px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-glass:focus-within {
    border-color: rgba(201,168,76,0.35);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.06), 0 8px 24px rgba(0,0,0,0.3);
}

.active-mode-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

textarea {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    resize: none;
    line-height: 1.55;
    max-height: 160px;
    overflow-y: auto;
    width: 100%;
    padding: 2px 0;
}

textarea::placeholder { color: var(--text-dim); }

textarea::-webkit-scrollbar { width: 3px; }
textarea::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 4px; }

.input-actions {
    display: flex;
    justify-content: flex-end;
}

.send-btn {
    width: 36px;
    height: 36px;
    background: var(--gold);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: #1a0f00;
    flex-shrink: 0;
}

.send-btn:not(:disabled):hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}

.send-btn:disabled {
    background: var(--surface-2);
    color: var(--text-dim);
    cursor: default;
    box-shadow: none;
}

.disclaimer {
    text-align: center;
    font-size: 0.67rem;
    color: var(--text-dim);
    letter-spacing: 0.02em;
    line-height: 1.5;
}

/* ── TYPING INDICATOR ────────────────────────────────────────── */
.typing-row {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 28px;
    animation: fadeUp 0.3s ease forwards;
}

.typing-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-label-text {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    animation: dotPulse 1.3s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── MOBILE RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
    .workspace-header { padding: 0 16px; }
    .welcome-screen, .message-row, .input-stage,
    .skeleton-message, .typing-row { padding: 0 16px; }
    .welcome-heading { font-size: 1.6rem; }
    .mode-selector { flex-wrap: wrap; }
    .messages-container { padding-bottom: 220px; }
}

@media (max-width: 480px) {
    .brand-pill { display: none; }
    .mode-pill span:last-child { display: none; }
    .mode-pill { padding: 6px 10px; }
}