/* app.css — global styles for LLM4B.Web */

html,
body {
    font-family: var(--llm4b-component-typography-font-family);
    margin: 0;
    padding: 0;
    height: 100%;
}

#blazor-error-ui {
    background: var(--llm4b-color-code-error-bg);
    color: var(--llm4b-color-code-error-text);
    border: 1px solid var(--mud-palette-error);
    border-radius: 4px;
    bottom: 0;
    box-shadow: 0 -2px 8px color-mix(in srgb, var(--llm4b-color-base-black) 15%, transparent);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   Diagram node styles — global (not scoped) so they reach widgets
   rendered inside DiagramCanvas's component tree.
   ═══════════════════════════════════════════════════════════════ */

/* ── Node base ─────────────────────────────────────────────────── */
.hw-node {
    position: relative;
    min-width: 220px;
    border-radius: 10px;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--llm4b-color-base-black) 13%, transparent);
    font-family: var(--llm4b-component-typography-font-family);
    font-size: 13px;
    background: var(--mud-palette-surface);
    border: 2px solid var(--mud-palette-divider);
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hw-node__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 6px 8px;
    border-bottom: 2px solid var(--mud-palette-divider);
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px 8px 0 0;
}

.hw-node__title {
    line-height: .5;
}

.hw-node__icon {
    font-size: 18px;
}

.hw-node__settings-btn {
    padding: var(--llm4b-spacing-2xs);
    opacity: 0.5;
    scale: 0.85;
}

.hw-node__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 250px;

}

.hw-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hw-textarea,
.hw-input {
    width: 100%;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.hw-textarea:focus,
.hw-input:focus {
    border-color: var(--mud-palette-secondary);
}

.hw-input--error {
    border-color: var(--mud-palette-error) !important;
}

.hw-error-text {
    color: var(--mud-palette-error);
    font-size: 11px;
}

.hw-node.node-not-ready {
    border: 2px dashed var(--mud-palette-warning) !important;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--llm4b-color-orange-500) 20%, transparent) !important;
}


/* ── LLM node select ───────────────────────────────────────────── */
.hw-node--llm .hw-input {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
}

/* ── LLM node inline I/O (historical run overlay) ─────────────── */
.hw-node__io {
    margin-top: 8px;
    border-top: 1px solid var(--mud-palette-divider);
    padding-top: 6px;
}

.hw-io-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mud-palette-text-secondary);
    margin: 4px 0 2px;
}

.hw-io-pre {
    font-size: 10px;
    font-family: var(--llm4b-component-typography-mono-font-family);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 80px;
    overflow-y: auto;
    background: var(--mud-palette-background-grey);
    border-radius: 3px;
    padding: 4px 6px;
    margin: 0;
    color: var(--mud-palette-text-primary);
}

/* ── Output pre ────────────────────────────────────────────────── */
.hw-output-pre {
    font-size: 12px;
    font-family: var(--llm4b-component-typography-mono-font-family);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
    background: var(--mud-palette-background-grey);
    border-radius: 4px;
    padding: 6px 8px;
    margin: 0;
    color: var(--mud-palette-text-primary);
}

/* ── Output results ────────────────────────────────────────────── */
.hw-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hw-result-item {
    background: var(--mud-palette-surface);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-family: var(--llm4b-component-typography-mono-font-family);
    color: var(--mud-palette-success);
}

.hw-empty {
    color: var(--mud-palette-text-secondary);
    font-style: italic;
    font-size: 12px;
}

/* ── Port handle containers ────────────────────────────────────── */
.hw-node__ports {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.hw-node__ports--left {
    left: -10px;
}

.hw-node__ports--right {
    right: -10px;
}

.hw-node__ports--top {
    top: -10px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
}

.hw-node__ports--bottom {
    top: auto;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
}

/* ── Port renderer override (library renders .diagram-port inside) */
.hw-port {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    cursor: crosshair;
    transition: transform 0.25s;
}

.hw-port:hover {
    transform: scale(1.2);
}

.hw-port-chevron {
    width: 16px;
    height: 16px;
    transition: color 0.15s, transform 0.2s;
    filter: drop-shadow(0px 1px 1px color-mix(in srgb, var(--llm4b-color-base-black) 15%, transparent));
    position: relative;
}

.hw-port--left .hw-port-chevron {
    left: -4px;
}

.hw-port--right .hw-port-chevron {
    left: 6px;
}

.hw-port--top .hw-port-chevron {
    top: -4px;
}

.hw-port--bottom .hw-port-chevron {
    top: 4px;
}

.hw-port--input .hw-port-chevron {
    color: var(--mud-palette-success);
    /* Green for input */
}

.hw-port--output .hw-port-chevron {
    color: var(--mud-palette-info);
    /* Blue for output */
}

.hw-port:hover .hw-port-chevron {
    color: var(--mud-palette-secondary) !important;
    /* Accent purple on hover */
}

.hw-port-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
    user-select: none;
    line-height: 1;
    transition: color 0.15s;
}

.hw-port-wrapper:hover .hw-port-label {
    color: var(--mud-palette-text-primary);
}

/* ── Node status animations ────────────────────────────────────── */
@keyframes border-snake {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 300% 0%;
    }
}

.status-running {
    border-color: transparent !important;
    background-clip: padding-box !important;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--llm4b-color-azure-500) 35%, transparent) !important;
}

.status-running::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--llm4b-color-blue-500), var(--llm4b-color-accent-magenta), var(--llm4b-color-accent-cyan), var(--llm4b-color-blue-500));
    background-size: 300% 100%;
    z-index: -1;
    animation: border-snake 2s linear infinite;
}

.status-completed {
    box-shadow: 0 0 5px 2px color-mix(in srgb, var(--llm4b-color-green-500) 60%, transparent), 0 4px 16px color-mix(in srgb, var(--llm4b-color-base-black) 13%, transparent);
    border-color: var(--mud-palette-success) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.status-failed {
    box-shadow: 0 0 5px 2px color-mix(in srgb, var(--llm4b-color-red-500) 60%, transparent), 0 4px 16px color-mix(in srgb, var(--llm4b-color-base-black) 13%, transparent);
    border-color: var(--mud-palette-error) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.status-pending {
    border-color: var(--mud-palette-info) !important;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--llm4b-color-base-black) 13%, transparent);
    transition: border-color 0.3s ease;
}

.status-unreachable {
    opacity: 0.725;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--llm4b-color-base-black) 5%, transparent);
    opacity: 0.5;
    transition: opacity 0.3s ease, border-color 0.3s ease;
}

/* ── Selected node highlighting ────────────────────────────────── */
.diagram-node.selected .hw-node {
    border-color: var(--mud-palette-secondary) !important;
    box-shadow: 0 0 5px 2px color-mix(in srgb, var(--llm4b-color-periwinkle-500) 45%, transparent), 0 4px 16px color-mix(in srgb, var(--llm4b-color-base-black) 15%, transparent) !important;
}

/* ── Workflow link styling overrides ─────────────────────────────────── */
.workflow-link .link-path {
    transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.workflow-link .link-marker {
    transition: fill 0.15s ease;
}

.workflow-link:not(.selected) .link-path {
    stroke: var(--llm4b-color-bluegray-500) !important;
}

.workflow-link:not(.selected) .link-marker {
    fill: var(--llm4b-color-bluegray-500) !important;
}

.workflow-link.status-running:not(.selected) .link-path {
    stroke: var(--mud-palette-info) !important;
}

.workflow-link.status-running:not(.selected) .link-marker {
    fill: var(--mud-palette-info) !important;
}

.workflow-link.status-pending:not(.selected) .link-path {
    stroke: var(--mud-palette-info) !important;
}

.workflow-link.status-pending:not(.selected) .link-marker {
    fill: var(--mud-palette-info) !important;
}

.workflow-link.status-completed:not(.selected) .link-path {
    stroke: var(--mud-palette-success) !important;
}

.workflow-link.status-completed:not(.selected) .link-marker {
    fill: var(--mud-palette-success) !important;
}

.workflow-link.status-failed:not(.selected) .link-path {
    stroke: var(--mud-palette-error) !important;
}

.workflow-link.status-failed:not(.selected) .link-marker {
    fill: var(--mud-palette-error) !important;
}

.workflow-link.status-unreachable:not(.selected) {
    opacity: 0.3 !important;
}

.workflow-link.status-unreachable:not(.selected) .link-path {
    stroke: var(--mud-palette-text-secondary) !important;
}

.workflow-link.status-unreachable:not(.selected) .link-marker {
    fill: var(--mud-palette-text-secondary) !important;
}

/* ── Tooltip IO Preview ────────────────────────────────────────── */
.hw-tooltip-preview {
    max-width: 300px;
    max-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hw-tooltip-preview .hw-io-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--llm4b-color-slate-400);
    margin-bottom: 4px;
}

.hw-tooltip-preview .hw-io-pre {
    font-size: 9px;
    font-family: var(--llm4b-component-typography-mono-font-family);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
    background: var(--llm4b-color-code-bg);
    border-radius: 4px;
    padding: 6px;
    margin: 0;
    color: var(--llm4b-color-code-text);
    border: 1px solid var(--llm4b-color-code-border);
}

/* ── Node IO Indicator Icon ───────────────────────────────────── */
.hw-node-io-indicator {
    position: absolute;
    bottom: -28px;
    right: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: transform 0.15s;
    pointer-events: all !important;
}

.hw-node-io-indicator:hover {
    transform: scale(1.1);
}

.hw-node-io-indicator--completed {
    color: var(--mud-palette-info);
    /* MudBlazor primary/info color */
    border-color: var(--mud-palette-info);
}

.hw-node-io-indicator--failed {
    color: var(--mud-palette-error);
    /* MudBlazor error color */
    border-color: var(--mud-palette-error);
}


/* ── Dialog Pre blocks ─────────────────────────────────────────── */
.hw-dialog-pre {
    font-size: 12px;
    font-family: var(--llm4b-component-typography-mono-font-family);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    background: var(--llm4b-color-code-bg);
    color: var(--llm4b-color-code-text);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 0;
    border: 1px solid var(--llm4b-color-code-border);
}

.hw-dialog-pre.error-pre {
    background: var(--llm4b-color-code-error-bg);
    color: var(--llm4b-color-code-error-text);
    border-color: var(--llm4b-color-code-error-border);
}

/* ── Split Panel Dialog & Monaco Editor ────────────────────────── */
.hw-dialog-split-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    height: 550px;
    width: 100%;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.hw-dialog-panel {
    display: flex;
    flex-direction: column;
    width: 50%;
    height: 100%;
    flex-grow: 1;
    flex-shrink: 1;
    overflow: hidden;
}

.hw-dialog-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--mud-palette-background-grey);
    border: 1px solid var(--mud-palette-divider);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    box-sizing: border-box;
    height: 40px;
    color: var(--mud-palette-text-primary);
}

.hw-dialog-panel-header.error-header {
    background: color-mix(in srgb, var(--llm4b-color-red-500) 12%, transparent);
    border-color: var(--mud-palette-error);
}

.hw-dialog-editor-container {
    flex-grow: 1;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    height: calc(100% - 40px);
    box-sizing: border-box;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hw-dialog-editor-container.error-border {
    border-color: var(--mud-palette-error);
}

.hw-dialog-editor-container:focus-within {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 1px var(--mud-palette-primary), 0 2px 8px rgba(var(--mud-palette-primary-rgb), 0.08);
}

.hw-dialog-editor-container.error-border:focus-within {
    border-color: var(--mud-palette-error) !important;
    box-shadow: 0 0 0 1px var(--mud-palette-error), 0 2px 8px rgba(var(--mud-palette-error-rgb), 0.08);
}

.hw-monaco-editor-wrapper {
    position: relative;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    background-color: var(--mud-palette-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--llm4b-color-base-black) 3%, transparent);
}

.hw-monaco-editor-wrapper:focus-within {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 1px var(--mud-palette-primary), 0 2px 8px rgba(var(--mud-palette-primary-rgb), 0.08);
}

.hw-monaco-editor {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: transparent;
}

/* ── Keyboard Shortcuts (kbd) ─────────────────────────────────── */
.hw-kbd {
    border: 1px solid var(--mud-palette-divider);
    padding: 1px 4px;
    margin: 0 4px;
    border-radius: 3px;
    font-size: 10px;
    font-family: var(--llm4b-component-typography-mono-font-family);
    display: inline-block;
}

/* ── Layout adjustments for full-screen Designer Page ── */
.designer-main-content {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
    padding-top: var(--mud-appbar-height) !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.llm4b-designer-body {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

/* ── Layout adjustments for standard pages ── */
.dashboard-main-content {
    padding-top: calc(var(--mud-appbar-height, 64px) + 1.5rem) !important;
}

/* ── Glass app bar: translucent surface (appbarBackground token matching neuralex.ca) + blur + hairline ── */
.mud-appbar {
    background-color: var(--llm4b-color-appbar-background);
    backdrop-filter: blur(var(--llm4b-blur-md)) saturate(1.6);
    -webkit-backdrop-filter: blur(var(--llm4b-blur-md)) saturate(1.6);
    border-bottom: 1px solid var(--llm4b-color-divider);
}

/* ── Add node button just outside output port ── */
.hw-port-add-btn {
    position: absolute;
    left: 16px;
    top: 40%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    user-select: none;
    line-height: 1;
}

/* ── MudBlazor Theme & Dialog Custom Overrides (DTCG Tokenized) ── */
body .mud-dialog {
    backdrop-filter: blur(var(--llm4b-component-dialog-glass-blur)) saturate(var(--llm4b-component-dialog-glass-saturation)) !important;
    -webkit-backdrop-filter: blur(var(--llm4b-component-dialog-glass-blur)) saturate(var(--llm4b-component-dialog-glass-saturation)) !important;
    background-color: var(--llm4b-color-surface-dialog) !important;
    padding: var(--llm4b-spacing-sm) var(--llm4b-spacing-lg) !important;
    border: 1px solid var(--llm4b-color-border-glass) !important;
    border-radius: var(--llm4b-component-dialog-border-radius) !important;
    box-shadow: var(--llm4b-component-dialog-elevation) !important;
    overflow-x: hidden !important;
}

body .mud-dialog.mud-dialog-fullscreen {
    border-radius: 0 !important;
}

body .mud-dialog.llm4b-nb-studio-dialog {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    padding: var(--llm4b-spacing-xs) var(--llm4b-spacing-md) var(--llm4b-spacing-sm) !important;
    overflow: hidden !important;
}

body .mud-dialog.llm4b-nb-studio-dialog .mud-dialog-title {
    flex: 0 0 auto !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    padding: var(--llm4b-spacing-xs) var(--llm4b-spacing-xs) var(--llm4b-spacing-sm) !important;
}

body .mud-dialog.llm4b-nb-studio-dialog .mud-dialog-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 var(--llm4b-spacing-xs) var(--llm4b-spacing-md) !important;
}

body .mud-dialog.llm4b-nb-studio-dialog .mud-dialog-actions {
    flex: 0 0 auto !important;
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-xs) var(--llm4b-spacing-xs) !important;
    gap: var(--llm4b-spacing-sm);
    border-top: 1px solid var(--llm4b-color-divider);
}

body .mud-dialog .mud-icon-button {
    overflow: hidden !important;
}

body .mud-dialog .mud-dialog-content {
    padding: var(--llm4b-spacing-sm) !important;
    margin: 0 !important;
}

body .mud-dialog .mud-dialog-title {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--llm4b-spacing-xs) !important;
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-sm) !important;
    position: relative;
    overflow: hidden;
}

body .mud-dialog .mud-dialog-title> :not(.mud-button-close) {
    flex: 1 1 auto;
    min-width: 0;
}

body .mud-dialog .mud-dialog-title .mud-button-close {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    order: 99;
    flex: 0 0 auto;
    margin-left: var(--llm4b-spacing-xs) !important;
    overflow: hidden !important;
}

body .mud-input>input.mud-input-root-outlined,
body div.mud-input-slot.mud-input-root-outlined {
    padding: 12px 14px !important;
}

/* ── Choice / Segmented Toggle Group (DTCG Tokenized) ─────────── */
.mud-toggle-group {
    border-radius: var(--llm4b-component-toggle-group-border-radius);
}

.mud-toggle-group-outlined .mud-toggle-item {
    padding: var(--llm4b-component-toggle-group-item-padding-standard);
}

.mud-toggle-group-outlined .mud-toggle-item.mud-toggle-item-size-small {
    padding: var(--llm4b-component-toggle-group-item-padding-small);
}

.mud-toggle-group-outlined .mud-toggle-item.mud-toggle-item-size-large {
    padding: var(--llm4b-component-toggle-group-item-padding-large);
}

.mud-toggle-item>.mud-button-label {
    min-height: var(--llm4b-component-toggle-group-label-min-height);
}

/* Annotation placement mode crosshair cursor */
.annotation-placement,
.annotation-placement *,
.annotation-placement .diagram-canvas,
.annotation-placement .diagram-svg-layer,
.annotation-placement .diagram-html-layer,
.annotation-placement svg,
.annotation-placement rect,
.annotation-placement g {
    cursor: crosshair !important;
}

/* Ensure annotations render behind normal diagram nodes */
.diagram-node:has(.hw-annotation-node) {
    z-index: 1 !important;
}

.diagram-node {
    z-index: 10;
}

/* ── Fan-out Curly Brace styles ────────────────────────── */
.hw-node--parallel-wrapper {
    display: flex;
    align-items: stretch;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-width: 320px;
    position: relative;
    user-select: none;
}

/* ── Navigation Menu Overrides ─────────────────────────── */
/* Scale down MudNavLink icons when in dense navigation menus */
.mud-navmenu .mud-nav-link svg.mud-icon-root {
    font-size: 1.5rem !important;
    /* Default medium is 1.5rem (24px) */
    width: 1.5rem !important;
    height: 1.5rem !important;
}

.mud-nav-link .mud-nav-link-text {
    margin-left: 6px;
    margin-inline-start: 6px;
}

/* ── Public Landing Page & Public Layout Styles (Persuade Mode · DESIGN.md) ── */

.public-layout-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--llm4b-color-background);
    color: var(--llm4b-color-text-primary);
    font-family: var(--llm4b-component-typography-font-family);
}

.public-skip-link {
    position: absolute;
    left: var(--llm4b-spacing-lg);
    top: -100px;
    z-index: calc(var(--llm4b-z-index-appbar) + 10);
    padding: var(--llm4b-spacing-sm) var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-primary);
    color: var(--llm4b-color-contrast-text);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}

.public-skip-link:focus {
    top: var(--llm4b-spacing-md);
}

.public-header {
    position: sticky;
    top: 0;
    z-index: var(--llm4b-z-index-appbar);
    background: var(--llm4b-color-appbar-background);
    backdrop-filter: blur(var(--llm4b-blur-md)) saturate(1.6);
    -webkit-backdrop-filter: blur(var(--llm4b-blur-md)) saturate(1.6);
    border-bottom: 1px solid var(--llm4b-color-border-subtle);
}

.public-header-content {
    max-width: 1200px;
    min-height: var(--llm4b-component-layout-appbar-height);
    margin: 0 auto;
    padding: 0 var(--llm4b-spacing-2xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-lg);
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
    text-decoration: none;
    color: var(--llm4b-color-text-heading);
    flex-shrink: 0;
}

.public-brand-monogram {
    width: 30px;
    height: 30px;
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    color: var(--llm4b-color-primary);
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.95rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.brand-name {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: var(--llm4b-component-typography-h4-font-size);
    font-weight: 700;
    letter-spacing: var(--llm4b-component-typography-heading-letter-spacing);
    color: var(--llm4b-color-text-heading);
    line-height: 1;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-2xl);
}

.nav-link {
    color: var(--llm4b-color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: var(--llm4b-spacing-xs) 0;
    text-underline-offset: 6px;
    text-decoration-thickness: 1.5px;
    transition: color 0.18s ease-out;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--llm4b-color-text-heading);
    text-decoration: underline;
    text-decoration-color: var(--llm4b-color-primary);
}

.public-header-actions {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
    flex-shrink: 0;
}

.public-theme-toggle {
    color: var(--llm4b-color-text-secondary) !important;
}

.public-theme-toggle:hover {
    color: var(--llm4b-color-text-heading) !important;
}

.sign-in-btn,
.early-access-btn,
.hero-btn-primary,
.hero-btn-secondary,
.cta-btn {
    text-transform: none !important;
    font-weight: 600 !important;
    border-radius: var(--llm4b-radius-sm) !important;
}

.sign-in-btn,
.hero-btn-secondary {
    border-color: var(--llm4b-color-border-strong) !important;
    color: var(--llm4b-color-text-heading) !important;
}

.sign-in-btn:hover,
.hero-btn-secondary:hover {
    border-color: var(--llm4b-color-primary) !important;
    background-color: var(--llm4b-color-accent-soft) !important;
}

.public-main-content {
    flex: 1;
    scroll-margin-top: var(--llm4b-component-layout-appbar-height);
}

/* Landing Bands & Hero (NeuraLex Cool Slate + Deep Pine · DESIGN.md §1 & §3.7) */
.landing-page-root {
    width: 100%;
}

.landing-band {
    position: relative;
    width: 100%;
    padding: var(--llm4b-spacing-4xl) 0;
    border-top: 1px solid var(--llm4b-color-divider);
    scroll-margin-top: var(--llm4b-component-layout-appbar-height);
}

.landing-band--hero {
    border-top: none;
    background: linear-gradient(180deg, var(--llm4b-color-surface) 0%, var(--llm4b-color-background) 100%);
    padding: calc(var(--llm4b-spacing-4xl) + var(--llm4b-spacing-3xl)) 0;
    overflow: hidden;
}

.landing-band--canvas {
    background-color: var(--llm4b-color-background);
}

.landing-band--surface {
    background-color: var(--llm4b-color-surface);
}

.landing-band-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--llm4b-spacing-2xl);
}

.hero-section {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--llm4b-color-grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--llm4b-color-grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 75% at 35% 45%, var(--llm4b-color-base-black) 35%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 75% at 35% 45%, var(--llm4b-color-base-black) 35%, transparent 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--llm4b-spacing-xs);
    padding: 5px var(--llm4b-spacing-md);
    border-radius: var(--llm4b-radius-pill);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    color: var(--llm4b-color-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: var(--llm4b-spacing-xl);
}

.hero-title {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: clamp(2.35rem, 4.6vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--llm4b-color-text-heading);
    text-wrap: balance;
    margin: 0 0 var(--llm4b-spacing-lg) 0;
}

.hero-title-accent {
    color: var(--llm4b-color-primary);
}

.hero-subtitle {
    max-width: 64ch;
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--llm4b-color-text-primary);
    margin: 0 0 var(--llm4b-spacing-2xl) 0;
}

.hero-subtitle strong {
    color: var(--llm4b-color-text-heading);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--llm4b-spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--llm4b-spacing-2xl);
}

.hero-btn-primary,
.hero-btn-secondary,
.cta-btn {
    min-height: 44px;
    padding: 0 var(--llm4b-spacing-2xl) !important;
}

.hero-cloud-badges {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--llm4b-spacing-md);
    flex-wrap: wrap;
}

.badge-label {
    font-size: 0.78rem;
    color: var(--llm4b-color-text-secondary);
    font-weight: 600;
}

.badges-row {
    display: flex;
    gap: var(--llm4b-spacing-sm);
    flex-wrap: wrap;
}

.hero-capability-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--llm4b-spacing-xs);
    padding: 4px var(--llm4b-spacing-md);
    border-radius: var(--llm4b-radius-pill);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-subtle);
    color: var(--llm4b-color-text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.hero-capability-pill .mud-icon-root {
    color: var(--llm4b-color-primary);
}

/* Interactive Pipeline Diagram */
.hero-visual-card {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-card-inner {
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-subtle);
    box-shadow: var(--llm4b-shadow-subtle);
    border-radius: var(--llm4b-radius-md);
    overflow: hidden;
}

.card-header-bar {
    background-color: var(--llm4b-color-surface-alt);
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-md);
    border-bottom: 1px solid var(--llm4b-color-divider);
    flex-wrap: wrap;
}

.card-title {
    font-size: 0.8125rem;
    color: var(--llm4b-color-text-heading);
    font-family: var(--llm4b-component-typography-mono-font-family);
    font-weight: 500;
}

.canvas-live-pill {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--llm4b-color-primary);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    border-radius: var(--llm4b-radius-pill);
    padding: 3px var(--llm4b-spacing-md);
}

.canvas-stage {
    padding: var(--llm4b-spacing-2xl) var(--llm4b-spacing-xl) var(--llm4b-spacing-xl) var(--llm4b-spacing-xl);
    background-color: var(--llm4b-color-background);
    background-image: radial-gradient(var(--llm4b-color-divider) 1px, transparent 1px);
    background-size: 20px 20px;
}

.pipeline-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-xs);
    padding: var(--llm4b-spacing-xs) 0 var(--llm4b-spacing-lg) 0;
}

.pipeline-node {
    flex: 1 1 0;
    min-width: 148px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--llm4b-spacing-xs);
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-subtle);
    color: var(--llm4b-color-text-primary);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease-out, background-color 0.18s ease-out;
}

.pipeline-node:hover {
    border-color: var(--llm4b-color-accent-border);
}

.pipeline-node.is-selected {
    border-color: var(--llm4b-color-primary);
    background-color: var(--llm4b-color-accent-soft);
}

.pipeline-node-head {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
    width: 100%;
}

.pipeline-node-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--llm4b-radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--llm4b-color-surface-alt);
    border: 1px solid var(--llm4b-color-divider);
    color: var(--llm4b-color-text-secondary);
}

.pipeline-node.is-selected .pipeline-node-icon {
    background-color: var(--llm4b-color-accent-soft);
    border-color: var(--llm4b-color-accent-border);
    color: var(--llm4b-color-primary);
}

.pipeline-node-kind {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--llm4b-color-text-secondary);
}

.pipeline-node.is-selected .pipeline-node-kind {
    color: var(--llm4b-color-primary);
}

.pipeline-node-title {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
    line-height: 1.25;
}

.pipeline-node-meta {
    font-size: 0.78rem;
    color: var(--llm4b-color-text-secondary);
}

.pipeline-wire {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    position: relative;
    flex-shrink: 0;
}

.wire-line {
    width: 100%;
    height: 1.5px;
    background-color: var(--llm4b-color-border-strong);
}

.wire-label {
    margin-top: var(--llm4b-spacing-xs);
    font-size: 0.7rem;
    font-family: var(--llm4b-component-typography-mono-font-family);
    color: var(--llm4b-color-text-secondary);
    background-color: var(--llm4b-color-surface);
    padding: 1px 6px;
    border-radius: var(--llm4b-radius-xs);
    border: 1px solid var(--llm4b-color-divider);
}

.wire-arrow {
    position: absolute;
    top: -11px;
    right: -1px;
    color: var(--llm4b-color-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.pipeline-inspector {
    margin-top: var(--llm4b-spacing-sm);
    padding: var(--llm4b-spacing-lg) var(--llm4b-spacing-xl);
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-2xl);
    text-align: left;
    flex-wrap: wrap;
}

.inspector-main {
    flex: 1 1 420px;
}

.inspector-title-row {
    display: flex;
    align-items: baseline;
    gap: var(--llm4b-spacing-md);
    margin-bottom: var(--llm4b-spacing-xs);
    flex-wrap: wrap;
}

.inspector-title {
    margin: 0;
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
}

.inspector-step-count {
    font-family: var(--llm4b-component-typography-mono-font-family);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--llm4b-color-primary);
}

.inspector-desc {
    margin: 0;
    max-width: 68ch;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--llm4b-color-text-primary);
}

.inspector-guarantees {
    display: flex;
    flex-wrap: wrap;
    gap: var(--llm4b-spacing-sm);
    flex: 0 1 360px;
    justify-content: flex-end;
}

.guarantee-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--llm4b-color-text-heading);
    background-color: var(--llm4b-color-surface-alt);
    border: 1px solid var(--llm4b-color-divider);
    padding: 5px var(--llm4b-spacing-md);
    border-radius: var(--llm4b-radius-pill);
}

.guarantee-pill .mud-icon-root {
    color: var(--llm4b-color-primary);
}

/* Section Headers — Editorial left-aligned rhythm matching neuralex.ca & PageScaffold */
.section-header {
    text-align: left;
    max-width: 720px;
    margin: 0 0 var(--llm4b-spacing-3xl) 0;
}

.section-header h2 {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: var(--llm4b-component-typography-heading-letter-spacing);
    color: var(--llm4b-color-text-heading);
    text-wrap: balance;
    margin: 0 0 var(--llm4b-spacing-md) 0;
}

.section-header p {
    color: var(--llm4b-color-text-primary);
    font-size: 1.025rem;
    line-height: 1.65;
    max-width: 65ch;
    margin: 0;
}

/* Unified Icon Box — 1:1 with .llm4b-page-icon-box & neuralex.ca .service-icon */
.icon-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--llm4b-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    color: var(--llm4b-color-primary);
}

/* 2. Why LLM4B Section */
.why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--llm4b-spacing-xl);
}

.why-card {
    padding: var(--llm4b-spacing-2xl);
    border-radius: var(--llm4b-radius-md);
    background-color: var(--llm4b-color-background);
    border: 1px solid var(--llm4b-color-border-subtle);
    box-shadow: var(--llm4b-shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-md);
    transition: border-color 0.18s ease-out;
}

.why-card:hover {
    border-color: var(--llm4b-color-accent-border);
}

.why-card-header {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-md);
}

.why-card-header h3 {
    margin: 0;
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 1.075rem;
    font-weight: 700;
    letter-spacing: var(--llm4b-component-typography-heading-letter-spacing);
    color: var(--llm4b-color-text-heading);
    text-wrap: balance;
}

.why-band {
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-sm);
}

.why-band--gap {
    background-color: var(--llm4b-color-surface-alt);
}

.why-band--solution {
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
}

.why-band-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--llm4b-color-text-secondary);
    margin-bottom: var(--llm4b-spacing-xs);
}

.why-band--solution .why-band-label {
    color: var(--llm4b-color-primary);
}

.why-band p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.58;
    color: var(--llm4b-color-text-primary);
}

.why-band--solution p {
    color: var(--llm4b-color-text-heading);
}

/* 3. Platform Highlights */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--llm4b-spacing-xl);
}

.pillar-card {
    padding: var(--llm4b-spacing-2xl);
    border-radius: var(--llm4b-radius-md);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-subtle);
    box-shadow: var(--llm4b-shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-md);
    transition: border-color 0.18s ease-out;
}

.pillar-card:hover {
    border-color: var(--llm4b-color-accent-border);
}

.pillar-card--featured {
    border-top: 2px solid var(--llm4b-color-primary);
}

.pillar-card-head {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-2xs);
}

.pillar-card-head h3 {
    margin: 0;
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: var(--llm4b-component-typography-heading-letter-spacing);
    color: var(--llm4b-color-text-heading);
}

.pillar-subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--llm4b-color-text-secondary);
}

.pillar-body {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--llm4b-color-text-primary);
    flex: 1;
}

.pillar-tags {
    display: flex;
    gap: var(--llm4b-spacing-sm);
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px var(--llm4b-spacing-sm);
    border-radius: var(--llm4b-radius-xs);
    background-color: var(--llm4b-color-surface-alt);
    color: var(--llm4b-color-text-secondary);
    border: 1px solid var(--llm4b-color-divider);
}

/* 4. Use Cases & Ecosystem Integrations */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--llm4b-spacing-lg);
    margin-bottom: var(--llm4b-spacing-2xl);
}

.use-case-card {
    padding: var(--llm4b-spacing-xl);
    border-radius: var(--llm4b-radius-md);
    background-color: var(--llm4b-color-background);
    border: 1px solid var(--llm4b-color-border-subtle);
    box-shadow: var(--llm4b-shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-sm);
    transition: border-color 0.18s ease-out;
}

.use-case-card:hover {
    border-color: var(--llm4b-color-accent-border);
}

.use-case-head {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
}

.use-case-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--llm4b-radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    color: var(--llm4b-color-primary);
}

.use-case-head h3 {
    margin: 0;
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
}

.use-case-card p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.58;
    color: var(--llm4b-color-text-primary);
}

.integrations-panel {
    padding: var(--llm4b-spacing-2xl);
    border-radius: var(--llm4b-radius-md);
    background-color: var(--llm4b-color-background);
    border: 1px solid var(--llm4b-color-border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-lg);
}

.integrations-group {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-md);
}

.integrations-group-header {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
}

.integrations-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.integrations-status-dot.live {
    background-color: var(--llm4b-color-primary);
}

.integrations-status-dot.upcoming {
    background-color: var(--llm4b-color-text-secondary);
}

.integrations-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
}

.integrations-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--llm4b-spacing-sm);
}

.integration-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--llm4b-spacing-xs);
    padding: 6px var(--llm4b-spacing-md);
    border-radius: var(--llm4b-radius-pill);
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--llm4b-color-text-heading);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-divider);
}

.integration-pill.upcoming {
    border-style: dashed;
    border-color: var(--llm4b-color-border-strong);
    background-color: var(--llm4b-color-surface-alt);
}

.soon-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--llm4b-color-primary);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    border-radius: var(--llm4b-radius-pill);
    padding: 1px 7px;
}

.integrations-divider {
    height: 1px;
    background-color: var(--llm4b-color-divider);
}

/* 5. Enterprise SSO Section */
.sso-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--llm4b-spacing-2xl);
    align-items: center;
}

.sso-pillars {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-md);
}

.sso-pillar-item {
    display: flex;
    align-items: flex-start;
    gap: var(--llm4b-spacing-lg);
    padding: var(--llm4b-spacing-lg) var(--llm4b-spacing-xl);
    border-radius: var(--llm4b-radius-md);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-subtle);
}

.sso-pillar-item h3 {
    margin: 0 0 var(--llm4b-spacing-xs) 0;
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 1rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
}

.sso-pillar-item p {
    margin: 0;
    font-size: 0.885rem;
    line-height: 1.58;
    color: var(--llm4b-color-text-primary);
}

.sso-diagram-card {
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-strong);
    border-top: 2px solid var(--llm4b-color-primary);
    border-radius: var(--llm4b-radius-md);
    padding: var(--llm4b-spacing-2xl);
}

.diagram-card-header {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
    margin-bottom: var(--llm4b-spacing-lg);
    padding-bottom: var(--llm4b-spacing-md);
    border-bottom: 1px solid var(--llm4b-color-divider);
}

.trust-chain {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-md);
}

.trust-step {
    display: flex;
    align-items: flex-start;
    gap: var(--llm4b-spacing-md);
    padding: var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-surface-alt);
    border: 1px solid var(--llm4b-color-divider);
}

.trust-step-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-divider);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trust-step-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trust-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--llm4b-color-text-secondary);
}

.trust-step-body strong {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.95rem;
    color: var(--llm4b-color-text-heading);
}

.trust-sub {
    font-size: 0.8125rem;
    color: var(--llm4b-color-text-primary);
}

.trust-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
}

.trust-connector span {
    font-size: 0.75rem;
    font-family: var(--llm4b-component-typography-mono-font-family);
    color: var(--llm4b-color-primary);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    border-radius: var(--llm4b-radius-pill);
    padding: 3px var(--llm4b-spacing-md);
}

.trust-split {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--llm4b-spacing-md);
}

.trust-leaf {
    padding: var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-surface-alt);
    border: 1px solid var(--llm4b-color-divider);
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-xs);
}

.trust-leaf strong {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.88rem;
    color: var(--llm4b-color-text-heading);
}

.trust-leaf span {
    font-size: 0.8rem;
    color: var(--llm4b-color-text-primary);
    line-height: 1.48;
}

/* 6. BYOC Section */
.byoc-diagram-wrapper {
    margin-bottom: var(--llm4b-spacing-2xl);
}

.byoc-external-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-md);
    margin-bottom: var(--llm4b-spacing-md);
    flex-wrap: wrap;
}

.byoc-external-node {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-md);
    padding: var(--llm4b-spacing-sm) var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-background);
    border: 1px solid var(--llm4b-color-border-subtle);
}

.byoc-external-node strong {
    display: block;
    font-size: 0.88rem;
    color: var(--llm4b-color-text-heading);
}

.byoc-external-node span {
    display: block;
    font-size: 0.78rem;
    color: var(--llm4b-color-text-secondary);
}

.byoc-boundary-arrow {
    color: var(--llm4b-color-primary);
    font-size: 1.15rem;
    font-weight: 700;
}

.byoc-external-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
    padding: 6px var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-pill);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--llm4b-color-primary);
}

.byoc-perimeter-box {
    padding: var(--llm4b-spacing-2xl);
    border-radius: var(--llm4b-radius-md);
    background-color: var(--llm4b-color-background);
    border: 1.5px dashed var(--llm4b-color-primary);
}

.byoc-perimeter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-md);
    margin-bottom: var(--llm4b-spacing-lg);
    flex-wrap: wrap;
}

.perimeter-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--llm4b-spacing-xs);
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--llm4b-color-primary);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    padding: 4px var(--llm4b-spacing-md);
    border-radius: var(--llm4b-radius-pill);
}

.perimeter-meta {
    font-size: 0.8125rem;
    color: var(--llm4b-color-text-secondary);
}

.byoc-inner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--llm4b-spacing-md);
}

.byoc-component-box {
    padding: var(--llm4b-spacing-lg);
    border-radius: var(--llm4b-radius-sm);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-xs);
}

.byoc-component-box strong {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.92rem;
    color: var(--llm4b-color-text-heading);
}

.byoc-component-box span {
    font-size: 0.825rem;
    line-height: 1.5;
    color: var(--llm4b-color-text-primary);
}

.byoc-steps-grid {
    list-style: none;
    margin: 0 0 var(--llm4b-spacing-3xl) 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--llm4b-spacing-xl);
}

.byoc-step-card {
    padding: var(--llm4b-spacing-xl);
    border-radius: var(--llm4b-radius-md);
    background-color: var(--llm4b-color-background);
    border: 1px solid var(--llm4b-color-border-subtle);
    box-shadow: var(--llm4b-shadow-subtle);
}

.step-number {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--llm4b-component-typography-mono-font-family);
    font-variant-numeric: tabular-nums;
    color: var(--llm4b-color-primary);
    background-color: var(--llm4b-color-accent-soft);
    border: 1px solid var(--llm4b-color-accent-border);
    border-radius: var(--llm4b-radius-xs);
    padding: 2px var(--llm4b-spacing-sm);
    margin-bottom: var(--llm4b-spacing-md);
}

.byoc-step-card h3 {
    margin: 0 0 var(--llm4b-spacing-xs) 0;
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 1rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
}

.byoc-step-card p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.58;
    color: var(--llm4b-color-text-primary);
}

/* Publication Booktabs Comparison Table (DESIGN.md §3.3 — 1:1 with neuralex.ca) */
.landing-booktabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.landing-booktabs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    border-top: 1px solid var(--llm4b-color-border-strong);
    border-bottom: 1px solid var(--llm4b-color-border-strong);
    border-left: none;
    border-right: none;
    border-radius: var(--llm4b-radius-none);
    background-color: transparent;
    font-variant-numeric: tabular-nums;
}

.landing-booktabs-table thead th {
    background-color: var(--llm4b-color-surface-alt);
    color: var(--llm4b-color-text-heading);
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    border-bottom: 1px solid var(--llm4b-color-border-strong);
    vertical-align: bottom;
}

.landing-booktabs-table tbody td {
    padding: var(--llm4b-spacing-lg);
    border-bottom: 1px solid var(--llm4b-color-divider);
    font-size: 0.9rem;
    line-height: 1.52;
    color: var(--llm4b-color-text-primary);
    vertical-align: middle;
}

.landing-booktabs-table tbody tr:last-child td {
    border-bottom: none;
}

.landing-booktabs-table tbody tr:hover td {
    background-color: var(--llm4b-color-table-hover);
}

.landing-booktabs-table td strong {
    color: var(--llm4b-color-text-heading);
    font-weight: 600;
}

.landing-booktabs-table .highlight-col {
    background-color: var(--llm4b-color-accent-soft);
}

.landing-booktabs-table thead th.highlight-col {
    color: var(--llm4b-color-primary);
}

.landing-booktabs-table tbody td.highlight-col {
    color: var(--llm4b-color-text-heading);
}

.comparison-check {
    display: inline-flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
}

/* 7. Bottom CTA Banner */
.cta-banner-section {
    padding: var(--llm4b-spacing-3xl) 0 var(--llm4b-spacing-lg) 0;
}

.cta-card {
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-strong);
    border-top: 2px solid var(--llm4b-color-primary);
    border-radius: var(--llm4b-radius-md);
    padding: var(--llm4b-spacing-4xl) var(--llm4b-spacing-2xl);
    text-align: center;
}

.cta-content {
    max-width: 660px;
    margin: 0 auto;
}

.cta-title {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: clamp(1.5rem, 2.8vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: var(--llm4b-component-typography-heading-letter-spacing);
    color: var(--llm4b-color-text-heading);
    text-wrap: balance;
    margin: 0 0 var(--llm4b-spacing-md) 0;
}

.cta-subtitle {
    font-size: 1.025rem;
    line-height: 1.6;
    color: var(--llm4b-color-text-primary);
    margin: 0 0 var(--llm4b-spacing-2xl) 0;
}

.cta-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--llm4b-spacing-md);
    flex-wrap: wrap;
}

/* Footer */
.public-footer {
    background-color: var(--llm4b-color-surface);
    border-top: 1px solid var(--llm4b-color-divider);
    padding: var(--llm4b-spacing-4xl) var(--llm4b-spacing-2xl) var(--llm4b-spacing-2xl) var(--llm4b-spacing-2xl);
}

.public-footer-content {
    max-width: 1200px;
    margin: 0 auto var(--llm4b-spacing-3xl) auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--llm4b-spacing-3xl);
}

.footer-brand-section .footer-tagline {
    color: var(--llm4b-color-text-secondary);
    font-size: 0.875rem;
    line-height: 1.65;
    margin: var(--llm4b-spacing-md) 0 0 0;
    max-width: 38ch;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--llm4b-spacing-2xl);
}

.footer-column h4 {
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--llm4b-color-text-heading);
    margin: 0 0 var(--llm4b-spacing-md) 0;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: var(--llm4b-spacing-sm);
}

.footer-column a,
.footer-link-btn {
    color: var(--llm4b-color-text-secondary);
    text-decoration: none;
    font-family: var(--llm4b-component-typography-font-family);
    font-size: 0.875rem;
    background: transparent;
    border: none;
    padding: 2px 0;
    cursor: pointer;
    text-align: left;
    transition: color 0.18s ease-out;
}

.footer-column a:hover,
.footer-link-btn:hover {
    color: var(--llm4b-color-primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: var(--llm4b-spacing-2xl);
    border-top: 1px solid var(--llm4b-color-divider);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--llm4b-spacing-md);
}

.footer-tech-stack {
    display: flex;
    gap: var(--llm4b-spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.tech-tag {
    font-size: 0.78rem;
    color: var(--llm4b-color-text-secondary);
    background-color: var(--llm4b-color-surface-alt);
    padding: 3px var(--llm4b-spacing-sm);
    border-radius: var(--llm4b-radius-xs);
    border: 1px solid var(--llm4b-color-divider);
}

.copyright {
    font-size: 0.8125rem;
    color: var(--llm4b-color-text-secondary);
    margin: 0;
    text-align: center;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .pillars-grid,
    .use-cases-grid,
    .byoc-inner-grid,
    .byoc-steps-grid,
    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sso-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .public-main-content,
    .landing-band {
        scroll-margin-top: calc(var(--llm4b-component-layout-appbar-height) + var(--llm4b-spacing-4xl));
    }

    .landing-band--hero {
        padding: var(--llm4b-spacing-4xl) 0;
    }

    .public-header-content {
        padding: var(--llm4b-spacing-sm) var(--llm4b-spacing-lg);
        flex-wrap: wrap;
    }

    .public-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: var(--llm4b-spacing-lg);
        overflow-x: auto;
        padding-top: var(--llm4b-spacing-xs);
        border-top: 1px solid var(--llm4b-color-border-subtle);
    }

    .nav-link {
        white-space: nowrap;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .why-grid,
    .pillars-grid,
    .use-cases-grid,
    .byoc-inner-grid,
    .byoc-steps-grid,
    .trust-split,
    .public-footer-content,
    .footer-links-grid {
        grid-template-columns: 1fr;
    }

    .inspector-guarantees {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .pipeline-flow {
        flex-direction: column;
        align-items: stretch;
        gap: var(--llm4b-spacing-xs);
    }

    .pipeline-node {
        min-width: 0;
        width: 100%;
        min-height: 64px;
    }

    .pipeline-wire {
        flex-direction: row;
        gap: var(--llm4b-spacing-sm);
        min-width: 0;
        padding: 2px 0;
    }

    .wire-line {
        display: none;
    }

    .wire-arrow {
        position: static;
        transform: rotate(90deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pipeline-node,
    .pillar-card,
    .use-case-card,
    .nav-link,
    .footer-column a,
    .footer-link-btn {
        transition: none;
    }

    .pipeline-node:hover {
        transform: none;
    }
}

/* ── Shared Help Popover (portaled by MudPopoverProvider) ── */
.llm4b-help-overlay {
    z-index: calc(var(--llm4b-z-index-popover) - 10);
}

.llm4b-help-popover {
    width: 280px;
    max-width: 90vw;
    z-index: var(--llm4b-z-index-popover);
    margin-top: var(--llm4b-spacing-sm);
}

.llm4b-help-popover__body {
    font-size: var(--llm4b-component-typography-caption-font-size);
    color: var(--mud-palette-text-primary);
}

.llm4b-help-popover__heading {
    font-weight: 700;
    font-size: var(--llm4b-component-typography-compact-font-size);
}

.llm4b-help-popover__text {
    font-size: var(--llm4b-component-typography-caption-font-size);
    line-height: 1.4;
}

/* ── Node Settings Dialog & Help Popover Portals (mud-popover-provider) ── */
.node-settings-flow-menu__label {
    display: block;
    color: var(--llm4b-color-text-secondary);
}

.node-help-overlay {
    z-index: calc(var(--llm4b-z-index-popover) - 10);
}

.node-help-popover {
    width: 280px;
    max-width: 90vw;
    z-index: var(--llm4b-z-index-popover);
    margin-top: var(--llm4b-spacing-sm);
}

.node-help-popover--wide {
    width: 320px;
}

.node-help-popover__body {
    width: 280px;
    max-width: 90vw;
    font-size: var(--llm4b-component-typography-caption-font-size);
    color: var(--llm4b-color-text-primary);
    white-space: normal;
}

.node-help-popover--wide .node-help-popover__body {
    width: 100%;
    text-transform: none;
    text-align: left;
}

.node-help-popover__heading {
    font-weight: 700;
    font-size: var(--llm4b-component-typography-compact-font-size);
}

.node-help-popover__subheading {
    font-weight: 700;
    font-size: var(--llm4b-component-typography-caption-font-size);
}

.node-help-popover__text {
    font-size: var(--llm4b-component-typography-caption-font-size);
    line-height: 1.4;
}

.node-help-popover__example {
    font-family: var(--llm4b-component-typography-mono-font-family);
    font-size: var(--llm4b-component-typography-caption-font-size);
    background-color: var(--llm4b-color-surface-alt);
    padding: var(--llm4b-spacing-sm);
    border-radius: var(--llm4b-radius-xs);
    line-height: 1.4;
    border: 1px solid var(--llm4b-color-divider);
}

/* ── Portaled Notebook Studio Help Popover (mud-popover-provider) ── */
.node-help-popover--notebook {
    width: 360px;
    max-width: 92vw;
    z-index: var(--llm4b-z-index-popover);
    margin-top: var(--llm4b-spacing-xs);
}

.node-help-popover--notebook .node-help-popover__body {
    width: 100%;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--llm4b-color-text-primary);
}

.llm4b-nb-help-popover {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-sm);
}

.llm4b-nb-help-popover__section {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-xs);
}

.llm4b-nb-help-popover__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--llm4b-color-text-heading);
    margin: 0;
}

.llm4b-nb-help-popover__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--llm4b-spacing-sm);
    font-size: 0.75rem;
    color: var(--llm4b-color-text-primary);
}

.llm4b-nb-help-popover__kbd,
.llm4b-nb-help-popover__code {
    font-family: var(--llm4b-component-typography-mono-font-family);
    font-size: 0.75rem;
    background-color: var(--llm4b-color-surface-alt);
    color: var(--llm4b-color-text-heading);
    border: 1px solid var(--llm4b-color-divider);
    border-radius: var(--llm4b-radius-xs);
    padding: 1px var(--llm4b-spacing-xs);
    white-space: nowrap;
}

.llm4b-nb-help-popover__note {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--llm4b-color-text-secondary);
}

/* ── NeuraLex Cool Slate + Deep Pine Craft Layer (DESIGN.md / Operate & Read Modes) ── */
::selection {
    background-color: var(--llm4b-color-accent-soft);
    color: var(--llm4b-color-text-heading);
}

:focus-visible {
    outline: 2px solid var(--llm4b-color-primary);
    outline-offset: var(--llm4b-spacing-2xs);
}

h1:focus,
h1:focus-visible,
[tabindex="-1"]:focus-visible {
    outline: none;
}

.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4 {
    color: var(--llm4b-color-text-heading);
    text-wrap: balance;
}

.mud-drawer {
    border-inline-end: 1px solid var(--llm4b-color-border-subtle);
}

/* Full-Width Publication Booktabs MudTable & MudSimpleTable treatment (1:1 with neuralex.ca) */
.mud-table {
    width: 100%;
    border-top: 1px solid var(--llm4b-color-border-strong);
    border-bottom: 1px solid var(--llm4b-color-border-strong);
    border-left: none;
    border-right: none;
    border-radius: var(--llm4b-radius-none);
    background-color: transparent;
    box-shadow: var(--llm4b-shadow-none);
    overflow: visible;
}

.mud-table .mud-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mud-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    line-height: 1.48;
    font-variant-numeric: tabular-nums;
}

.mud-table .mud-table-head .mud-table-row,
.mud-table.mud-simple-table thead tr {
    background-color: var(--llm4b-color-surface-alt);
}

.mud-table .mud-table-head .mud-table-cell,
.mud-table.mud-table-dense .mud-table-head .mud-table-row .mud-table-cell,
.mud-table.mud-simple-table thead th,
.mud-table.mud-simple-table.mud-table-dense thead tr th {
    background-color: var(--llm4b-color-surface-alt);
    color: var(--llm4b-color-text-heading);
    font-family: var(--llm4b-component-typography-display-font-family);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    padding: 0.72rem 0.6rem;
    border-bottom: 1px solid var(--llm4b-color-border-strong);
    vertical-align: bottom;
    white-space: normal;
}

.mud-table .mud-table-body .mud-table-cell,
.mud-table.mud-table-dense .mud-table-body .mud-table-row .mud-table-cell,
.mud-table.mud-simple-table tbody td,
.mud-table.mud-simple-table.mud-table-dense tbody tr td {
    padding: 0.68rem 0.6rem;
    border-bottom: 1px solid var(--llm4b-color-divider);
    color: var(--llm4b-color-text-primary);
    font-size: 0.8125rem;
    line-height: 1.48;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.mud-table:not(:has(.mud-table-pagination)) .mud-table-body:last-child .mud-table-row:last-child .mud-table-cell,
.mud-table.mud-simple-table tbody:last-child tr:last-child td {
    border-bottom: none;
}

.mud-table.mud-table-hover .mud-table-body .mud-table-row:hover .mud-table-cell,
.mud-table.mud-table-hover.mud-simple-table tbody tr:hover td {
    background-color: var(--llm4b-color-table-hover);
}

.mud-table td code,
.mud-table th code {
    font-family: var(--llm4b-component-typography-mono-font-family);
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--llm4b-color-table-code-text);
}

.mud-table th code {
    white-space: normal;
    word-break: normal;
}

.mud-table td code {
    white-space: nowrap;
    word-break: normal;
}

.mud-table td strong {
    color: var(--llm4b-color-text-heading);
    font-weight: 600;
}

.mud-table td strong code {
    color: var(--llm4b-color-text-heading);
    font-weight: 600;
}

/* Calm tokenized scrollbars (craft-floor.md browser surfaces) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--llm4b-color-divider) transparent;
}

/* Accessibility visually-hidden status & table header utility */
.llm4b-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Portaled LLM Preset Used By / Details popovers inside MudPopoverProvider */
.mud-popover.mud-tooltip {
    pointer-events: none;
}

.llm4b-llm-presets__usedby-popover {
    width: 320px;
    max-width: 90vw;
    z-index: var(--llm4b-z-index-popover);
}

.llm4b-llm-presets__usedby-popover-list {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-xs);
}

.llm4b-llm-presets__detail-grid {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-xs);
}

.llm4b-llm-presets__detail-row {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-2xs);
}

.llm4b-llm-presets__detail-mono {
    font-family: var(--llm4b-component-typography-mono-font-family);
    word-break: break-word;
}

/* Portaled Notification Bell Popover & Overlay (inside MudPopoverProvider) */
.llm4b-notif-overlay {
    z-index: calc(var(--llm4b-z-index-popover) - 10);
}

.llm4b-notif-popover {
    width: clamp(320px, 90vw, 400px);
    z-index: var(--llm4b-z-index-popover);
    margin-top: var(--llm4b-spacing-sm);
    background-color: var(--llm4b-color-surface);
    border: 1px solid var(--llm4b-color-border-subtle);
    border-radius: var(--llm4b-component-card-border-radius);
    box-shadow: var(--llm4b-shadow-elevated);
    overflow: hidden;
}

.llm4b-notif-popover__shell {
    display: flex;
    flex-direction: column;
    outline: none;
}

.llm4b-notif-popover__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-sm);
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    background-color: var(--llm4b-color-surface);
    border-bottom: 1px solid var(--llm4b-color-divider);
}

.llm4b-notif-popover__body {
    max-height: min(420px, 60vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.llm4b-notif-popover__skeleton-list {
    display: flex;
    flex-direction: column;
}

.llm4b-notif-popover__skeleton-row {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-xs);
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    border-bottom: 1px solid var(--llm4b-color-divider);
}

.llm4b-notif-popover__skeleton-row:last-child {
    border-bottom: none;
}

.llm4b-notif-popover__error {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--llm4b-spacing-sm);
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
}

.llm4b-notif-popover__empty {
    padding: var(--llm4b-spacing-md);
}

.llm4b-notif-popover__list {
    display: flex;
    flex-direction: column;
}

.llm4b-notif-popover__item {
    display: flex;
    align-items: flex-start;
    gap: var(--llm4b-spacing-sm);
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    border-bottom: 1px solid var(--llm4b-color-divider);
    background-color: var(--llm4b-color-surface);
    transition: background-color 180ms ease-out;
}

.llm4b-notif-popover__item:last-child {
    border-bottom: none;
}

.llm4b-notif-popover__item--unread {
    background-color: color-mix(in srgb, var(--llm4b-color-primary) 5%, var(--llm4b-color-surface));
}

.llm4b-notif-popover__item:hover {
    background-color: var(--llm4b-color-table-hover);
}

.llm4b-notif-popover__item-main {
    display: flex;
    align-items: flex-start;
    gap: var(--llm4b-spacing-sm);
    flex: 1 1 auto;
    min-width: 0;
    border-radius: var(--llm4b-radius-xs);
}

.llm4b-notif-popover__item-main--interactive {
    cursor: pointer;
}

.llm4b-notif-popover__indicators {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-xs);
    padding-top: var(--llm4b-spacing-2xs);
    flex: 0 0 auto;
}

.llm4b-notif-popover__unread-dot {
    width: var(--llm4b-spacing-sm);
    height: var(--llm4b-spacing-sm);
    border-radius: var(--llm4b-radius-pill);
    background-color: var(--llm4b-color-primary);
    flex: 0 0 auto;
}

.llm4b-notif-popover__unread-dot--hidden {
    background-color: transparent;
}

.llm4b-notif-popover__content {
    display: flex;
    flex-direction: column;
    gap: var(--llm4b-spacing-xs);
    min-width: 0;
    flex: 1 1 auto;
}

.llm4b-notif-popover__title {
    font-size: 0.875rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--llm4b-color-text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.llm4b-notif-popover__item--unread .llm4b-notif-popover__title {
    font-weight: 600;
}

.llm4b-notif-popover__message {
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--llm4b-color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.llm4b-notif-popover__meta {
    display: flex;
    align-items: center;
    gap: var(--llm4b-spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--llm4b-spacing-2xs);
}

.llm4b-notif-popover__topic-chip {
    font-size: 0.75rem;
    margin: 0;
}

.llm4b-notif-popover__timestamp {
    font-size: 0.75rem;
    color: var(--llm4b-color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.llm4b-notif-popover__item-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.llm4b-notif-popover__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--llm4b-spacing-sm);
    padding: var(--llm4b-spacing-md) var(--llm4b-spacing-lg);
    background-color: var(--llm4b-color-surface);
    border-top: 1px solid var(--llm4b-color-divider);
}

@media (prefers-reduced-motion: reduce) {
    .status-running::before {
        animation: none;
    }

    .llm4b-notif-popover__item {
        transition: none;
    }
}