/* Shared PTE/DET Petra presentation. Product access and voice modes stay server-owned. */
html:is([data-pte-theme], [data-det-theme]) .petra-brand-page {
    --primary: var(--pte-sage, #5c6f5c);
    --primary-dark: var(--pte-sage-hover, #485b49);
    --primary-light: var(--pte-sage-soft, #e7ede5);
    --primary-border: var(--pte-sage-border, #c5d2c1);
    --text-primary: var(--pte-text, #1a211c);
    --text-secondary: var(--pte-text-secondary, #4e5b52);
    --text-muted: var(--pte-text-muted, #5f6a61);
    --bg-cream: var(--pte-bg, #f7f4ef);
    --bg-white: var(--pte-surface, #fefefe);
    --border-primary: var(--pte-border, #e5e3da);
    --user-blue: var(--primary);
    --petra-green: var(--primary);
    --emerald-primary: var(--primary);
    --emerald-dark: var(--primary-dark);
    --petra-on-primary: var(--pte-on-primary, #ffffff);
}
html:is([data-pte-theme="dark"], [data-det-theme="dark"]) .petra-brand-page {
    --primary: var(--pte-sage, #a9c5a0);
    --primary-dark: var(--pte-sage-hover, #c2d8ba);
    --primary-light: var(--pte-sage-soft, #29392c);
    --primary-border: var(--pte-sage-border, #4d6550);
    --text-primary: var(--pte-text, #edf1ec);
    --text-secondary: var(--pte-text-secondary, #c1cbc3);
    --text-muted: var(--pte-text-muted, #9caaa0);
    --bg-cream: var(--pte-bg, #101512);
    --bg-white: var(--pte-surface, #19211c);
    --border-primary: var(--pte-border, #334039);
    --petra-on-primary: var(--pte-on-primary, #17251b);
}
.petra-brand-page :is(.petra-container, .chat-container) { border-radius: var(--pte-radius-card, 12px); box-shadow: none; }
.petra-brand-page :is(.petra-avatar, .petra-brand > div:first-child) { background: var(--primary-light) !important; box-shadow: none !important; }
.petra-brand-page :is(.text-gray-800, .text-gray-700) { color: var(--text-primary) !important; }
.petra-brand-page :is(.text-gray-600, .text-gray-500, .text-gray-400) { color: var(--text-muted) !important; }
.petra-brand-page :is(.bg-blue-50, .bg-blue-100, .bg-purple-50, .bg-purple-100, .from-cyan-100, .from-purple-100) { background: var(--primary-light) !important; }
.petra-brand-page :is(.border-blue-200, .border-blue-500, .border-purple-200) { border-color: var(--primary-border) !important; }
.petra-brand-page :is(.text-blue-600, .text-blue-700, .text-blue-800, .text-blue-900, .text-purple-600, .text-purple-700, .text-purple-900) { color: var(--primary) !important; }
.petra-brand-page :is(.hover\:bg-blue-200, .hover\:bg-purple-200):hover { background: var(--primary-border) !important; }
.petra-brand-page .insights-toggle-container { background: var(--primary-light); border-color: var(--primary-border); border-radius: var(--pte-radius-control, 8px); }
.petra-brand-page :is(.insights-toggle-label, .insights-tooltip-trigger) { color: var(--primary); }
.petra-brand-page .insights-tooltip-trigger { background: var(--primary-light); border-color: var(--primary-border); }
.petra-brand-page .insights-toggle-switch.active, .petra-brand-page #progress-bar { background: var(--primary) !important; }
.petra-brand-page button[onclick="setPetraMode('free_chat')"][style] { background: var(--primary) !important; color: var(--bg-cream) !important; }
.petra-brand-page :is(.stat-label, .petra-subtitle, .message-time) { font-size: .75rem; line-height: 1.6; }
.petra-brand-page .message.user .message-bubble,
.petra-brand-page .message.petra .message-bubble { background: var(--primary-light); color: var(--text-primary); box-shadow: none; }
.petra-brand-page .message.petra .message-bubble { background: var(--bg-white); border: 1px solid var(--border-primary); }
.petra-brand-page :is(.panel-close, .chat-sidebar .session-card) { border-color: var(--border-primary); color: var(--text-secondary); }
.petra-brand-page :is(#new-chat-btn, #send-btn, #new-question-btn, .btn-primary, .generate-btn, .start-btn, .petra-mode-btn.active, .bookmarks-toggle.active) { color: var(--petra-on-primary) !important; }
.petra-brand-page a[style*="background: var(--primary)"] { color: var(--petra-on-primary) !important; }
html[data-det-theme] #bottom-activity-bar .petra-header-avatar { width: 30px; height: 30px; object-fit: contain; border-radius: 50%; background: #e7ede5; }
.petra-brand-page :is(.btn-start, .btn-generate, .det-start-session, .det-delivery-btn.active),
.petra-brand-page :is(button, a)[style*="background: var(--primary)"] { color: var(--petra-on-primary) !important; }
.petra-brand-page :is(.message.petra, .message.user) { background: var(--primary-light); color: var(--text-primary); box-shadow: none; }
.petra-brand-page .session-card.active :is(.session-name, .session-meta span) { color: var(--petra-on-primary); opacity: 1; }
.petra-brand-page #new-chat-btn svg { width: 16px; height: 16px; }

.petra-brand-page .btn-stop { color: #ffffff !important; }
.petra-brand-page :is(.det-empty-state-action, .det-prompt-action-primary, .emerald-button) { color: var(--petra-on-primary) !important; }
.petra-brand-dialog > div { background: var(--bg-white) !important; border: 1px solid var(--border-primary); border-radius: var(--pte-radius-card, 12px) !important; }
.petra-brand-dialog :is(h3, h4) { color: var(--text-primary); font-weight: 500; }
.petra-brand-dialog :is(p, small) { color: var(--text-secondary); }
.petra-brand-dialog img[alt*="Petra"] { border-color: var(--primary-border) !important; box-shadow: none !important; }
.petra-brand-dialog [style*="background: linear-gradient"]:not([style*="#ef4444"], [style*="#dc2626"]) { background: var(--primary-light) !important; }
.petra-brand-dialog :is(a, button)[style*="background: linear-gradient"]:not([style*="#ef4444"], [style*="#dc2626"]) { background: var(--primary) !important; color: var(--petra-on-primary) !important; }
