/* Violet Glass V2. Shared authenticated workspace material; login stays separate. */
html:has(:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell)),
body:has(:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell)) {
  background: #15121d;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell),
body:has(:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell)) #drawer-root,
body:has(:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell)) :is(.socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog, .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog) {
  --purple: #a36aee;
  --purple-dark: #dec3ff;
  --purple-soft: #392a4e;
  --ink: #faf8ff;
  --text: #faf8ff;
  --muted: #c3bcce;
  --line: #55485f;
  --line-soft: rgba(237, 225, 255, .14);
  --surface: #292232;
  --surface-soft: #241e2e;
  --surface-strong: #443253;
  --sidebar: #211b2b;
  --success: #9de3ba;
  --warning: #f3cc8e;
  --danger: #ffa8b6;
  --portal-glass: rgba(29, 23, 42, .452);
  --portal-glass-edge: rgba(238, 223, 255, .28);
  --portal-glass-shadow: 0 18px 48px rgba(3, 2, 10, .2), inset 0 1px 0 rgba(255, 247, 255, .16), inset 0 -1px 0 rgba(5, 2, 12, .28);
  color: var(--ink);
  color-scheme: dark;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) {
  background:
    radial-gradient(ellipse at 73% 16%, rgba(117, 97, 139, .36), transparent 44%),
    radial-gradient(ellipse at 20% 75%, rgba(112, 52, 169, .27), transparent 44%),
    radial-gradient(ellipse at 98% 89%, rgba(55, 77, 104, .32), transparent 40%),
    linear-gradient(125deg, #121019, #1f1a2b 55%, #11131e);
  background-color: #15121d;
  background-attachment: scroll;
}

/* A static reflected-light ribbon, not an animated canvas behind the content. */
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .portal-main {
  background:
    radial-gradient(ellipse 480px 110px at 76% 4%, transparent 65%, rgba(234, 207, 255, .055) 66%, rgba(255, 245, 255, .025) 71%, transparent 73%),
    radial-gradient(ellipse 320px 95px at 4% 80%, transparent 62%, rgba(183, 125, 225, .055) 63%, transparent 75%);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.sidebar, .topbar) {
  border: 1px solid var(--portal-glass-edge);
  border-right-color: rgba(232, 217, 255, .12);
  border-bottom-color: rgba(232, 217, 255, .1);
  background: #292232;
  background-image: linear-gradient(118deg, rgba(255, 246, 255, .075), transparent 30%, transparent 72%, rgba(211, 180, 255, .025));
  box-shadow: var(--portal-glass-shadow);
  color: var(--ink);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .sidebar .brand-mark-light {
  filter: brightness(0) invert(1);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .nav-label {
  color: #b6a9c6;
  letter-spacing: .06em;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .nav-button {
  min-height: 46px;
  color: #c9c0d6;
  transition: color .15s ease, background-color .15s ease;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .nav-button:hover {
  color: #fff;
  background: rgba(231, 208, 255, .08);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .nav-button.active {
  color: #fff;
  border-color: rgba(229, 199, 255, .17);
  background: linear-gradient(105deg, rgba(169, 115, 236, .28), rgba(135, 89, 186, .12));
  box-shadow: inset 3px 0 #c99bff, inset 0 1px 0 rgba(245, 229, 255, .13);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .nav-count {
  background: #50376c;
  color: #f5eaff;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .sidebar-profile {
  border-color: rgba(237, 225, 255, .14);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .sidebar-profile strong { color: #faf8ff; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .sidebar-profile span { color: #c3bcce; }

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .sidebar-profile .admin-push-button {
  min-height: 44px;
  border-color: rgba(234, 210, 255, .19);
  background: rgba(234, 210, 255, .06);
  color: #e2d2f4;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .sidebar-profile .admin-push-button.is-enabled {
  color: #9de3ba;
  background: rgba(50, 132, 87, .14);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .topbar-project-link {
  min-height: 44px;
  border-color: rgba(236, 217, 255, .22);
  background: linear-gradient(135deg, #8242cb, #7133b7);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .19), 0 5px 18px rgba(12, 5, 24, .16);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .breadcrumbs { color: #c3bcce; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .breadcrumbs strong { color: #faf8ff; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .page-heading h1 { color: #faf8ff; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .page-heading p { color: #c3bcce; }

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.workspace, .whatsapp-chat, .summary-strip, .task-group) {
  border: 1px solid rgba(238, 223, 255, .22);
  border-right-color: rgba(232, 217, 255, .11);
  border-bottom-color: rgba(232, 217, 255, .1);
  background-color: rgba(29, 23, 42, .75);
  background-image: linear-gradient(120deg, rgba(238, 220, 255, .06), transparent 30%, transparent 78%, rgba(211, 180, 255, .025));
  box-shadow: var(--portal-glass-shadow);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.connection-group, .connection-card, .product-update-card) {
  border-color: var(--line-soft);
  background: rgba(42, 34, 56, .87);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(245, 228, 255, .055);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .connection-group-body .connection-card {
  background: #33283f;
  color: #faf8ff;
}
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .connection-entitlements span { color: #c3bcce; }

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.service-budget, .project-roadmap, .roadmap-step > div, .dashboard-secondary, .task-group-toggle) {
  background: #292232;
  color: #faf8ff;
  border-color: var(--line);
}
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.document-table tbody tr:hover, .document-phase-header:hover, .document-phase[open] > .document-phase-header, .activity-entry-new) { background: #382c46; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .approve-button,
body:has(:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell)) #drawer-root .approve-button { background: #203b2c; color: #b6efcb; border-color: #6fa987; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .socialme-channel-tile.is-locked { background: #302a38; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.socialme-channel-action > a, .socialme-channel-action > button, .socialme-channel-tile > button) { min-height: 44px; background: #382d47; border-color: #675375; color: #f1e9fb; }

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.primary-button, .secondary-button, .quiet-button, .icon-button) {
  min-height: 44px;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .primary-button {
  border-color: rgba(240, 219, 255, .2);
  background: linear-gradient(135deg, #8b48d4, #7233b8);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 240, 255, .16), 0 5px 16px rgba(13, 5, 24, .15);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.secondary-button, .icon-button) {
  border-color: rgba(229, 207, 255, .23);
  background: #382d47;
  color: #f1e9fb;
  box-shadow: inset 0 1px 0 rgba(255, 240, 255, .06);
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .icon-button { min-width: 44px; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .quiet-button { color: #d7c7e9; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .secondary-button:hover { background: #443451; }
:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) .primary-button:hover { background: #9253d9; }

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(button, a, input, textarea, select):focus-visible,
body:has(:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell)) #drawer-root :is(button, a, input, textarea, select):focus-visible {
  outline: 2px solid #d7adff;
  outline-offset: 3px;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.field input, .field textarea, .field select) {
  border-color: #675375;
  background: #241c30;
  color: #faf8ff;
  caret-color: #e0c9ff;
}

:is(.portal-shell:not(.admin-shell), .portal-shell.admin-shell) :is(.field input, .field textarea)::placeholder { color: #afa2bb; }

/* Chat is the quiet, more opaque reading surface within the translucent shell. */
.portal-shell:not(.admin-shell) .whatsapp-chat {
  min-width: 0;
  background-color: rgba(29, 23, 42, .66);
}

.portal-shell:not(.admin-shell) :is(.whatsapp-chat-header, .is-chat-composer.customer-command) {
  border-color: rgba(237, 225, 255, .12);
  background: rgba(37, 29, 49, .82);
  color: #faf8ff;
  box-shadow: none;
}

.portal-shell:not(.admin-shell) .whatsapp-chat .support-messages {
  background: transparent;
  scrollbar-color: #78618c transparent;
}

.portal-shell:not(.admin-shell) .chat-message {
  max-width: min(86%, 540px);
  padding: 11px 14px;
  border: 1px solid rgba(239, 220, 255, .11);
  box-shadow: inset 0 1px 0 rgba(255, 241, 255, .045);
}

.portal-shell:not(.admin-shell) .chat-message-client { background: rgba(52, 42, 65, .95); }
.portal-shell:not(.admin-shell) .chat-message-admin { background: rgba(73, 46, 103, .96); }

.portal-shell:not(.admin-shell) .whatsapp-chat .chat-message p {
  font-size: 14px;
  line-height: 1.6;
  color: #faf8ff;
  overflow-wrap: anywhere;
}

.portal-shell:not(.admin-shell) .chat-message-meta {
  margin-bottom: 5px;
  font-size: 11px;
  opacity: 1;
  color: #d0bfdc;
}

.portal-shell:not(.admin-shell) .chat-message-time { color: #cdbbdb; font-size: 10px; }
.portal-shell:not(.admin-shell) .chat-inline-link { color: #e0c4ff; }
.portal-shell:not(.admin-shell) .chat-message .comment-attachment { color: #e0c4ff; font-size: 12px; }

/* Audio's native minimum width must not widen the shared video/image track. */
.portal-shell:not(.admin-shell) .chat-message .chat-attachments {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.portal-shell:not(.admin-shell) .chat-attachments > *,
.portal-shell:not(.admin-shell) .chat-attachments :is(img, video, audio) { min-width: 0; max-width: 100%; }
.portal-shell:not(.admin-shell) .chat-media-video > a { overflow-wrap: anywhere; }
.portal-shell:not(.admin-shell) .chat-media-video > a svg { flex-shrink: 0; }

.portal-shell:not(.admin-shell) .chat-document-card {
  min-width: 0;
  border-color: rgba(235, 211, 255, .17);
  background: rgba(24, 18, 34, .5);
  color: #f9f5ff;
}

.portal-shell:not(.admin-shell) .chat-document-copy strong { font-size: 12px; }
.portal-shell:not(.admin-shell) .chat-document-copy small { color: #c5b6d3; font-size: 11px; }
.portal-shell:not(.admin-shell) .chat-document-icon { background: #f6edf9; }
.portal-shell:not(.admin-shell) .chat-media-audio span { color: #d6c6e2; }

.portal-shell:not(.admin-shell) .whatsapp-history-toggle {
  min-height: 44px;
  border-color: rgba(236, 211, 255, .2);
  background: #352940;
  color: #e0c9ff;
}

.portal-shell:not(.admin-shell) .is-chat-composer.customer-command textarea {
  border-color: #63516e;
  border-radius: 12px;
  background: #211a2b;
  color: #faf8ff;
  caret-color: #e0c9ff;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: inset 0 1px 5px rgba(4, 1, 9, .12);
}

.portal-shell:not(.admin-shell) .is-chat-composer.customer-command textarea::placeholder { color: #b9abc7; }
.portal-shell:not(.admin-shell) .is-chat-composer.customer-command textarea:focus { background: #282031; border-color: #b78bdc; }
.portal-shell:not(.admin-shell) .customer-command-mode button { min-height: 44px; color: #d5c5e2; }
.portal-shell:not(.admin-shell) .customer-command-mode button.is-active { background: #6a458d; color: #fff; }
.portal-shell:not(.admin-shell) .customer-command-actions .file-field { min-height: 44px; color: #e0d0ec; border-color: #695875; }
.portal-shell:not(.admin-shell) #support-voice-record { min-width: 44px; min-height: 44px; }
.portal-shell:not(.admin-shell) .is-chat-composer .customer-command-actions :is(.file-field, button) { width: 44px; min-width: 44px; min-height: 44px; }
.portal-shell:not(.admin-shell) .is-chat-composer :is(.file-field, #support-voice-record) { background: #382d47; color: #f1e9fb; border-color: #675375; }

.portal-shell:not(.admin-shell) .more-link-list > button { min-height: 48px; color: #f4edf9; }
.portal-shell:not(.admin-shell) .more-link-list > button:hover { background: rgba(230, 203, 255, .06); }
.portal-shell:not(.admin-shell) .customer-legal-links { display: block; margin-top: 24px; padding: 22px; border-color: var(--line-soft); }
.portal-shell:not(.admin-shell) .customer-legal-links > .section-header { margin: 0; padding: 0; border: 0; }
.portal-shell:not(.admin-shell) .customer-legal-links h2 { margin: 0 0 14px; padding: 0; border: 0; font-size: 17px; line-height: 1.4; }
.portal-shell:not(.admin-shell) .customer-legal-links nav { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.portal-shell:not(.admin-shell) .customer-legal-links a { display: inline-flex; align-items: center; min-height: 44px; color: #d9c7eb; font-size: 13px; text-underline-offset: 4px; }
body:has(.portal-shell:not(.admin-shell)) .portal-legal-footer { display: none; }

/* Native product workspaces and preview frames share the same Violet surfaces. */
.portal-shell:not(.admin-shell) :is(
  .socialme-studio, .socialme-active-studio, .socialme-saas-shell, .socialme-paywall,
  .automatic-saas-shell, .socialme-platform-composer, .socialme-contact-workspace,
  .socialme-window-workspace, .motion-portal-workspace, .motion-portal-studio
) {
  color: var(--ink);
  color-scheme: dark;
  border-color: rgba(237, 215, 255, .13);
  background: rgba(32, 25, 43, .88);
}

.portal-shell:not(.admin-shell) :is(
  .socialme-app-main, .socialme-app-topbar, .socialme-studio-main, .socialme-studio-head,
  .socialme-studio-tabs, .socialme-studio-foot, .automatic-saas-main, .automatic-saas-head,
  .automatic-saas-tabs, .automatic-history, .automatic-builder, .automatic-form,
  .automatic-builder-step, .socialme-provider-filters, .socialme-inbox-pane,
  .socialme-conversation-pane, .socialme-message-stream, .socialme-automation-pane,
  .socialme-rule-library, .automatic-studio-overview, .motion-portal-intro,
  .motion-portal-examples, .socialme-preview-banner
) { background: #251d30; color: #faf8ff; border-color: rgba(237, 215, 255, .12); }

.portal-shell:not(.admin-shell) :is(
  .socialme-app-sidebar, .socialme-studio-rail, .automatic-saas-rail,
  .automatic-saas-main .automatic-builder, .automatic-saas-main .automatic-history,
  .automatic-saas-main .automatic-studio-overview, .socialme-tiktok-direct-post
) { background: #221a2d; color: #faf8ff; border-color: rgba(237, 215, 255, .12); }

.portal-shell:not(.admin-shell) :is(
  .socialme-plan-card, .socialme-value-trio article, .socialme-app-summary article,
  .socialme-app-calendar-day, .socialme-time-sources article, .socialme-insight-provider,
  .socialme-insights-empty, .socialme-rule-card, .socialme-studio-composer,
  .socialme-chart-card, .socialme-top-post, .socialme-metric-grid article,
  .socialme-contacts-list > button, .socialme-time-readiness, .socialme-app-empty,
  .socialme-active-empty, .socialme-studio-rail-empty, .socialme-compose-no-connections,
  .socialme-tiktok-creator, .socialme-tiktok-interactions, .socialme-tiktok-commercial-toggle,
  .socialme-tiktok-declaration, .socialme-studio-account-form, .automatic-rail-account-form,
  .automatic-capacity, .automatic-rail-systems, .automatic-rail-safety,
  .automatic-rail-connection, .automatic-rail-app, .automatic-pro-scaler,
  .automatic-workflow-card, .automatic-app-card, .automatic-case-card,
  .automatic-overview-metrics > div, .automatic-selection-warning,
  .automatic-builder-step .automatic-sidebar-hint, .automatic-builder-step .automatic-connection-missing,
  .automatic-saas-main .automatic-overview-metrics > div
) { background: #30253c; color: #faf8ff; border-color: rgba(235, 212, 255, .14); }

.portal-shell:not(.admin-shell) :is(
  .socialme-studio-channel, .socialme-compose-targets label, .socialme-app-calendar-day button,
  .socialme-app-plan, .socialme-provider-filters button, .socialme-response-mode-button,
  .socialme-post-live-link, .automatic-examples button, .automatic-builder-step .automatic-examples button,
  .sm-tabs button, .sm-media-list button, .sm-slide-nav button,
  .socialme-paywall-flow span, .socialme-dashboard-hero-points span, .motion-portal-facts span
) { min-height: 44px; background: #392b49; color: #eee1fb; border-color: rgba(235, 212, 255, .17); }

.portal-shell:not(.admin-shell) :is(
  .socialme-compose-targets label:has(input:checked),
  .automatic-rail-app.is-connected:has(input:checked),
  .socialme-studio-channel:is(a, button):hover,
  .socialme-provider-filters button:is(:hover, .is-active),
  .socialme-response-mode-button:hover, .socialme-post-live-link:hover,
  .automatic-examples button:hover, .automatic-builder-step .automatic-examples button:hover,
  .sm-tabs button[aria-pressed=true], .sm-slide-nav button[aria-current=true]
) { background: #503368; color: #fff; border-color: rgba(213, 165, 255, .43); }

.portal-shell:not(.admin-shell) :is(
  .socialme-app-sidebar nav button, .socialme-studio-tabs button, .automatic-saas-tabs a,
  .socialme-rule-form label > span, .socialme-rule-list > p, .socialme-rule-preview label,
  .socialme-rule-card blockquote, .automatic-command, .automatic-app-card small,
  .automatic-connection-note, .automatic-selection-summary, .automatic-last-run,
  .socialme-contacts-list small, .socialme-contact-workspace p, .socialme-window-workspace p,
  .sm-note, .sm-format-help, [data-socialme-post-filters] output,
  .socialme-studio-foot > span, .socialme-live-preview-head,
  .socialme-app-draft-list .socialme-tiktok-check
) { color: #cfc0dc; }

.portal-shell:not(.admin-shell) :is(
  .socialme-app-sidebar nav button:hover, .socialme-app-sidebar nav button.is-active
) { color: #f4eaff; background: #432e57; border-color: rgba(222, 183, 255, .19); }

.portal-shell:not(.admin-shell) :is(
  .socialme-plan-name, .socialme-plan-card li::before, .socialme-value-icon,
  .socialme-studio-brand small, .socialme-studio-tabs button.is-active,
  .socialme-studio-composer .composer-field > small b, .socialme-week-nav span,
  .socialme-plan-recommendation, .socialme-draft-state, .socialme-preview-banner span,
  .socialme-paywall-footer a, .socialme-paywall-footer button, .socialme-posts-sections > section > header span,
  .socialme-app-plan button, .socialme-app-sidebar nav i, .socialme-app-sidebar nav button.is-active i,
  .socialme-channel-picker-head strong, .socialme-tiktok-options legend,
  .socialme-tiktok-creator em, .socialme-tiktok-declaration a, .socialme-source-card small,
  .socialme-real-post header span, .socialme-app-calendar-day button time,
  .automatic-live, .automatic-step-heading > span, .automatic-state,
  .automatic-builder-step-head > span, .automatic-saas-brand small,
  .automatic-saas-tabs a.is-active, .automatic-rail-app > b, .automatic-rail-safety > span,
  .automatic-overview-count, .automatic-request-list span, .automatic-app-setup > summary,
  .automatic-plan li::before, .automatic-rail-empty > span,
  .automatic-rail-systems > a, .automatic-rail-systems > button
) { color: #dec3ff; }

.portal-shell:not(.admin-shell) :is(
  .socialme-plan-recommendation, .socialme-draft-state, .socialme-plan-pill,
  .socialme-calendar-range, .socialme-posts-sections > section > header span,
  .socialme-studio-channel > b, .socialme-app-sidebar nav i,
  .socialme-app-sidebar nav button.is-active i, .socialme-rule-card-head em,
  .socialme-contact-avatar, .socialme-inbox-empty > span, .socialme-conversation-empty > span,
  .socialme-active-empty > span, .socialme-app-empty > span, .socialme-insights-empty > span,
  .socialme-time-sources article em, .socialme-insight-provider > div > span,
  .automatic-step-heading > span, .automatic-builder-step-head > span,
  .automatic-sidebar-hint > span, .automatic-empty > span,
  .socialme-real-post-targets span, .socialme-real-post-results span
) { background: #40304f; color: #e0c9f8; border-color: rgba(230, 201, 255, .13); }

.portal-shell:not(.admin-shell) :is(
  .socialme-studio-readiness, .automatic-saas-ready, .socialme-rule-card-head em.is-active,
  .socialme-chart-card > header > b, .socialme-insight-provider > header em,
  .socialme-publish-results > span, .automatic-state.state-active, .automatic-state.state-completed
) { background: #243b30; color: #a8e7c1; border-color: rgba(137, 221, 174, .2); }

.portal-shell:not(.admin-shell) :is(
  .socialme-studio-readiness.is-warning, .socialme-plan-pill.is-warning,
  .socialme-app-summary article.has-warning, .socialme-rule-card-head em.is-setup,
  .socialme-studio-channel.is-testing, .automatic-rail-app.is-testing,
  .automatic-state.state-failed, .automatic-state.state-setup_required,
  .automatic-engine-note.is-error, .socialme-media-warning, .sm-compatibility-warning,
  .socialme-insight-provider.is-stale > header em
) { background: #433222; color: #f2d29e; border-color: rgba(239, 193, 124, .22); }

.portal-shell:not(.admin-shell) :is(
  .socialme-insight-provider.is-failed > header em, .socialme-message.is-failed,
  .socialme-publish-results > span.is-failed
) { background: #482936; color: #ffc2cc; border-color: rgba(255, 167, 182, .2); }

.portal-shell:not(.admin-shell) :is(
  .socialme-studio-channel.is-locked, .socialme-studio-channel.is-unavailable,
  .socialme-studio-channel.is-unavailable:hover, .automatic-rail-app.is-unavailable,
  .automatic-case-card.is-pending, .socialme-insight-provider.is-unsupported > header em,
  .socialme-channel-action button:disabled, .socialme-channel-tile > button:disabled
) { background: #302a38; color: #bfb2c9; border-color: rgba(235, 212, 255, .1); }

.portal-shell:not(.admin-shell) :is(.automatic-case-card.is-pending b, .automatic-request-list small) { color: #c1b3cd; }
.portal-shell:not(.admin-shell) :is(.automatic-case-card b, .socialme-metric-grid small) { color: #9de3ba; }
.portal-shell:not(.admin-shell) .automatic-app-capability { color: #d6b8f4 !important; }
.portal-shell:not(.admin-shell) .automatic-app-card[data-automatic-report-ready=true] .automatic-app-capability { color: #9de3ba !important; }
.portal-shell:not(.admin-shell) .socialme-human-label { color: #f1cd9d !important; }
.portal-shell:not(.admin-shell) [data-sm-error]:not(:empty) { color: #ffa8b6; }
.portal-shell:not(.admin-shell) .socialme-tiktok-renew { color: #e1c5fa !important; background: #3c2b4e !important; border-color: rgba(230, 201, 255, .22) !important; }
.portal-shell:not(.admin-shell) .automatic-card-footer { background: #2a2135; }
.portal-shell:not(.admin-shell) .socialme-message { background: #352940; color: #faf8ff; }
.portal-shell:not(.admin-shell) .socialme-message.is-outbound { background: #68428c; color: #fff; }
.portal-shell:not(.admin-shell) .socialme-inbox-pane > header button { background: #382d47; color: #dec3ff; }

/* A refreshed inbox must not briefly fade its messages during each update. */
.portal-shell:not(.admin-shell) :is(.socialme-app-view, .socialme-studio-panel) {
  opacity: 1;
  animation: portal-violet-panel-enter .2s ease-out both;
}
@keyframes portal-violet-panel-enter {
  from { transform: translateY(3px); }
  to { transform: translateY(0); }
}

.portal-shell:not(.admin-shell) :is(.socialme-channel-tile .connection-logo, .socialme-compose-target-logo, .socialme-studio-connection-logo) {
  background: #40304f;
  color: #e3cafb;
  box-shadow: inset 0 1px rgba(255, 235, 255, .07);
}

/* Browser-native fields need an explicit color-scheme and text-fill: TikTok's
   older stylesheet defines text-fill separately from color. */
.portal-shell:not(.admin-shell) :is(
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]),
  select, textarea
) {
  color: #faf8ff;
  -webkit-text-fill-color: #faf8ff;
  background: #211a2b;
  border-color: rgba(232, 207, 255, .26);
  color-scheme: dark;
  caret-color: #e0c9ff;
}
.portal-shell:not(.admin-shell) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]), select) { min-height: 44px; }
.portal-shell:not(.admin-shell) :is(input, textarea)::placeholder { color: #b6a6c4; -webkit-text-fill-color: #b6a6c4; opacity: 1; }
.portal-shell:not(.admin-shell) select :is(option, optgroup),
.portal-shell:not(.admin-shell) .socialme-app-draft-list .socialme-tiktok-options select option { color: #faf8ff; -webkit-text-fill-color: #faf8ff; background: #2b2236; }
.portal-shell:not(.admin-shell) :is(input:not([type=checkbox]):not([type=radio]), select, textarea):disabled { color: #b5a6c2; -webkit-text-fill-color: #b5a6c2; background: #302837; opacity: 1; }
.portal-shell:not(.admin-shell) :is(input[type=checkbox], input[type=radio]) { accent-color: #a16ce1; color-scheme: dark; }

/* Motion uses shared tokens plus its own configurator class names. Its media
   retains the source image/video colors while every editing surface is Violet. */
.portal-shell:not(.admin-shell) #motion-app { --surface-strong: #443253; --paper: #251d30; --violet: #985cd9; }
.portal-shell:not(.admin-shell) #motion-app :is(
  .config-main, .order-card, .paid-order, .price-board, .price-products article,
  .product-detected, .production-live,
  .use-case-card, .use-case-card.is-ready, .compare-card, .format-switch,
  .prompt-composer, .product-link-field, .start-point-source .product-link-field,
  .quick-steps, .quick-steps ol, .steps, .motion-archive-entry,
  .motion-faq-section, .motion-faq-section article, .motion-faq-list
) { background: #2a2135; color: #faf8ff; border-color: rgba(232, 207, 255, .14); }
.portal-shell:not(.admin-shell) #motion-app :is(
  .format-switch button, .format-switch.format-switch-prominent button,
  .choice-field button, .prompt-keys button, .examples-toggle,
  .order-product-source, .duration-rates strong
) { min-height: 44px; background: #382a46; color: #eee0fa; border-color: rgba(232, 207, 255, .19); }
.portal-shell:not(.admin-shell) #motion-app :is(
  .format-switch button.active, .format-switch.format-switch-prominent button.active,
  .choice-field button.active, .prompt-keys button:hover, .examples-toggle:hover
) { background: #603c83; color: #fff; border-color: rgba(221, 176, 255, .4); }
.portal-shell:not(.admin-shell) #motion-app :is(
  .format-switch button > span, .format-switch button small,
  .choice-field legend, .select-field > span, .choice-field small,
  .order-summary span, .order-total span, .order-note, .order-assurances p,
  .motion-smallbusiness-note, .config-fields label, .form-section-heading small,
  .production-stages li:not(.done):not(.current) > span
) { color: #c8b8d5; }
.portal-shell:not(.admin-shell) #motion-app :is(.format-switch button.active > span, .format-switch button.active small, .format-switch button.active i) { color: #f2e7ff; }
.portal-shell:not(.admin-shell) #motion-app :is(.motion-step-heading > span, .prompt-composer > span b, .product-link-field button) { background: #7544a5; color: #fff; }
.portal-shell:not(.admin-shell) #motion-app .order-error { color: #ffa8b6; }
.portal-shell:not(.admin-shell) #motion-app :is(.result-type-section, .start-point-section) { background: #2b2137; border-color: rgba(232, 207, 255, .14); }
.portal-shell:not(.admin-shell) #motion-app .start-point-grid button { background: #382a46; color: #faf8ff; border-color: rgba(232, 207, 255, .17); }
.portal-shell:not(.admin-shell) #motion-app :is(.start-point-grid button.active, .start-point-grid #motion-drop-zone.dragging) { background: #513568; color: #fff; border-color: rgba(218, 177, 253, .37); }
.portal-shell:not(.admin-shell) #motion-app .start-point-grid button small { color: #cbbbd8; }
.portal-shell:not(.admin-shell) #motion-app .start-point-mark { background: #4a335e; color: #e5ccff; }
.portal-shell:not(.admin-shell) :is(.motion-effect-tabs button.active, .motion-worlds-cta a) { background: #67468b; color: #fff; border-color: rgba(218, 177, 253, .32); }
.portal-shell:not(.admin-shell) :is(.motion-compare-handle, .motion-compare-handle b) { background: #71508f; color: #fff; border-color: #c5a2e1; }

/* Preview frames follow the portal theme. Images and videos retain their colors;
   no filter, blend mode or opacity is applied to the customer's artwork. */
.portal-shell:not(.admin-shell) :is(.sm-platform-preview, .socialme-phone-post) {
  --ink: #faf8ff;
  --text: #faf8ff;
  --muted: #c3bcce;
  --surface: #2a2135;
  --surface-soft: #30253c;
  --purple: #a36aee;
  --purple-dark: #dec3ff;
  background: #2a2135;
  color: #faf8ff;
  border-color: rgba(232, 207, 255, .14);
  color-scheme: dark;
}
.portal-shell:not(.admin-shell) :is(.sm-preview-media, .socialme-live-media-placeholder) { background: #352940; color: #d4c5e2; }
.portal-shell:not(.admin-shell) .socialme-live-media-placeholder > span { background: #4a335e; color: #e5ccff; }
.portal-shell:not(.admin-shell) .socialme-live-preview { background: #211a2b; border-color: rgba(232, 207, 255, .14); }

/* The native Sarah planner uses shared tokens and can follow the dark material. */
.portal-shell:not(.admin-shell) .sarah-round-planner { background: radial-gradient(circle at 100% 0, rgba(164, 101, 227, .13), transparent 42%), #292232; }
.portal-shell:not(.admin-shell) .sarah-planner-status { color: #a0e5bd; background: rgba(48, 124, 78, .17); }
.portal-shell:not(.admin-shell) :is(.sarah-howto summary, .sarah-class-row legend) { color: #dec3ff; }
.portal-shell:not(.admin-shell) .sarah-field :is(input, textarea, select) { background: #241c30; color: #faf8ff; border-color: #675375; }
.portal-shell:not(.admin-shell) .sarah-field :is(input, textarea):focus { border-color: #b78bdc; outline: 2px solid #d7adff; outline-offset: 2px; }
.portal-shell:not(.admin-shell) .automatic-run-error { color: #ffa8b6; }

.portal-shell:not(.admin-shell) :is(.status-wartet, .task-offen, .status-open) { color: #f3d29e; background: #453324; }
.portal-shell:not(.admin-shell) :is(.status-freigegeben, .status-answered, .status-read) { color: #a8e7c1; background: #263e31; }
.portal-shell:not(.admin-shell) .status-aenderung { color: #ffc0cb; background: #482a35; }
.portal-shell:not(.admin-shell) .status-info { color: #badff4; background: #263c4c; }
.portal-shell:not(.admin-shell) :is(.status-arbeitsstand, .status-unread) { color: #e0c9f8; background: #40304f; }
.portal-shell:not(.admin-shell) :is(.status-archiv, .status-sent, .task-vorbereitung) { color: #cfc0dc; background: #352c40; }

/* Native dialogs are mounted beside the shell, including product dropdowns
   that previously inherited the unauthenticated page's light palette. */
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
) {
  background: #292032;
  background-image: linear-gradient(125deg, rgba(230, 199, 255, .055), transparent 48%);
  color: #faf8ff;
  border: 1px solid rgba(231, 201, 255, .23);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(3, 1, 8, .5), inset 0 1px rgba(247, 226, 255, .1);
  color-scheme: dark;
}
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
)::backdrop { background: rgba(9, 5, 16, .7); }
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]):not([type=hidden]), select, textarea) {
  color: #faf8ff;
  -webkit-text-fill-color: #faf8ff;
  background: #211a2b;
  border-color: rgba(231, 201, 255, .27);
  color-scheme: dark;
  caret-color: #e0c9ff;
}
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
) :is(select, button) { min-height: 44px; }
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
) select :is(option, optgroup) { color: #faf8ff; -webkit-text-fill-color: #faf8ff; background: #2b2236; }
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
) :is(button, .secondary-button, .automatic-run-layout nav button) { color: #eee0fa; background: #3b2b4b; border-color: rgba(231, 201, 255, .19); }
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
) :is(.primary-button, button[type=submit]) { color: #fff; background: #8242cb; }
body:has(.portal-shell:not(.admin-shell)) :is(
  .socialme-workspace-dialog, .socialme-publish-dialog, .automatic-request-dialog,
  .automatic-run-dialog, .automatic-builder-dialog, .motion-archive-dialog
) :is(small, output) { color: #cfbfdb; }
body:has(.portal-shell:not(.admin-shell)) .automatic-run-error { color: #ffa8b6; }
body:has(.portal-shell:not(.admin-shell)) .socialme-workspace-dialog fieldset { border-color: rgba(238, 223, 255, .14); }
body:has(.portal-shell:not(.admin-shell)) .motion-archive-dialog :is(.motion-archive-order, .motion-archive-entry) { color: #faf8ff; background: #32263f; border-color: rgba(231, 201, 255, .14); }
body:has(.portal-shell:not(.admin-shell)) .motion-archive-dialog :is(.motion-archive-result-actions a, .motion-archive-social a) { color: #eee0fa; background: #3b2b4b; border-color: rgba(231, 201, 255, .19); }

/* Drawer content lives beside the shell, so authenticate its theme via :has. */
body:has(.portal-shell:not(.admin-shell)) #drawer-root .drawer {
  background: #261e31;
  color: #faf8ff;
  border-left: 1px solid #665173;
  box-shadow: -12px 0 44px rgba(4, 1, 9, .35);
}
body:has(.portal-shell:not(.admin-shell)) #drawer-root .drawer-backdrop { background: rgba(9, 6, 15, .63); }
body:has(.portal-shell:not(.admin-shell)) #drawer-root :is(.field input, .field textarea, .field select) { color: #faf8ff; background: #211a2b; border-color: #675375; }
body:has(.portal-shell:not(.admin-shell)) #drawer-root :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]):not([type=hidden]), select, textarea) { color: #faf8ff; -webkit-text-fill-color: #faf8ff; background: #211a2b; border-color: rgba(231, 201, 255, .27); color-scheme: dark; }
body:has(.portal-shell:not(.admin-shell)) #drawer-root select :is(option, optgroup) { color: #faf8ff; -webkit-text-fill-color: #faf8ff; background: #2b2236; }
body:has(.portal-shell:not(.admin-shell)) #drawer-root :is(.secondary-button, .icon-button) { min-height: 44px; background: #382d47; color: #f1e9fb; border-color: #675375; }
body:has(.portal-shell:not(.admin-shell)) #drawer-root .primary-button { min-height: 44px; background: #8242cb; color: #fff; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .portal-shell:not(.admin-shell) :is(.sidebar, .topbar) {
    background-color: var(--portal-glass);
    -webkit-backdrop-filter: blur(24px) saturate(120%);
    backdrop-filter: blur(24px) saturate(120%);
  }
  .portal-shell:not(.admin-shell) :is(.workspace, .whatsapp-chat, .summary-strip, .task-group) {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 780px) {
  .portal-shell:not(.admin-shell) { background-attachment: scroll; }
  .portal-shell:not(.admin-shell) .sidebar { background-color: rgba(31, 24, 42, .97); }
  .portal-shell:not(.admin-shell) .sidebar-overlay { background: rgba(8, 5, 14, .65); }
  .portal-shell:not(.admin-shell) .topbar { gap: 8px; }
  .portal-shell:not(.admin-shell) .topbar-project-link { padding-inline: 12px; font-size: 11px; }
  .portal-shell:not(.admin-shell) .breadcrumbs { min-width: 0; }
  .portal-shell:not(.admin-shell) .whatsapp-chat-window { padding-inline: 12px; }
  .portal-shell:not(.admin-shell) .chat-message { max-width: 92%; padding: 11px 12px; }
  .portal-shell:not(.admin-shell) .whatsapp-chat .chat-message p { font-size: 15px; line-height: 1.6; }
  .portal-shell:not(.admin-shell) .is-chat-composer.customer-command textarea { font-size: 16px; }
}

@media (max-width: 620px) {
  .portal-shell:not(.admin-shell) .is-chat-composer .customer-command-form { grid-template-columns: minmax(0, 1fr); }
  .portal-shell:not(.admin-shell) .is-chat-composer .customer-command-form textarea { grid-column: 1; width: 100%; }
  .portal-shell:not(.admin-shell) .is-chat-composer .customer-command-actions { grid-column: 1; justify-self: end; max-width: 100%; }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .portal-shell:not(.admin-shell) { --portal-glass: #292232; --portal-glass-edge: #8c759d; background: #15121d; }
  .portal-shell:not(.admin-shell) .portal-main { background: none; }
  .portal-shell:not(.admin-shell) :is(.sidebar, .topbar) {
    background: #292232;
    border-color: #8c759d;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .portal-shell:not(.admin-shell) :is(.workspace, .whatsapp-chat, .summary-strip, .task-group, .connection-group, .connection-card, .product-update-card) { background: #292232; border-color: #8c759d; }
  .portal-shell:not(.admin-shell) :is(.whatsapp-chat-header, .is-chat-composer.customer-command) { background: #30263c; }
  .portal-shell:not(.admin-shell) .chat-message-client { background: #342a41; }
  .portal-shell:not(.admin-shell) .chat-message-admin { background: #492e67; }

}

@media (prefers-reduced-motion: reduce) {
  .portal-shell:not(.admin-shell) :is(.nav-button, .sidebar, .sidebar-overlay, .primary-button, .secondary-button) { transition: none; }
  .portal-shell:not(.admin-shell) .whatsapp-chat-window { scroll-behavior: auto; }
  .portal-shell:not(.admin-shell) :is(.socialme-app-view, .socialme-studio-panel) { animation: none; }
}

/* Compact publication journal: bounded rows, complete details on demand. */
.portal-shell:not(.admin-shell) .socialme-posts-view .socialme-app-summary { margin-block: 18px; gap: 8px; }
.portal-shell:not(.admin-shell) .socialme-posts-view .socialme-app-summary article { padding: 12px 14px; }
.portal-shell:not(.admin-shell) .socialme-post-list-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 18px 0 22px; scroll-margin-top: 100px; }
.portal-shell:not(.admin-shell) .socialme-post-list-filters label { display: grid; gap: 6px; min-width: 150px; flex: 0 1 200px; color: #cfc0dc; font-size: 12px; }
.portal-shell:not(.admin-shell) .socialme-post-list-filters select { width: 100%; min-width: 0; padding: 9px 30px 9px 12px; border: 1px solid rgba(232, 207, 255, .22); border-radius: 11px; }
.portal-shell:not(.admin-shell) .socialme-post-list-filters output { align-self: center; margin: 20px 0 0 auto; color: #cfc0dc; font-size: 12px; }
.portal-shell:not(.admin-shell) .socialme-post-overview-list { display: grid; gap: 8px; }
.portal-shell:not(.admin-shell) .socialme-post-overview-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; min-width: 0; padding: 16px 18px; border: 1px solid rgba(232, 207, 255, .1); border-radius: 15px; background: rgba(49, 37, 61, .72); }
.portal-shell:not(.admin-shell) .socialme-post-overview-row.needs-review { border-left-color: #c29968; }
.portal-shell:not(.admin-shell) .socialme-post-overview-copy { min-width: 0; }
.portal-shell:not(.admin-shell) .socialme-post-overview-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 6px 0 5px; color: #faf8ff; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.portal-shell:not(.admin-shell) .socialme-post-overview-copy p { overflow: hidden; margin: 0; color: #c6b7d2; font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.portal-shell:not(.admin-shell) .socialme-post-overview-status { color: #d9bdf4; font-size: 11px; line-height: 1.4; font-weight: 650; }
.portal-shell:not(.admin-shell) .socialme-post-overview-status.is-published { color: #a8e7c1; }
.portal-shell:not(.admin-shell) .socialme-post-overview-status:is(.is-failed, .is-partial),
.portal-shell:not(.admin-shell) .socialme-post-overview-warning { display: block; color: #f2d29e; font-size: 11px; line-height: 1.5; }
.portal-shell:not(.admin-shell) .socialme-post-overview-warning { margin-top: 5px; }
.portal-shell:not(.admin-shell) .socialme-post-overview-action { display: grid; justify-items: end; gap: 9px; }
.portal-shell:not(.admin-shell) .socialme-post-overview-action time { color: #c6b7d2; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.portal-shell:not(.admin-shell) .socialme-post-overview-action button { min-height: 44px; padding: 9px 13px; font-size: 12px; }
.portal-shell:not(.admin-shell) .socialme-post-overview-action svg { width: 15px; height: 15px; }
.portal-shell:not(.admin-shell) .socialme-post-list-pages { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.portal-shell:not(.admin-shell) .socialme-post-list-pages span { color: #cfc0dc; font-size: 12px; }
.portal-shell:not(.admin-shell) .socialme-post-list-pages button { padding: 9px 14px; font-size: 12px; }
.portal-shell:not(.admin-shell) .socialme-post-list-pages button:disabled { opacity: .45; cursor: default; }
.portal-shell:not(.admin-shell) .socialme-post-list-empty { margin: 0; padding: 24px 16px; border-radius: 14px; background: #30253c; color: #cfc0dc; font-size: 13px; }
.portal-shell:not(.admin-shell) .socialme-post-campaigns > summary { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 12px 0; cursor: pointer; }
.portal-shell:not(.admin-shell) .socialme-post-campaigns > summary::before { content: "+"; width: 18px; color: #dec3ff; font-size: 21px; }
.portal-shell:not(.admin-shell) .socialme-post-campaigns[open] > summary::before { content: "−"; }
.portal-shell:not(.admin-shell) .socialme-post-campaigns > summary > span { margin-left: auto; color: #cfc0dc; font-size: 12px; }
.portal-shell:not(.admin-shell) .socialme-campaign-overview { display: grid; gap: 8px; }
.portal-shell:not(.admin-shell) .socialme-campaign-overview-item { min-width: 0; border: 1px solid rgba(232, 207, 255, .12); border-radius: 14px; background: rgba(49, 37, 61, .65); }
.portal-shell:not(.admin-shell) .socialme-campaign-overview-item > summary { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 14px 16px; cursor: pointer; }
.portal-shell:not(.admin-shell) .socialme-campaign-overview-item > summary > span:first-child { display: grid; min-width: 0; gap: 5px; }
.portal-shell:not(.admin-shell) .socialme-campaign-overview-item > summary strong { color: #faf8ff; font-size: 13px; overflow-wrap: anywhere; }
.portal-shell:not(.admin-shell) .socialme-campaign-overview-item > summary small { color: #c6b7d2; font-size: 11px; }
.portal-shell:not(.admin-shell) .socialme-campaign-open-label { margin-left: auto; color: #dec3ff; font-size: 12px; white-space: nowrap; }
.portal-shell:not(.admin-shell) .socialme-campaign-overview-item > .order-card { margin: 0; border: 0; border-top: 1px solid rgba(232, 207, 255, .12); background: #2a2135; border-radius: 0 0 14px 14px; }
.portal-shell:not(.admin-shell) .socialme-posts-view details > summary:focus-visible { outline: 2px solid #d7adff; outline-offset: 3px; border-radius: 8px; }
.portal-shell:not(.admin-shell) .socialme-post-ideas-note { display: flex; align-items: center; flex-wrap: wrap; margin: 18px 0 0; color: #c6b7d2; font-size: 12px; }
.portal-shell:not(.admin-shell) .socialme-post-ideas-note button { padding-inline: 8px; font-size: 12px; }
@media (max-width: 600px) {
  .portal-shell:not(.admin-shell) .socialme-post-list-filters label { min-width: 0; flex: 1 1 120px; }
  .portal-shell:not(.admin-shell) .socialme-post-list-filters output { flex-basis: 100%; margin: 0; }
  .portal-shell:not(.admin-shell) .socialme-post-overview-row { gap: 12px; padding: 13px 12px; }
  .portal-shell:not(.admin-shell) .socialme-post-overview-copy h3 { font-size: 13px; }
  .portal-shell:not(.admin-shell) .socialme-post-overview-action { max-width: 105px; }
  .portal-shell:not(.admin-shell) .socialme-post-overview-action time { white-space: normal; text-align: right; }
  .portal-shell:not(.admin-shell) .socialme-post-campaigns > summary { flex-wrap: wrap; gap: 7px; }
  .portal-shell:not(.admin-shell) .socialme-post-campaigns > summary strong { font-size: 13px; }
  .portal-shell:not(.admin-shell) .socialme-campaign-overview-item > summary { padding: 12px; }
}

/* Compact customer chat: history scrolls while the composer stays reachable. */
html:has(.portal-shell), body:has(.portal-shell) {
  scrollbar-width: thin;
  scrollbar-color: #9d7dbb #21192e;
}
html:has(.portal-shell)::-webkit-scrollbar,
body:has(.portal-shell)::-webkit-scrollbar { width: 9px; height: 9px; }
html:has(.portal-shell)::-webkit-scrollbar-track,
body:has(.portal-shell)::-webkit-scrollbar-track { background: #21192e; }
html:has(.portal-shell)::-webkit-scrollbar-thumb,
body:has(.portal-shell)::-webkit-scrollbar-thumb { background: #9d7dbb; border: 2px solid #21192e; border-radius: 10px; }
.portal-shell:not(.admin-shell):has(.customer-orders) .portal-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}
.portal-shell:not(.admin-shell):has(.customer-orders) .content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-width: 1080px;
  min-width: 0;
  min-height: 0;
  padding: 24px 28px 24px;
}
.portal-shell:not(.admin-shell):has(.customer-orders) .page-heading { margin-bottom: 18px; gap: 12px; }
.portal-shell:not(.admin-shell):has(.customer-orders) .page-heading h1 { font-size: clamp(1.65rem, 3vw, 2.1rem); }
.portal-shell:not(.admin-shell):has(.customer-orders) .page-heading p { margin-top: 6px; font-size: .9rem; }
.portal-shell:not(.admin-shell) .customer-orders,
.portal-shell:not(.admin-shell) .customer-orders .whatsapp-chat,
.portal-shell:not(.admin-shell) .customer-orders .support-messages {
  min-width: 0;
  min-height: 0;
}
.portal-shell:not(.admin-shell) .customer-orders .whatsapp-chat-window {
  height: 100%;
  min-height: 0;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}
.portal-shell:not(.admin-shell) .customer-orders .whatsapp-chat-header { min-height: 60px; padding: 12px 18px; }
.portal-shell:not(.admin-shell):has(.customer-orders) .sidebar { min-height: 0; overflow-y: auto; }
.portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav) {
  scrollbar-width: thin;
  scrollbar-color: #9d7dbb #21192e;
}
.portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav)::-webkit-scrollbar { width: 9px; height: 9px; }
.portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav)::-webkit-scrollbar-track { background: #21192e; border-radius: 10px; }
.portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav)::-webkit-scrollbar-thumb { background: #9d7dbb; border: 2px solid #21192e; border-radius: 10px; }
.portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav)::-webkit-scrollbar-thumb:hover { background: #cba8ed; }
.portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav)::-webkit-scrollbar-corner { background: #21192e; }
@media (max-width: 780px) {
  .portal-shell:not(.admin-shell):has(.customer-orders) .content { padding: 16px 12px max(12px, env(safe-area-inset-bottom)); }
  .portal-shell:not(.admin-shell):has(.customer-orders) .page-heading { margin-bottom: 12px; }
  .portal-shell:not(.admin-shell) .customer-orders .whatsapp-chat-header { padding: 10px 14px; }
}
@media (max-height: 640px) {
  .portal-shell:not(.admin-shell):has(.customer-orders) .content { padding-block: 10px; }
  .portal-shell:not(.admin-shell):has(.customer-orders) .page-heading { margin-bottom: 10px; }
  .portal-shell:not(.admin-shell):has(.customer-orders) .page-heading h1 { font-size: 1.5rem; }
  .portal-shell:not(.admin-shell):has(.customer-orders) .page-heading p { display: none; }
  .portal-shell:not(.admin-shell) .customer-orders .whatsapp-chat-header { min-height: 44px; padding-block: 8px; }
  .portal-shell:not(.admin-shell) .customer-orders .whatsapp-chat-header p { display: none; }
}
@media (forced-colors: active) {
  html:has(.portal-shell), body:has(.portal-shell) { scrollbar-color: auto; }
  html:has(.portal-shell)::-webkit-scrollbar-track,
  body:has(.portal-shell)::-webkit-scrollbar-track { background: Canvas; }
  html:has(.portal-shell)::-webkit-scrollbar-thumb,
  body:has(.portal-shell)::-webkit-scrollbar-thumb { background: CanvasText; border-color: Canvas; }
  .portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav) { scrollbar-color: auto; }
  .portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav)::-webkit-scrollbar-track { background: Canvas; }
  .portal-shell :is(.whatsapp-chat-window, .sidebar, #support-composer textarea, .admin-chat-thread, .admin-client-nav)::-webkit-scrollbar-thumb { background: CanvasText; border-color: Canvas; }
}

/* Administration uses the same material while preserving its working views. */
.admin-shell .sidebar { top:12px; height:calc(100dvh - 24px); margin:12px 0 12px 12px; padding:26px 16px 20px; border-radius:24px; }
.admin-shell .portal-nav { gap:5px; }
.admin-shell .nav-button { border:1px solid transparent; border-radius:12px; }
.admin-shell .topbar { top:12px; min-height:64px; margin:12px 20px 0; padding:0 20px; border-radius:20px; }
.admin-shell .content.admin-content { width:100%; max-width:1240px; margin-inline:auto; padding:28px clamp(16px,3vw,36px) 40px; }
.admin-shell .page-heading { margin-bottom:20px; }
.admin-shell .page-heading h1 { font-size:clamp(1.65rem,3vw,2.1rem); letter-spacing:-.04em; font-weight:650; }
.admin-shell .page-heading p { max-width:65ch; line-height:1.6; }
.admin-shell :is(.workspace,.admin-metrics,.admin-section-nav) { border:1px solid var(--portal-glass-edge); border-radius:20px; }
.admin-shell .admin-metrics { margin-bottom:22px; background:rgba(37,29,49,.82); box-shadow:inset 0 1px rgba(255,240,255,.07); }
.admin-shell .admin-metrics > div { padding:15px 18px; border-color:var(--line-soft); }
.admin-shell .admin-metrics strong { margin-top:6px; font-size:1.35rem; }
.admin-shell .admin-section-nav { top:88px; padding:6px; background:#241e2e; }
.admin-shell .admin-section-tab { border-radius:12px; min-height:44px; }
.admin-shell .admin-section-tab.active { border-color:#70508c; color:#faf8ff; background:#4a325f; }
.admin-shell .admin-tab-count { color:#eee2fa; background:#50376c; }
.admin-shell .admin-panel-toolbar { border-radius:18px 18px 0 0; }
.admin-shell details.workspace:has(#admin-meta-review-access) { padding:18px 22px; }
.admin-shell details.workspace:has(#admin-meta-review-access) > summary { min-height:28px; cursor:pointer; font-weight:650; }
.admin-shell :is(.admin-client-nav,.admin-client-flyout-head) { background:#241e2e; color:var(--ink); border-color:var(--line); }
.admin-shell .admin-client-nav { box-shadow:0 20px 48px rgba(3,2,10,.4); }
.admin-shell .admin-client-button small { color:var(--muted); }
.admin-shell :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { color:#faf8ff; background:#241c30; border-color:#675375; caret-color:#e0c9ff; }
.admin-shell :is(input,textarea)::placeholder { color:#b9abc7; }
.admin-shell :is(.admin-support-card,.admin-unified-chat,.admin-chat-composer,.activity-entry-new) { background:#292232; color:var(--ink); border-color:var(--line-soft); }
.admin-shell .activity-entry { border-color:var(--line-soft); }
.admin-shell :is(.activity-entry,.compact-task-item,.admin-metrics) a { color:#e0c4ff; }
.admin-shell .chat-message-admin { color:var(--ink); background:#492e67; }
.admin-shell .chat-message-client { color:var(--ink); background:#342a41; }
.admin-shell .chat-message :is(p,strong) { color:var(--ink); }
.admin-shell :is(.chat-message-meta,.chat-message-time) { color:#d0bfdc; }
.admin-shell :is(.status-unread,.status-pending) { color:#f3cc8e; background:#473720; border-color:#84683f; }
.admin-shell :is(.status-read,.status-approved,.approve-button) { color:#b6efcb; background:#203b2c; border-color:#6fa987; }
.admin-shell .task-waiting { color:#f3cc8e; }
.admin-shell :is(.admin-section-nav,.admin-view-panel .compact-task-list,.admin-client-nav,.admin-chat-thread,.os-section-nav) { scrollbar-width:thin; scrollbar-color:#9d7dbb #21192e; }
.admin-shell :is(.admin-section-nav,.admin-view-panel .compact-task-list,.admin-client-nav,.admin-chat-thread,.os-section-nav)::-webkit-scrollbar { width:9px; height:9px; }
.admin-shell :is(.admin-section-nav,.admin-view-panel .compact-task-list,.admin-client-nav,.admin-chat-thread,.os-section-nav)::-webkit-scrollbar-track { background:#21192e; border-radius:10px; }
.admin-shell :is(.admin-section-nav,.admin-view-panel .compact-task-list,.admin-client-nav,.admin-chat-thread,.os-section-nav)::-webkit-scrollbar-thumb { background:#9d7dbb; border:2px solid #21192e; border-radius:10px; }
body:has(.admin-shell) .portal-legal-footer { background:#15121d; border-color:#55485f; color:#c3bcce; }
body:has(.admin-shell) .portal-legal-footer a { color:#d9c7eb; }
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .admin-shell :is(.sidebar,.topbar) { background-color:rgba(29,23,42,.75); -webkit-backdrop-filter:blur(24px) saturate(125%); backdrop-filter:blur(24px) saturate(125%); }
}
@media (max-width:780px) {
  .admin-shell .sidebar { inset:8px auto 8px 8px; height:calc(100dvh - 16px); margin:0; transform:translateX(calc(-100% - 12px)); padding-bottom:calc(20px + env(safe-area-inset-bottom)); }
  .admin-shell .sidebar.open { transform:translateX(0); }
  .admin-shell .sidebar-overlay { background:rgba(10,6,20,.65); }
  .admin-shell .topbar { top:8px; margin:8px 8px 0; padding:0 12px; border-radius:18px; }
  .admin-shell .content.admin-content { padding:22px 12px 30px; }
  .admin-shell .admin-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-shell .admin-metrics > div { padding:12px; }
  .admin-shell .admin-metrics > div:nth-child(2) { border-right:0; }
  .admin-shell .admin-metrics > div:nth-child(n+3) { border-top:1px solid var(--line-soft); }
  .admin-shell .admin-section-nav { display:flex; flex-wrap:nowrap; overflow-x:auto; top:80px; scroll-padding:6px; }
  .admin-shell .admin-section-tab { flex:0 0 auto; padding-inline:12px; }
  .admin-shell .admin-panel-toolbar { flex-wrap:wrap; }
}
@media (max-height:640px) { .admin-shell .admin-section-nav { position:static; } }
@media (prefers-reduced-transparency:reduce), (prefers-contrast:more) {
  .admin-shell :is(.sidebar,.topbar,.workspace,.admin-metrics,.admin-section-nav) { background:#241e2e; border-color:#9d7dbb; box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none; }
}
@media (prefers-reduced-motion:reduce) { .admin-shell :is(.nav-button,.sidebar,.sidebar-overlay) { transition:none; } }
@media (forced-colors:active) {
  .admin-shell :is(.admin-section-nav,.admin-view-panel .compact-task-list,.admin-client-nav,.admin-chat-thread,.os-section-nav) { scrollbar-color:auto; }
}
