html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: "IBM Plex Sans", sans-serif;
}

#app {
    width: 100%;
    min-height: 100%;
}

.landing-container {
    padding-top: 1.25rem;
}

.landing-card {
    min-height: 210px;
}

.editor-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 98px);
    min-height: calc(100vh - 98px);
    gap: 0.45rem;
}

.reference-toolbar-toggle {
    margin: 0;
    font-weight: 500;
    min-height: 0;
    height: 34px;
    padding: 0 0.75rem;
    line-height: 1;
    border-radius: 0 !important;
    text-transform: none !important;
    border: none !important;
    border-left: 1px solid var(--mud-palette-lines-default) !important;
    box-shadow: none !important;
    color: rgba(var(--mud-palette-text-primary-rgb), 0.5);
}

.reference-toolbar-toggle:hover {
    color: rgba(var(--mud-palette-text-primary-rgb), 0.8);
    background: rgba(var(--mud-palette-text-primary-rgb), 0.04);
}

.reference-toolbar-toggle .mud-button-label {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.reference-toolbar-toggle .mud-button-start-icon {
    margin-right: 0.25rem;
    font-size: 0.9rem;
}

.format-toggle-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(var(--mud-palette-text-primary-rgb), 0.04);
}

.format-toggle-group .mud-button-root,
.format-toggle-group .mud-button {
    min-width: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 0 !important;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    line-height: 1;
    border: none !important;
    box-shadow: none !important;
    min-height: 0;
}

.format-toggle-group .mud-button-root + .mud-button-root {
    border-left: 1px solid var(--mud-palette-lines-default) !important;
}

.editor-top-toolbar {
    flex-wrap: nowrap;
    gap: 0.5rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    padding: 0.3rem 0.4rem;
    margin-bottom: 0.15rem;
    min-height: 0 !important;
    align-items: center;
}

.editor-grid {
    flex: 1;
    min-height: 0;
}

.editor-grid.mud-grid {
    height: 100%;
    align-content: stretch;
}

.editor-grid > .mud-grid-item {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.editor-surface {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.fasm-workspace-surface {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.fasm-tab-bar {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    min-height: 34px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
}

.fasm-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.75rem;
    height: 34px;
    border: none;
    border-right: 1px solid var(--mud-palette-lines-default);
    border-bottom: 2px solid transparent;
    background: transparent;
    color: rgba(var(--mud-palette-text-primary-rgb), 0.5);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    position: relative;
}

.fasm-tab:hover {
    color: rgba(var(--mud-palette-text-primary-rgb), 0.8);
    background: rgba(var(--mud-palette-text-primary-rgb), 0.04);
}

.fasm-tab-active {
    color: var(--mud-palette-text-primary);
    border-bottom-color: var(--mud-palette-primary);
}

.fasm-tab-active:hover {
    background: transparent;
}

.fasm-tab-label {
    line-height: 1;
}

.fasm-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.12s ease, background-color 0.12s ease;
    color: inherit;
    cursor: pointer;
}

.fasm-tab:hover .fasm-tab-close,
.fasm-tab-active .fasm-tab-close {
    opacity: 1;
}

.fasm-tab-close:hover {
    background: rgba(var(--mud-palette-text-primary-rgb), 0.12);
}

.fasm-tab-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    border: none;
    background: transparent;
    color: rgba(var(--mud-palette-text-primary-rgb), 0.4);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.fasm-tab-add:hover {
    color: rgba(var(--mud-palette-text-primary-rgb), 0.8);
}

.fasm-tab-bar-spacer {
    flex: 1;
    min-width: 0;
}

.fasm-tab-editor-host {
    position: relative;
    flex: 1;
    height: 0;
    min-height: 0;
}

.fasm-tab-editor-active,
.fasm-tab-editor-hidden {
    position: absolute;
    inset: 0;
}

.fasm-tab-editor-hidden {
    display: none;
}

.diagnostics-panel {
    flex: 1;
    min-height: 0;
    padding: 0.95rem;
    overflow: auto;
}

.panel-shell {
    border-radius: 12px;
    border-color: var(--mud-palette-lines-default) !important;
    box-shadow: 0 10px 30px rgba(var(--mud-palette-text-primary-rgb), 0.05);
}

.panel-title {
    font-weight: 650;
    letter-spacing: 0.01em;
}

.diagnostics-list {
    max-height: calc(100% - 50px);
    overflow: auto;
}

.diagnostics-list .mud-list-item {
    border-radius: 8px;
    margin: 0.1rem 0;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    transition: background-color 0.18s ease;
}

.diagnostics-list .mud-list-item:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.07);
}

.diagnostic-entry {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.panel-empty-state {
    background-color: rgba(var(--mud-palette-success-rgb), 0.05);
    border-color: rgba(var(--mud-palette-success-rgb), 0.25);
}

.status-bar {
    margin-top: 0.15rem;
}

.ide-status-bar {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    background-color: rgba(var(--mud-palette-text-primary-rgb), 0.04);
}

.status-text {
    letter-spacing: 0.01em;
}

.binary-output {
    flex: 1;
    min-height: 0;
    padding: 0.95rem;
    overflow: auto;
}

.binary-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    overflow: hidden;
}

.binary-grid-header,
.binary-grid-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.binary-grid-header {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background-color: rgba(var(--mud-palette-text-primary-rgb), 0.05);
}

.binary-grid-row {
    padding: 0.35rem 0.55rem;
    border-bottom: 1px solid rgba(var(--mud-palette-text-primary-rgb), 0.1);
    transition: background-color 0.18s ease;
}

.binary-grid-row:last-child {
    border-bottom: 0;
}

.binary-grid-row:nth-child(even) {
    background-color: rgba(var(--mud-palette-text-primary-rgb), 0.03);
}

.binary-grid-row:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
}

.binary-grid-header-text,
.binary-address-text,
.binary-value-text {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

.binary-address-text {
    text-align: left;
}

.editor-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
    gap: 0.8rem;
}

.editor-workspace.editor-workspace-with-reference {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr) minmax(300px, 1fr);
}

.editor-workspace-main,
.editor-workspace-support,
.editor-workspace-reference {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.support-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    min-height: 0;
}

.editor-workspace-reference {
    min-height: 420px;
}

.reference-drawer {
    height: 100%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reference-drawer-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--mud-palette-surface);
}

.reference-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0.85rem 0.45rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.reference-drawer-tab-strip {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem 0.6rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.reference-drawer-tab-strip .mud-button-root {
    border-radius: 999px;
    font-weight: 600;
}

.reference-drawer-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reference-topic {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    background-color: rgba(var(--mud-palette-text-primary-rgb), 0.02);
}

.reference-topic-toggle {
    width: 100%;
    border: 0;
    padding: 0.62rem 0.75rem;
    background-color: transparent;
    color: inherit;
    font: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.reference-topic-toggle:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
}

.reference-topic-toggle:focus-visible,
.reference-toolbar-toggle:focus-visible,
.fasm-tab:focus-visible {
    outline: 2px solid rgba(var(--mud-palette-primary-rgb), 0.45);
    outline-offset: 2px;
}

.reference-topic-title {
    font-weight: 600;
}

.reference-topic-body {
    border-top: 1px solid var(--mud-palette-lines-default);
    padding: 0.75rem;
}

.reference-topic-section-label {
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.reference-topic-summary {
    margin-top: 0.35rem;
    line-height: 1.5;
}

.reference-topic-examples-label {
    margin-top: 0.85rem;
}

.reference-topic-example {
    margin: 0.45rem 0 0;
    padding: 0.7rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    background-color: rgba(var(--mud-palette-text-primary-rgb), 0.06);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
    font-size: 0.83rem;
    line-height: 1.45;
}

.reference-inline-code {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background-color: rgba(var(--mud-palette-text-primary-rgb), 0.08);
    font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
    font-size: 0.88em;
}

.reference-isa-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.reference-isa-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.reference-isa-group-header {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0;
    padding: 0.2rem 0;
    background-color: var(--mud-palette-surface);
    font-weight: 650;
}

.reference-isa-fields {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reference-isa-subtitle {
    color: rgba(var(--mud-palette-text-primary-rgb), 0.7);
    margin-top: -0.05rem;
}

.reference-isa-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.2rem;
}

.reference-isa-body-line {
    margin: 0;
}

.reference-isa-body-label {
    font-weight: 500;
}

.reference-isa-inline-description {
    color: rgba(var(--mud-palette-text-primary-rgb), 0.7);
    font-size: 0.82em;
}

.reference-isa-child-row {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--mud-palette-lines-default);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.reference-drawer-empty-state,
.reference-drawer-unavailable-state,
.reference-drawer-invalid-state {
    margin-top: 0.35rem;
}

.reference-panel {
    background-image: linear-gradient(180deg, rgba(var(--mud-palette-text-primary-rgb), 0.03), transparent 24%);
}

@media (max-width: 959px) {
    .editor-page {
        height: auto;
        min-height: auto;
    }

    .editor-surface,
    .diagnostics-panel {
        min-height: 360px;
    }

    .editor-workspace,
    .editor-workspace.editor-workspace-with-reference {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .editor-workspace-main {
        order: 1;
    }

    .editor-workspace-reference {
        order: 2;
        min-height: 360px;
    }

    .editor-workspace-support {
        order: 3;
    }

    .reference-drawer {
        min-height: 360px;
    }
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}
/* ── Hub site ─────────────────────────────────────────────────────────── */

:root {
    --mud-typography-default-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

body {
    background-color: #0e1217;
}

.hub-appbar {
    border-bottom: 1px solid #232b36;
}

.hub-brand {
    letter-spacing: 0.02em;
}

.hub-hero {
    padding: 3rem 0 1rem;
    text-align: center;
}

.hub-hero-title {
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(100deg, #3fc9c1 0%, #7f9cf5 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hub-hero-tagline {
    max-width: 42rem;
    margin: 0.75rem auto 0;
}

.hub-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hub-card .mud-card-content {
    flex: 1;
}

.hub-mono {
    font-family: 'IBM Plex Mono', 'Cascadia Mono', Consolas, monospace;
    font-size: 0.85rem;
}

.crash-record {
    margin: 0;
    font-family: 'IBM Plex Mono', 'Cascadia Mono', Consolas, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.main-layout-content.with-footer {
    display: flex;
    flex-direction: column;
}

.hub-footer {
    margin-top: auto;
    padding: 2.5rem 1rem 0.75rem;
    text-align: center;
}

.menu-caption {
    padding: 0.75rem 1rem 0.25rem;
    color: #8b95a3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.7rem;
}
