/* TheTechIdea clean terminal theme.
   Visual values come from BrandingConfig -> MudTheme CSS variables. */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--mud-typography-default-family);
    font-size: var(--mud-typography-default-size, 14px);
    line-height: var(--mud-typography-default-lineheight, 1.55);
    letter-spacing: 0;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
}

.font-mono,
.terminal-copy,
.terminal-label,
.terminal-command,
.terminal-panel,
.terminal-panel-flat,
.terminal-card,
.terminal-list-row,
.terminal-code,
.terminal-kpi,
.terminal-hero-title {
    font-family: var(--mud-typography-default-family);
    letter-spacing: 0;
}

.terminal-muted {
    color: var(--mud-palette-text-secondary);
}

.terminal-copy,
.terminal-label,
.terminal-command,
.terminal-command-muted {
    overflow-wrap: anywhere;
}

.terminal-accent {
    color: var(--mud-palette-primary);
}

.terminal-info {
    color: var(--mud-palette-info);
}

.terminal-warning {
    color: var(--mud-palette-warning);
}

.terminal-danger {
    color: var(--mud-palette-error);
}

.terminal-page {
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    min-height: 100vh;
}

.terminal-page .mud-input,
.terminal-page .mud-input-control,
.terminal-page .mud-select,
.terminal-page .mud-button,
.terminal-page .mud-chip,
.terminal-page .mud-table,
.terminal-page .mud-expansion-panel,
.terminal-page .mud-tabs,
.terminal-page .mud-typography {
    letter-spacing: 0;
}

.terminal-shell {
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    min-height: 100vh;
}

.terminal-section {
    padding-block: 3rem;
}

.terminal-page-title {
    color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-default-family);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.terminal-page-subtitle {
    color: var(--mud-palette-text-secondary);
    font-family: var(--mud-typography-default-family);
    max-width: 72ch;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.terminal-title-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.terminal-page-header {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    box-shadow: none;
}

.terminal-breadcrumb {
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    color: var(--mud-palette-text-secondary);
}

.terminal-hero {
    background: var(--mud-palette-background);
    border-bottom: 1px solid var(--mud-palette-divider);
    padding-block: 3.5rem;
}

.terminal-hero-grid {
    align-items: center;
}

.terminal-hero-title {
    color: var(--mud-palette-text-primary);
    font-size: 2.65rem;
    font-weight: 700;
    line-height: 1.12;
    margin: 0;
    max-width: 18ch;
    overflow-wrap: anywhere;
}

.terminal-hero-subtitle {
    color: var(--mud-palette-text-secondary);
    max-width: 64ch;
    line-height: 1.7;
}

.terminal-panel,
.terminal-panel-flat,
.terminal-card,
.terminal-code,
.terminal-list-row,
.terminal-state-panel,
.terminal-pricing-card,
.terminal-form-panel,
.terminal-table-shell,
.terminal-cta-panel {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    box-shadow: none;
}

.terminal-panel,
.terminal-card,
.terminal-code,
.terminal-form-panel,
.terminal-pricing-card,
.terminal-table-shell,
.terminal-cta-panel {
    background: var(--mud-palette-surface);
}

.terminal-panel-flat,
.terminal-list-row,
.terminal-state-panel {
    background: var(--mud-palette-background);
}

.terminal-danger-panel {
    border-color: var(--mud-palette-error);
}

.terminal-success-panel {
    border-color: var(--mud-palette-primary);
}

.terminal-info-panel {
    border-color: var(--mud-palette-info);
}

.terminal-cta-panel {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 60%, var(--mud-palette-divider));
}

.terminal-panel-header {
    border-bottom: 1px solid var(--mud-palette-divider);
}

.terminal-card {
    transition: border-color 150ms ease-out, background-color 150ms ease-out;
}

.terminal-card,
.terminal-pricing-card,
.terminal-form-panel,
.terminal-state-panel,
.terminal-cta-panel {
    overflow: hidden;
}

.terminal-card:hover,
.terminal-list-row:hover,
.terminal-pricing-card:hover {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 58%, var(--mud-palette-divider));
}

.terminal-card-accent {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 72%, var(--mud-palette-divider));
}

.terminal-card-info {
    border-color: color-mix(in srgb, var(--mud-palette-info) 70%, var(--mud-palette-divider));
}

.terminal-card-warning {
    border-color: color-mix(in srgb, var(--mud-palette-warning) 70%, var(--mud-palette-divider));
}

.dev-card {
    transition: border-color 150ms ease-out, background-color 150ms ease-out;
    border: 1px solid var(--mud-palette-divider);
}

.dev-card:hover {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 58%, var(--mud-palette-divider));
}

/* Fake terminal window chrome removed for the professional theme. */
.terminal-window-bar {
    display: none;
}

.terminal-window-title {
    color: var(--mud-palette-text-secondary);
    font-size: 0.72rem;
    margin-left: 0.35rem;
}

.terminal-dot {
    display: none;
}

.terminal-dot.red {
    background: color-mix(in srgb, var(--mud-palette-error) 62%, var(--mud-palette-surface));
}

.terminal-dot.yellow {
    background: color-mix(in srgb, var(--mud-palette-warning) 62%, var(--mud-palette-surface));
}

.terminal-dot.green {
    background: color-mix(in srgb, var(--mud-palette-primary) 62%, var(--mud-palette-surface));
}

.terminal-dot.sm {
    width: 0.42rem;
    height: 0.42rem;
}

.terminal-command {
    color: var(--mud-palette-primary);
    font-size: 0.82rem;
}

.terminal-command-muted {
    color: var(--mud-palette-text-secondary);
    font-family: var(--mud-typography-default-family);
    font-size: 0.82rem;
}

.terminal-pre-wrap {
    white-space: pre-wrap;
}

.terminal-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.72rem;
}

.terminal-code {
    color: var(--mud-palette-text-primary);
    padding: 1rem;
    overflow-x: auto;
    white-space: pre;
}

.terminal-code pre,
pre.terminal-code {
    margin: 0;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: inherit;
    font-size: 0.78rem;
    line-height: 1.7;
}

.terminal-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.terminal-pill {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    line-height: 1.2;
}

.terminal-pill.success {
    color: var(--mud-palette-primary);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 60%, var(--mud-palette-divider));
}

.terminal-pill.info {
    color: var(--mud-palette-info);
    border-color: color-mix(in srgb, var(--mud-palette-info) 60%, var(--mud-palette-divider));
}

.terminal-pill.warning {
    color: var(--mud-palette-warning);
    border-color: color-mix(in srgb, var(--mud-palette-warning) 60%, var(--mud-palette-divider));
}

.terminal-list {
    display: grid;
    gap: 0.75rem;
}

.terminal-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 150ms ease-out;
}

.terminal-kpi {
    color: var(--mud-palette-primary);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.15;
}

.terminal-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface));
    color: var(--mud-palette-primary);
}

.terminal-icon-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface));
    color: var(--mud-palette-primary);
}

.terminal-price {
    color: var(--mud-palette-primary);
    font-family: var(--mud-typography-default-family);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.terminal-rating-score {
    color: var(--mud-palette-primary);
    font-family: var(--mud-typography-default-family);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.terminal-rating-label {
    color: var(--mud-palette-text-secondary);
    width: 2rem;
}

.terminal-rating-count {
    color: var(--mud-palette-text-secondary);
    text-align: right;
    width: 2.5rem;
}

.terminal-rating-bar .mud-progress-linear {
    border-radius: var(--mud-default-borderradius, 6px);
}

.terminal-sort-select {
    width: min(12.5rem, 100%);
}

.terminal-review-card {
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
}

.terminal-form-panel .mud-input-control,
.terminal-form-panel .mud-input,
.terminal-form-panel .mud-select,
.terminal-filter-field .mud-input,
.terminal-filter-select .mud-input {
    font-family: var(--mud-typography-default-family);
}

.terminal-table-shell {
    overflow-x: auto;
}

.terminal-table-shell .mud-table,
.terminal-table-shell table,
.terminal-table {
    background: transparent;
    color: var(--mud-palette-text-primary);
}

.terminal-table-shell th,
.terminal-table-shell .mud-table-cell,
.terminal-table th,
.terminal-table td {
    font-family: var(--mud-typography-default-family);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.terminal-table-shell th,
.terminal-table th {
    color: var(--mud-palette-info);
    background: var(--mud-palette-surface);
    font-weight: 600;
}

.terminal-table-shell td,
.terminal-table td {
    color: var(--mud-palette-text-primary);
}

.terminal-expansion {
    background: transparent;
}

.terminal-expansion .mud-expand-panel,
.terminal-expansion .mud-expansion-panel {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    margin-bottom: 0.5rem;
    box-shadow: none;
}

.terminal-tabs {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    overflow: hidden;
}

.terminal-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
}

.terminal-meta-item {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    background: var(--mud-palette-background);
    padding: 0.85rem;
}

.terminal-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 24rem);
    gap: 1.25rem;
    align-items: start;
}

.terminal-billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    background: var(--mud-palette-background);
    padding: 0.65rem 0.9rem;
}

.terminal-avatar {
    background: color-mix(in srgb, var(--mud-palette-primary) 18%, var(--mud-palette-surface)) !important;
    border: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-primary) !important;
}

.terminal-video-frame {
    aspect-ratio: 16 / 9;
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    overflow: hidden;
}

.terminal-video-frame iframe {
    border: 0;
    display: block;
    height: 100%;
    width: 100%;
}

.terminal-product-image {
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    display: block;
    max-height: 15rem;
    object-fit: contain;
    padding: 1rem;
    width: 100%;
}

.terminal-docs {
    background: var(--mud-palette-background);
    min-height: 100vh;
    padding: 2rem;
}

.documentation-container {
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    min-height: 100vh;
    padding: 2rem;
}

.documentation-content {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    color: var(--mud-palette-text-primary);
    padding: 1.5rem;
    overflow-x: auto;
}

/* Embedded product documentation site (self-contained static HTML rendered in an iframe). */
.documentation-frame {
    width: 100%;
    height: calc(100vh - 220px);
    min-height: 600px;
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 8px);
    background: #ffffff;
}

.documentation-content h1,
.documentation-content h2,
.documentation-content h3,
.documentation-content h4,
.documentation-content h5,
.documentation-content h6,
.documentation-content code,
.documentation-content pre {
    font-family: var(--mud-typography-default-family);
    letter-spacing: 0;
}

.documentation-content a {
    color: var(--mud-palette-info);
}

.documentation-content pre,
.documentation-content code {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
}

.documentation-content h1 {
    border-bottom: 2px solid var(--mud-palette-primary);
    color: var(--mud-palette-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.documentation-content h2 {
    border-bottom: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-info);
    margin-bottom: 0.75rem;
    margin-top: 2rem;
    padding-bottom: 0.35rem;
}

.documentation-content h3 {
    color: var(--mud-palette-text-primary);
    margin-top: 1.5rem;
}

.documentation-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.documentation-content pre {
    overflow-x: auto;
    padding: 1rem;
}

.documentation-content code {
    padding: 0.2rem 0.4rem;
}

.documentation-content pre code {
    border: 0;
    padding: 0;
}

.documentation-content .feature-grid,
.documentation-content .stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin: 1.5rem 0;
}

.documentation-content .feature-card,
.documentation-content .stat-card,
.documentation-content .quick-start,
.documentation-content .documentation-footer {
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    box-shadow: none;
    padding: 1.25rem;
}

.documentation-content .feature-card:hover,
.documentation-content .stat-card:hover {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 58%, var(--mud-palette-divider));
}

.documentation-content table {
    border-collapse: collapse;
    border-radius: var(--mud-default-borderradius, 6px);
    margin: 1.5rem 0;
    overflow: hidden;
    width: 100%;
}

.documentation-content th,
.documentation-content td {
    border-bottom: 1px solid var(--mud-palette-divider);
    padding: 0.75rem;
    text-align: left;
}

.documentation-content th {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-info);
}

.documentation-content .tip,
.documentation-content .note,
.documentation-content .warning,
.documentation-content .success {
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    border-left: 3px solid var(--mud-palette-info);
    border-radius: var(--mud-default-borderradius, 6px);
    margin: 1rem 0;
    padding: 1rem;
}

.documentation-content .note {
    border-left-color: var(--mud-palette-tertiary);
}

.documentation-content .warning {
    border-left-color: var(--mud-palette-warning);
}

.documentation-content .success {
    border-left-color: var(--mud-palette-primary);
}

.documentation-content .btn-beep {
    background: var(--mud-palette-primary);
    border-radius: var(--mud-default-borderradius, 6px);
    color: var(--mud-palette-primary-text);
    display: inline-block;
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.documentation-content .btn-beep:hover {
    background: var(--mud-palette-primary-darken);
    text-decoration: none;
}

.documentation-content .quick-start {
    border-color: color-mix(in srgb, var(--mud-palette-info) 55%, var(--mud-palette-divider));
    margin: 2rem 0;
}

.documentation-content .quick-start-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.documentation-content .documentation-footer {
    border-top: 1px solid var(--mud-palette-divider);
    margin-top: 3rem;
}

.documentation-content .footer-content {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.documentation-content .footer-links a {
    margin-left: 1rem;
}

.terminal-appbar {
    background: var(--mud-palette-appbar-background);
    border-bottom: 1px solid var(--mud-palette-divider);
}

/* Admin tab overrides (moved from AdminUserDetail.razor) */
.mud-tabs-header-custom {
    background-color: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
}
.mud-tab-active-custom {
    color: var(--mud-palette-primary) !important;
    border-bottom: 2px solid var(--mud-palette-primary);
}
.mud-tab {
    color: var(--mud-palette-text-secondary);
    font-family: var(--mud-typography-default-family);
}

.terminal-brand {
    min-width: 0;
    text-transform: none;
}

.terminal-brand-text {
    color: var(--mud-palette-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-search {
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    max-width: 22rem;
    min-width: 15rem;
}

.terminal-drawer {
    background: var(--mud-palette-drawer-background);
    border-right: 1px solid var(--mud-palette-divider);
    overflow-x: hidden;
}

/* Top navigation (primary nav lives on the AppBar; drawer is mobile/overflow only) */
.terminal-topnav {
    gap: 0.15rem;
    margin-left: 0.5rem;
}

.terminal-topnav-link,
.terminal-topnav .mud-button-root {
    text-transform: none;
    font-family: var(--mud-typography-default-family);
    color: var(--mud-palette-text-primary);
    letter-spacing: 0.02em;
}

.terminal-topnav-link:hover,
.terminal-topnav .mud-button-root:hover {
    color: var(--mud-palette-primary);
}

/* Shown only on mobile (the hamburger that opens the overflow drawer) */
.terminal-mobile-only {
    display: none !important;
}

@media (max-width: 960px) {
    .terminal-mobile-only {
        display: inline-flex !important;
    }
}

/* Account area: side rail + content */
.terminal-account-shell {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 1400px;
    margin-inline: auto;
    padding: 1.5rem;
}

.terminal-account-rail {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 4rem;
}

.terminal-account-nav {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
}

.terminal-account-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 960px) {
    .terminal-account-shell {
        flex-direction: column;
        padding: 1rem;
    }

    .terminal-account-rail {
        width: 100%;
        position: static;
    }
}

.terminal-main {
    background: var(--mud-palette-background);
    min-height: 100vh;
}

/* Blazor reconnection overlay (terminal-themed) — hidden until blazor.web.js toggles a state class */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--mud-palette-background) 82%, transparent);
    backdrop-filter: blur(2px);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.terminal-reconnect-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.terminal-reconnect-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--mud-palette-divider);
    border-top-color: var(--mud-palette-primary);
    border-radius: 50%;
    animation: terminal-reconnect-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes terminal-reconnect-spin {
    to { transform: rotate(360deg); }
}

.terminal-reconnect-text {
    display: flex;
    flex-direction: column;
    font-family: var(--mud-typography-default-family);
}

.terminal-reconnect-cmd {
    color: var(--mud-palette-primary);
    font-size: 0.95rem;
}

.terminal-reconnect-sub {
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
}

/* Global footer */
.terminal-footer {
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-divider);
    padding-block: 2.5rem 1.75rem;
    margin-top: 3rem;
}

.terminal-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.terminal-footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.terminal-footer-link {
    color: var(--mud-palette-text-secondary);
    font-family: var(--mud-typography-default-family);
    font-size: 0.85rem;
}

.terminal-footer-link:hover {
    color: var(--mud-palette-primary);
}

.terminal-footer-social {
    display: flex;
    gap: 0.25rem;
}

.terminal-footer-baseline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 960px) {
    .terminal-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .terminal-footer-grid {
        grid-template-columns: 1fr;
    }
}

.terminal-nav-shell {
    width: 250px;
    background: transparent;
    max-width: 100%;
    overflow-x: hidden;
}

.terminal-drawer .mud-drawer-content {
    overflow-x: hidden;
}

.terminal-nav-header,
.terminal-nav-footer {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
}

.terminal-nav-menu,
.terminal-nav-menu .mud-nav-link,
.terminal-nav-menu .mud-nav-link-text,
.terminal-nav-menu .mud-nav-group .mud-nav-link-text,
.terminal-nav-menu .mud-nav-group .mud-nav-group {
    font-family: var(--mud-typography-default-family);
    letter-spacing: 0;
}

.terminal-admin-panel {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-tertiary);
    border-radius: var(--mud-default-borderradius, 6px);
}

.terminal-admin-label {
    color: var(--mud-palette-tertiary);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
}

.terminal-root-chip {
    font-size: 0.55rem;
    height: 1rem;
}

.terminal-filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.terminal-filter-field {
    max-width: 20rem;
    min-width: 14rem;
}

.terminal-filter-select {
    max-width: 13rem;
    min-width: 11rem;
}

.terminal-pagination .mud-pagination-item {
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-text-secondary);
    font-family: var(--mud-typography-default-family);
}

.terminal-pagination .mud-pagination-item-selected {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.terminal-dialog .mud-dialog {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    box-shadow: none;
}

.terminal-dialog .mud-dialog-title {
    border-bottom: 1px solid var(--mud-palette-divider);
}

.terminal-dialog .mud-dialog-actions {
    border-top: 1px solid var(--mud-palette-divider);
}

/* Blinking terminal cursor removed for the professional theme. */
.cursor-blink::after {
    content: none;
}

.code-text,
kbd {
    font-family: var(--mud-typography-default-family);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
    color: var(--mud-palette-primary);
    padding: 0.1rem 0.35rem;
}

blockquote {
    border-block: 1px solid var(--mud-palette-divider);
    margin: 1rem 0;
    padding: 1rem 1.25rem;
}

hr {
    border: none;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 1.5rem 0;
}

mark {
    background: color-mix(in srgb, var(--mud-palette-primary) 22%, transparent);
    color: var(--mud-palette-text-primary);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--mud-palette-background);
}

::-webkit-scrollbar-thumb {
    background: var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 6px);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mud-palette-primary);
}

.mud-nav-link:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent) !important;
}

@media (max-width: 960px) {
    .terminal-desktop-only {
        display: none !important;
    }

    .terminal-search {
        min-width: 0;
        max-width: 10rem;
        padding-inline: 0.35rem !important;
    }

    .terminal-brand-text {
        max-width: 9rem;
    }

    .terminal-hero-title {
        font-size: 2.25rem;
        max-width: 100%;
    }

    .terminal-section {
        padding-block: 2.5rem;
    }

    .terminal-hero {
        padding-block: 2.75rem;
    }
}

@media (max-width: 600px) {
    .terminal-mobile-hidden {
        display: none !important;
    }

    .terminal-search {
        display: none !important;
    }

    .terminal-section,
    .terminal-hero {
        padding-block: 1.5rem;
    }

    .terminal-hero-title {
        font-size: 2rem;
    }

    .terminal-kpi {
        font-size: 1.45rem;
    }

    .terminal-list-row {
        grid-template-columns: 1fr;
    }

    .terminal-filter-field,
    .terminal-filter-select {
        max-width: none;
        width: 100%;
    }

    .terminal-filter-row {
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   TermilUI additions — body grid + scanlines + vignette
   Inspired by openmonoagent.ai. Subtle effects MudBlazor can't do.
   ============================================================ */

/* Dot-grid overlay on the body background */
body::before {
    content: "";
    pointer-events: none;
    z-index: 0;
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(110, 255, 138, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 255, 138, 0.02) 1px, transparent 1px);
    background-position: -1px -1px;
    background-size: 48px 48px;
}

/* Scanline overlay */
body::after {
    content: "";
    pointer-events: none;
    z-index: 1;
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.06) 3px,
        transparent 4px
    );
}

/* Edge vignette removed for the professional light theme. */
.terminal-main::before {
    content: none;
}

/* ============================================================
   Section eyebrow + heading pattern (professional label style)
   ============================================================ */

.terminal-eyebrow {
    color: var(--mud-palette-primary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-family: var(--mud-typography-default-family);
}

.terminal-eyebrow::before {
    content: none;
}

.terminal-section-heading {
    font-family: var(--mud-typography-default-family);
    font-size: clamp(1.85rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    color: var(--mud-palette-text-primary);
}

.terminal-section-heading em {
    color: var(--mud-palette-primary);
    font-family: inherit;
    font-style: normal;
    font-weight: 700;
}

.terminal-section-intro {
    color: var(--mud-palette-text-secondary);
    font-size: 1.05rem;
    max-width: 40rem;
    line-height: 1.65;
    margin-bottom: 2.5rem;
}

@media (max-width: 600px) {
    .terminal-eyebrow {
        font-size: 0.62rem;
        gap: 0.5rem;
    }
    .terminal-eyebrow::before {
        width: 1.25rem;
    }
    .terminal-section-heading {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
}

/* ============================================================
   TermilUI — terminal syntax text spans
   Matches openmonoagent.ai terminal body (.prompt, .cmd, ...)
   ============================================================ */

/* Fake shell "$" prompt removed for the professional theme. */
.terminal-prompt {
    display: none;
}

.terminal-cmd {
    color: var(--mud-palette-text-primary);
}

.terminal-comment {
    color: var(--mud-palette-text-secondary);
    font-style: italic;
}

.terminal-output {
    color: var(--mud-palette-text-secondary);
}

.terminal-ok {
    color: var(--mud-palette-primary);
}

.terminal-warn {
    color: var(--mud-palette-warning);
}

/* Blinking caret removed for the professional theme. */
.terminal-cursor {
    display: none;
}

/* ============================================================
   TermilUI — scroll-reveal animation
   ============================================================ */

/* Content is always visible — no JS-gated reveal. (A prior IntersectionObserver hid these
   until scrolled into view but never re-ran after Blazor enhanced navigation, blanking pages
   reached via nav links.) The .in class is retained as a harmless no-op so markup needn't change. */
.terminal-reveal {
    opacity: 1;
    transform: none;
}

.terminal-reveal.in {
    opacity: 1;
    transform: none;
}

/* ============================================================
   TermilUI — hero top-line badge (animated dot + tagline)
   ============================================================ */

.terminal-hero-topline {
    color: var(--mud-palette-primary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 35%, transparent);
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1.5rem;
    font-family: var(--mud-typography-default-family);
}

.terminal-hero-topline .dot {
    background: var(--mud-palette-primary);
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
}

/* ============================================================
   TermilUI — feature card grid (3-col bordered, openmonoagent style)
   ============================================================ */

.terminal-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--mud-palette-divider);
    border-left: 1px solid var(--mud-palette-divider);
}

.terminal-feature-card {
    border-right: 1px solid var(--mud-palette-divider);
    border-bottom: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
    padding: 2rem 1.75rem;
    position: relative;
    transition: background 0.2s ease-out;
}

.terminal-feature-card:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
}

.terminal-feature-num {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--mud-palette-text-secondary);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    font-family: var(--mud-typography-default-family);
}

.terminal-feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.6rem;
    color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-default-family);
}

.terminal-feature-card p {
    color: var(--mud-palette-text-secondary);
    font-size: 0.84rem;
    line-height: 1.65;
}

@media (max-width: 900px) {
    .terminal-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .terminal-feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Inline-style replacement utilities (F12 sweep, 2026-08-14)
   --------------------------------------------------------------------------
   Each class is 1:1 with the exact inline declaration block it replaced across
   the components — pure relocation into the central stylesheet, no visual
   change intended. Prefer these (or the terminal-* system above) over any new
   inline Style="…" — the styling standard forbids new inline styles.
   ========================================================================== */
.t-font { font-family: var(--mud-typography-default-family); }
.t-text { color: var(--mud-palette-text-primary); }
.t-text-2 { color: var(--mud-palette-text-secondary); }
.t-info { color: var(--mud-palette-info); }
.t-error { color: var(--mud-palette-error); }
.t-warning { color: var(--mud-palette-warning); }
.t-caption { color: var(--mud-palette-text-secondary); font-family: var(--mud-typography-default-family); font-size: 0.75rem; }
.t-muted { color: var(--mud-palette-text-secondary); font-family: var(--mud-typography-default-family); }
.t-muted-sm { color: var(--mud-palette-text-secondary); font-family: var(--mud-typography-default-family); font-size: 0.85rem; }
.t-copy { color: var(--mud-palette-text-primary); font-family: var(--mud-typography-default-family); }
.t-copy-sm { color: var(--mud-palette-text-primary); font-family: var(--mud-typography-default-family); font-size: 0.85rem; }
.t-surface-copy { font-family: var(--mud-typography-default-family); color: var(--mud-palette-text-primary); background: var(--mud-palette-surface); }
.t-info-font { color: var(--mud-palette-info); font-family: var(--mud-typography-default-family); }
.t-info-link { color: var(--mud-palette-info); font-family: var(--mud-typography-default-family); font-size: 0.85rem; text-decoration: none; }
.t-primary-strong { color: var(--mud-palette-primary); font-family: var(--mud-typography-default-family); font-size: 1rem; font-weight: 600; }
.t-fs-90 { font-size: 0.9rem; }
.t-bg-transparent { background: transparent; }
.t-bg-page { background: var(--mud-palette-background); }
.t-page-fill { background: var(--mud-palette-background); min-height: 100vh; }
.t-underline-surface { border-bottom: 1px solid var(--mud-palette-surface); }
.t-panel { background: var(--mud-palette-background); border: 1px solid var(--mud-palette-divider); border-radius: 8px; }
.t-panel-surface { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-divider); border-radius: 8px; }
.t-panel-fill { height: 100%; }
.t-center { text-align: center; }
.t-panel-dashed { background: var(--mud-palette-surface); border: 1px dashed var(--mud-palette-divider); border-radius: 8px; }
.t-th { background: var(--mud-palette-surface); color: var(--mud-palette-text-secondary); font-family: var(--mud-typography-default-family); font-size: 0.75rem; border-bottom: 1px solid var(--mud-palette-divider); }
.t-th-info { background: var(--mud-palette-surface); color: var(--mud-palette-info); font-family: var(--mud-typography-default-family); border-bottom: 1px solid var(--mud-palette-divider); }
.t-cell { background: var(--mud-palette-surface); color: var(--mud-palette-text-secondary); font-family: var(--mud-typography-default-family); font-size: 0.75rem; }
.t-success-btn { background: linear-gradient(135deg, var(--mud-palette-success) 0%, var(--mud-palette-success) 100%); color: white; font-family: var(--mud-typography-default-family); text-transform: none; }
/* F12 sweep tier 2 — primitives composed with the utilities above */
.t-bg-surface { background: var(--mud-palette-surface); }
.t-white { color: white; }
.t-primary { color: var(--mud-palette-primary); }
.t-bold { font-weight: 700; }
.t-semibold { font-weight: 600; }
.t-fs-100 { font-size: 1rem; }
.t-fs-85 { font-size: 0.85rem; }
.t-fs-80 { font-size: 0.8rem; }
.t-fs-70 { font-size: 0.7rem; }
/* A product with no image: its placeholder icon, at the size of the image panel. */
.t-icon-hero { font-size: 4rem; }
.t-icon-middle { vertical-align: middle; }
/* Home page: the hero heading and intro, and the section headings' spacing (they were inline styles). */
.terminal-hero-heading { font-size: clamp(2.65rem, 7vw, 4.5rem); max-width: 16ch; }
.terminal-hero-intro { max-width: 32rem; }
.terminal-heading-tight { margin-bottom: 0.25rem; }
.terminal-heading-snug { margin-bottom: 0.5rem; }
.terminal-intro-flush { margin-bottom: 0; }
.t-notransform { text-transform: none; }
.t-flex-1 { flex: 1; }
.t-border-top { border-top: 1px solid var(--mud-palette-divider); }
.t-border-divider { border-color: var(--mud-palette-divider); }
.t-outline { background: var(--mud-palette-background); border: 1px solid var(--mud-palette-divider); }
.t-empty-icon { color: var(--mud-palette-divider); font-size: 4rem; margin-bottom: 1rem; }
.t-empty-title { color: var(--mud-palette-text-primary); font-size: 1.1rem; }
.t-menu-panel { min-width: 320px; max-width: 380px; }
.t-dot-xs { font-size: 8px; }

/* ==========================================================================
   FIRSTRUN-01 — the welcome tour (/welcome), its home-page invitation and /preferences.
   Logical properties only (inline/block), so a right-to-left culture mirrors it with no rule of its own; sizes in rem,
   wrapping rows and no fixed heights, so enlarged text reflows; every control at least 44 px tall.
   ========================================================================== */
.welcome-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    position: relative;
    z-index: 2;
}

.welcome-header,
.welcome-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-block: 1rem;
    padding-inline: 1.5rem;
}

.welcome-header {
    border-block-end: 1px solid var(--mud-palette-divider);
}

.welcome-footer {
    border-block-start: 1px solid var(--mud-palette-divider);
    justify-content: center;
}

.welcome-brand {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-weight: 700;
}

.welcome-main {
    flex: 1;
    padding-block: 2.5rem;
}

.welcome-step {
    display: grid;
    gap: 1.5rem;
}

.welcome-progress {
    display: grid;
    gap: 0.5rem;
    max-width: 40rem;
}

.welcome-step-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 2.5rem;
    align-items: center;
}

.welcome-title {
    font-size: clamp(1.85rem, 4.5vw, 2.75rem);
    overflow-wrap: anywhere;
}

.welcome-body {
    margin-bottom: 1.5rem;
}

.welcome-scene {
    display: grid;
    justify-items: center;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: calc(var(--mud-default-borderradius, 6px) * 3);
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--mud-palette-primary) 22%, transparent), transparent 55%),
        radial-gradient(circle at 75% 80%, color-mix(in srgb, var(--mud-palette-tertiary) 20%, transparent), transparent 50%),
        var(--mud-palette-surface);
}

.welcome-scene-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--mud-palette-primary) 14%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 45%, var(--mud-palette-divider));
    color: var(--mud-palette-primary);
    animation: welcome-float 6s ease-in-out infinite;
}

.welcome-scene-main .welcome-scene-main-icon {
    font-size: 3.75rem;
}

.welcome-scene-orbit {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.welcome-scene-satellite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: var(--mud-default-borderradius, 6px);
    border: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}

.welcome-tone-0 { color: var(--mud-palette-primary); }
.welcome-tone-1 { color: var(--mud-palette-tertiary); }
.welcome-tone-2 { color: var(--mud-palette-info); }

@keyframes welcome-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.4rem); }
}

.welcome-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.welcome-action {
    min-height: 2.75rem;
    text-transform: none;
}

.welcome-nav,
.welcome-choices,
.welcome-invite-actions,
.welcome-language-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.welcome-nav {
    margin-block-start: 2rem;
    padding-block-start: 1.25rem;
    border-block-start: 1px solid var(--mud-palette-divider);
}

.welcome-skip {
    margin-inline-start: auto;
}

.welcome-choices {
    margin-block-end: 1rem;
}

.welcome-choices-note {
    flex-basis: 100%;
}

.welcome-replay {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
}

.welcome-language-in-use {
    font-size: 0.85rem;
}

.welcome-invite {
    padding-block: 1.25rem 0;
}

.welcome-invite-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    border-color: color-mix(in srgb, var(--mud-palette-primary) 55%, var(--mud-palette-divider));
}

.welcome-invite-art {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, var(--mud-palette-surface));
}

.welcome-invite-copy {
    flex: 1 1 18rem;
    min-width: 0;
}

.welcome-invite-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-block: 0 0.35rem;
    color: var(--mud-palette-text-primary);
}

.welcome-invite-body {
    margin-block: 0 1rem;
    max-width: 44rem;
}

.welcome-panel-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

@media (max-width: 900px) {
    .welcome-step-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .welcome-scene {
        padding-block: 1.75rem;
    }
}

/* ===== admin-dbmgmt ===== */
/* Data management page (/database-management): these were inline styles. */
.dbm-file-upload { width: 100%; }
.dbm-col-id { width: 60px; }
.dbm-col-count { width: 100px; }
.dbm-col-flag { width: 90px; }
.dbm-col-actions { width: 120px; }
.dbm-ellipsis { max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbm-log { max-height: 300px; overflow-y: auto; background-color: var(--mud-palette-background); }
.dbm-log-time { min-width: 100px; }

/* ===== admin-catalog ===== */
/* The catalogue and pricing-plan admin screens: their inline colour and font styles moved here, on theme palette tokens. */
.catalog-stat-value { font-family: var(--mud-typography-default-family); font-size: 1.5rem; font-weight: 600; }
.catalog-section-title { font-family: var(--mud-typography-default-family); font-size: 1rem; font-weight: 600; }
.catalog-tertiary { color: var(--mud-palette-tertiary); }

/* ===== admin-support ===== */
/* Moderation, support tickets and system errors: what were inline styles on those pages. */
.mod-stat { background: var(--mud-palette-background); border: 1px solid var(--mud-palette-divider); border-radius: 12px; }
.mod-stat-warning { border-color: var(--mud-palette-warning-darken); }
.mod-stat-error { border-color: var(--mud-palette-error); }
.mod-stat-info { border-color: var(--mud-palette-info); }
.mod-stat-value { font-family: var(--mud-typography-default-family); font-size: 1.75rem; font-weight: 600; }
.mod-window { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-divider); border-radius: 12px; overflow: hidden; }
.mod-window-bar { background: var(--mud-palette-background); border-bottom: 1px solid var(--mud-palette-divider); }
.mod-window-dot { width: 12px; height: 12px; border-radius: 50%; }
.mod-dot-error { background: var(--mud-palette-error); }
.mod-dot-warning { background: var(--mud-palette-warning); }
.mod-dot-success { background: var(--mud-palette-success); }
.mod-window-title { color: var(--mud-palette-text-secondary); font-family: var(--mud-typography-default-family); font-size: 0.75rem; margin-left: 12px; }
.mod-tab-icon { font-size: 1.1rem; }
.mod-cell-wide { max-width: 260px; }
.mod-comment { max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-star-on { color: var(--mud-palette-warning); font-size: 0.9rem; }
.mod-star-off { color: var(--mud-palette-divider); font-size: 0.9rem; }
.support-filter { min-width: 150px; }
.errors-search { min-width: 18rem; max-width: 28rem; }

/* ===== admin-reports ===== */
/* The dashboard, reports, settings, companies and audit log pages: the inline styles they carried, as classes over the
   theme's palette. */
.admin-kpi { font-family: var(--mud-typography-default-family); font-size: 1.5rem; font-weight: 600; }
.admin-kpi-sm { font-family: var(--mud-typography-default-family); font-size: 1.3rem; font-weight: 600; }
.admin-figure { font-family: var(--mud-typography-default-family); font-size: 1.5rem; font-weight: 600; }
.admin-kpi-card { background: var(--mud-palette-background); border: 1px solid var(--mud-palette-divider); border-radius: 12px; }
.admin-kpi-card-accent { border-color: var(--mud-palette-success); }
.admin-tertiary { color: var(--mud-palette-tertiary); }
.admin-success { color: var(--mud-palette-success); }
.admin-section-title { color: var(--mud-palette-text-primary); font-family: var(--mud-typography-default-family); font-size: 1rem; }
.admin-window { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-divider); border-radius: 12px; overflow: hidden; }
.admin-window-bar { background: var(--mud-palette-background); border-bottom: 1px solid var(--mud-palette-divider); }
.admin-window-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.admin-window-dot-error { background: var(--mud-palette-error); }
.admin-window-dot-warning { background: var(--mud-palette-warning); }
.admin-window-dot-success { background: var(--mud-palette-success); }
.admin-th { color: var(--mud-palette-text-secondary); font-family: var(--mud-typography-default-family); font-size: 0.75rem; }
.admin-cell { color: var(--mud-palette-text-primary); font-family: var(--mud-typography-default-family); font-size: 0.85rem; }
.admin-cell.t-primary { color: var(--mud-palette-primary); }
.admin-cell.t-info { color: var(--mud-palette-info); }
.admin-cell.t-warning { color: var(--mud-palette-warning); }
.admin-cell.t-error { color: var(--mud-palette-error); }
.admin-cell.admin-tertiary { color: var(--mud-palette-tertiary); }
.admin-num { text-align: end; }
.admin-chip { background: var(--mud-palette-divider); color: var(--mud-palette-text-primary); font-family: var(--mud-typography-default-family); font-size: 0.75rem; margin: 4px; }
.admin-nowrap { white-space: nowrap; }
/* A quick-tool tile is a link: the whole card is the target, keyboard reachable, with no underline. */
.admin-tile-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.admin-tile-link:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; border-radius: 12px; }
.admin-company-dialog { background: var(--mud-palette-background); color: var(--mud-palette-text-primary); border: 1px solid var(--mud-palette-divider); }
.admin-company-header { background: linear-gradient(135deg, var(--mud-palette-background) 0%, var(--mud-palette-surface) 100%); border: 1px solid var(--mud-palette-divider); border-radius: 12px; }
.admin-company-avatar { height: 80px; width: 80px; font-size: 2rem; background: linear-gradient(135deg, var(--mud-palette-warning) 0%, var(--mud-palette-warning-darken) 100%); }

/* ===== admin-billing ===== */
/* Payment activity, invoices and accounting reports (admin), and the printable invoice (admin and customer). */
.billing-panel-title { font-family: var(--mud-typography-default-family); font-size: 1rem; font-weight: 600; }
.billing-failure-card { background: var(--mud-palette-background); border: 1px solid color-mix(in srgb, var(--mud-palette-error) 50%, transparent); border-radius: 8px; }
.billing-totals { max-width: 320px; margin-inline-start: auto; }
.billing-start { align-self: flex-start; }
.billing-num { text-align: end; }
.billing-report-header { font-weight: 700; color: var(--mud-palette-info); }
.billing-report-total { font-weight: 700; color: var(--mud-palette-primary); border-top: 1px solid var(--mud-palette-divider); }

/* The printable invoice: a document page without the site's chrome (PrintLayout). On screen it takes the theme's colours;
   on paper the printer's own (system colours), so a dark theme never prints light text on a white page. */
.print-layout { min-height: 100vh; background: var(--mud-palette-background); padding: 24px 16px; }
.invoice-print-toolbar { max-width: 800px; margin: 0 auto 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.invoice-print-message { max-width: 800px; margin: 0 auto; }
.invoice-document { max-width: 800px; margin: 0 auto; padding: 32px; background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); border: 1px solid var(--mud-palette-divider); border-radius: 8px; font-family: var(--mud-typography-default-family); line-height: 1.5; }
.invoice-doc-parties { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; margin-bottom: 24px; }
.invoice-doc-end { text-align: end; }
.invoice-doc-muted { color: var(--mud-palette-text-secondary); font-size: 0.85rem; }
.invoice-doc-lines { white-space: pre-line; }
.invoice-doc-scroll { overflow-x: auto; }
.invoice-doc-table { width: 100%; border-collapse: collapse; }
.invoice-doc-table th, .invoice-doc-table td { padding: 8px 4px; text-align: start; }
.invoice-doc-table .num { text-align: end; white-space: nowrap; }
.invoice-doc-table thead tr { border-bottom: 2px solid var(--mud-palette-text-primary); }
.invoice-doc-table tbody tr { border-bottom: 1px solid var(--mud-palette-divider); }
.invoice-doc-totals { max-width: 320px; margin: 16px 0 0 auto; }
.invoice-doc-row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.invoice-doc-grand { font-weight: 700; border-top: 1px solid var(--mud-palette-text-primary); padding-top: 6px; }
.invoice-doc-section { margin-top: 20px; }

@media (max-width: 600px) {
    .invoice-document { padding: 16px; }
    .invoice-doc-end { text-align: start; }
}

@media print {
    .invoice-print-toolbar { display: none; }
    .print-layout { padding: 0; background: Canvas; }
    .invoice-document { color-scheme: light; background: Canvas; color: CanvasText; border: none; padding: 0; max-width: none; }
    .invoice-doc-muted { color: GrayText; }
    .invoice-doc-table thead tr, .invoice-doc-grand { border-color: CanvasText; }
    .invoice-doc-table tbody tr { border-color: GrayText; }
}

/* ===== profile-products ===== */
/* Account licences, downloads and wishlist: a card's picture box and sale badge, a licence key that wraps, and two-line
   text (they were inline styles). */
.profile-products-media { position: relative; height: 140px; display: flex; align-items: center; justify-content: center; background: var(--mud-palette-surface); border-bottom: 1px solid var(--mud-palette-divider); }
.profile-products-media img { max-height: 100%; max-width: 100%; object-fit: contain; }
.profile-products-badge { position: absolute; top: 8px; inset-inline-end: 8px; }
.profile-products-key { word-break: break-all; }
.profile-products-clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== req-identity ===== */
/* The sign-in-unavailable page (/service-unavailable): a state panel bordered in the warning colour, as
   terminal-danger-panel borders a refusal. It replaced the page's inline borders. */
.terminal-warning-panel { border-color: var(--mud-palette-warning); }
