@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap');

:root {
    --sh-container-width: var(--site-shell-max-width);
    --sh-section-padding: var(--space-5);
    --sh-section-padding-sm: var(--space-4);
    --sh-card-radius: var(--pui-radius-md);
    --sh-card-padding: var(--space-4);
    --sh-card-border: var(--border);
    --sh-card-bg: var(--surface);
    --sh-surface-muted: var(--surface_alt);
    --sh-card-shadow: var(--pui-shadow-soft);
    --sh-card-shadow-soft: var(--pui-shadow-subtle);
    --sh-card-gradient: linear-gradient(135deg, var(--surface_alt) 0%, var(--surface) 60%);
    --sh-button-height: var(--pui-touch-target-min);
    --sh-icon-size: 22px;
}

/* Page canvas comes from the approved BeforeYouTrade page background token,
   which maps back to the registered Platform surface token in light mode. */
body {
    background-color: var(--byt-page-bg);
    color: var(--text);
}

input,
select,
textarea {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

input::placeholder,
textarea::placeholder {
    color: var(--text_muted);
}

.mud-input,
.mud-select {
    color: var(--text);
}

.mud-input-outlined-border {
    border-color: var(--border);
}

:focus-visible {
    outline: var(--pui-focus-width) solid var(--focus-ring-colour);
    outline-offset: var(--pui-space-1);
}

/* Page container - compatibility wrapper for legacy layouts */
.page-container {
    max-width: calc(var(--page-max-width) + (var(--page-gutter-x) * 2));
    margin: 0 auto;
    padding-inline: var(--page-gutter-x);
    box-sizing: border-box;
    width: 100%;
}

.page-frame {
    width: 100%;
    box-sizing: border-box;
}

.page-frame--spacing-standard {
    padding-block: 1.25rem 4rem;
}

.page-frame--spacing-compact {
    padding-block: 0.75rem 2rem;
}

.page-frame--spacing-none {
    padding-block: 0;
}

.page-frame__inner {
    width: 100%;
    margin: 0 auto;
    padding-inline: var(--page-gutter-x);
    box-sizing: border-box;
}

.page-frame__inner--wide {
    max-width: var(--site-shell-max-width);
}

.page-frame__inner--readable {
    max-width: var(--site-shell-max-width);
}

.page-frame__inner--full {
    max-width: none;
}

.page-container > .page-frame > .page-frame__inner,
.public-page-container > .page-frame > .page-frame__inner,
.customer-product-shell > .page-frame > .page-frame__inner,
.admin-body > .page-frame > .page-frame__inner {
    padding-inline: 0;
}

.page-container > .container,
.page-container > .container-fluid,
.page-container > .mud-container,
.page-frame__inner > .container,
.page-frame__inner > .container-fluid,
.page-frame__inner > .mud-container,
.public-page-container > .container,
.public-page-container > .container-fluid,
.public-page-container > .mud-container,
.cpl-shell > .container,
.cpl-shell > .container-fluid,
.cpl-shell > .mud-container,
.customer-product-shell > .container,
.customer-product-shell > .container-fluid,
.customer-product-shell > .mud-container {
    max-width: 100%;
    width: 100%;
    padding-inline: 0;
    box-sizing: border-box;
}

.sh-section {
    padding: var(--sh-section-padding) 0;
}

.sh-card {
    border: 1px solid var(--sh-card-border);
    border-radius: var(--sh-card-radius);
    background: var(--sh-card-bg);
    box-shadow: var(--sh-card-shadow);
}

.sh-card-soft {
    border: 1px solid var(--sh-card-border);
    border-radius: var(--sh-card-radius);
    background: var(--sh-card-bg);
    box-shadow: var(--sh-card-shadow-soft);
}

.legal-notice-card {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--pui-color-text-secondary);
}

.legal-notice-card.mud-paper {
    background: var(--pui-color-surface-card);
    border: 1px solid var(--pui-color-border-default);
    border-radius: var(--pui-radius-lg);
    box-shadow: var(--pui-shadow-soft);
}

.mud-button-root.sh-button {
    min-height: var(--sh-button-height);
    padding-inline: 1rem;
}

.support-center-shell .mud-icon-root {
    font-size: var(--sh-icon-size);
}

/* ── Quick links panel ──────────────────────────────────────────────────── */
.quick-links-panel {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--sh-card-border);
    text-decoration: none;
    color: inherit;
    transition: background var(--pui-motion-fast);
}

.quick-link:last-child {
    border-bottom: none;
}

.quick-link--live {
    cursor: pointer;
}

.quick-link--live:hover {
    background: var(--surface_alt);
}

.quick-link--live:focus-visible {
    outline: var(--pui-focus-width) solid var(--focus-ring-colour);
    outline-offset: var(--pui-space-1);
    border-radius: var(--pui-radius-sm);
}

.quick-link--live:active {
    background: var(--border);
}

.quick-link--planned {
    cursor: default;
    opacity: var(--state_disabled_opacity);
}

.quick-link__title {
    font-weight: 500;
    flex: 1;
}

.quick-link__chevron {
    margin-left: auto;
    opacity: 0.4;
}

.quick-link__badge {
    font-size: 0.7rem;
}

.quick-link__helper {
    font-size: 0.8rem;
    color: var(--text_muted);
    padding: 0 var(--space-3) var(--space-3) calc(var(--pui-touch-target-min) + var(--pui-space-1));
    margin: 0;
    line-height: 1.4;
}

.word {
    font-size: 20px;
    font-family: sans-serif;
    fill: black;
}

h1:focus {
    outline: none;
}

/* ── Global links: no underline by default, underline on hover ─────────── */
a,
a:visited {
    text-decoration: none;
}

a {
    color: var(--link-colour);
}

a:hover {
    text-decoration: underline;
    text-decoration-skip-ink: auto;
}

a:focus-visible {
    outline: var(--pui-focus-width) solid var(--focus-ring-colour);
    outline-offset: var(--pui-space-1);
    border-radius: var(--pui-radius-sm);
    text-decoration: none;
}

a.btn,
a.button,
a.btn-primary,
a.btn-secondary,
a.btn-link,
a.appButtonPrimary,
a.appButtonSecondary,
a.appButtonDanger,
a.appButtonDefault,
a.action-button,
a.cta-button {
    text-decoration: none;
}

a.btn:hover,
a.button:hover,
a.btn-primary:hover,
a.btn-secondary:hover,
a.btn-link:hover,
a.appButtonPrimary:hover,
a.appButtonSecondary:hover,
a.appButtonDanger:hover,
a.appButtonDefault:hover,
a.action-button:hover,
a.cta-button:hover,
a.btn:focus-visible,
a.button:focus-visible,
a.btn-primary:focus-visible,
a.btn-secondary:focus-visible,
a.btn-link:focus-visible,
a.appButtonPrimary:focus-visible,
a.appButtonSecondary:focus-visible,
a.appButtonDanger:focus-visible,
a.appButtonDefault:focus-visible,
a.action-button:focus-visible,
a.cta-button:focus-visible {
    text-decoration: none;
}

.btn-primary {
    color: var(--button-primary-text);
    background-color: var(--button-primary-bg);
    border-color: var(--button-primary-bg);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyMjYzLjU4NiA2Ni4wMTgzWk0yNjMuNTc2IDg2LjA1NDdDMjYxLjA0OSA4Ni4wNTQ3IDI1OS43ODYgODcuMzAwNSAyNTkuNzg2IDg5Ljc5MjEgMjU5Ljc4NiA5Mi4yODM3IDI2MS4wNDkgOTMuNTI5NSAyNjMuNTc2IDkzLjUyOTUgMjY2LjExNiA5My41Mjk1IDI2Ny4zODcgOTIuMjgzNyAyNjcuMzg3IDg5Ljc5MjEgMjY3LjM4NyA4Ny4zMDA1IDI2Ni4xMTYgODYuMDU0NyAyNjMuNTc2IDg2LjA1NDd6IiBmaWxsPSIjRkZFNTAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L2c+PC9zdmc+) no-repeat 1rem/1.8rem, var(--danger);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--danger_text);
}

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

.responsive-video {
    width: 100%;
    min-height: 220px;
    object-fit: cover;
}

.video-background-image {
    background-image: url('/images/trading.jpg');
    background-size: cover;
    background-position: center;
}

/* ── Learn page wrapper ────────────────────────────────────────────────── */
.learn-page {
    width: 100%;
}

/* Wide discovery pages — larger max-width, smaller gutter */
.page-wide {
    width: 100%;
}

/* Legacy readable alias — now matches the main page shell */
.page-readable {
    max-width: var(--page-max-width);
    margin: 0 auto;
    width: 100%;
}

/* Article / definition detail content should inherit the page shell width */
.definition-article {
    max-width: 100%;
}

.learn-hero {
    margin-bottom: var(--space-6);
}

/* Compact format + attribute filter bar. Replaces the oversized content-type
   tiles: same navigation targets, one restrained control row. */
.learn-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: var(--space-5);
}

.learn-filter-bar__separator {
    width: 1px;
    height: 26px;
    flex: none;
    background: var(--byt-border);
}

.learn-format-segments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    background: var(--byt-surface-segment);
    border: 1px solid var(--byt-border-control);
    border-radius: var(--byt-radius-inset);
}

.learn-format-segment {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: var(--byt-control-min-height);
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--byt-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.learn-format-segment:hover {
    background: var(--byt-surface-hover);
    color: var(--byt-text);
}

/* `.appContent a:hover` in app-controls.css underlines the whole anchor, and
   that decoration propagates into the count badge. The badge is a flex item,
   not an atomic inline box, so it cannot cancel it itself. Cancel at the
   anchor and re-apply on the label alone. The `a` qualifier matches that
   rule's specificity, and site.css loads after app-controls.css. */
a.learn-format-segment:hover {
    text-decoration: none;
}

a.learn-format-segment:hover .learn-format-segment__label {
    text-decoration: underline;
}

.learn-format-segment.active {
    background: var(--byt-surface-segment-selected);
    color: var(--byt-text);
    box-shadow: inset 0 0 0 1px var(--byt-border-selected);
}

.learn-format-segment__count {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: var(--byt-radius-pill);
    background: var(--byt-surface-tag);
    color: var(--byt-text-secondary);
    font-size: var(--byt-font-label);
    font-variant-numeric: tabular-nums;
}

.learn-attribute-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.learn-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: var(--byt-control-min-height);
    padding: 7px 14px;
    border-radius: var(--byt-radius-pill);
    border: 1px solid var(--byt-border-hover);
    background: transparent;
    font-size: 13px;
    color: var(--byt-text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.learn-filter-chip:hover {
    border-color: var(--byt-border-selected);
    color: var(--byt-text);
}

.learn-filter-chip.active {
    background: var(--byt-accent-soft-strong);
    border-color: var(--byt-accent);
    color: var(--byt-text);
}

.learn-result-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0 6px;
}

.learn-result-line p {
    margin: 0;
    font-size: 13.5px;
    color: var(--byt-text-muted);
}

.learn-result-line strong {
    color: var(--byt-text);
    font-weight: 600;
}

.learn-result-line__reset {
    flex: none;
    padding: 0 10px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--byt-radius-control);
    color: var(--byt-link);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.learn-result-line__reset:hover {
    background: var(--byt-accent-soft);
    color: var(--byt-link-hover);
}

.learn-tools-grid {
    margin-bottom: var(--space-7);
}

.learn-section {
    margin-bottom: var(--space-7);
}

.learn-cta {
    margin-top: var(--space-5);
    padding: var(--space-5) var(--space-5);
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--sh-card-gradient);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    transition: box-shadow 0.15s ease;
}

.learn-cta:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.learn-cta__button,
a.learn-cta__button,
button.learn-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.4;
}

.learn-cta__button:hover,
a.learn-cta__button:hover,
button.learn-cta__button:hover {
    text-decoration: none;
    background: color-mix(in srgb, var(--button-primary-bg) 88%, #000);
    color: var(--button-primary-text);
}

.learn-grid,
.learn-series-home__grid,
.definitions-page .definitions-grid,
.learn-section.definitions-mode .definitions-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
}

.learn-grid-state > .pui-empty-state-card {
    min-height: 15rem;
}

.learn-series-home__grid > .pui-empty-state-card {
    min-height: 15rem;
}

.learn-grid-state__diagnostic {
    margin-top: var(--space-4);
}

.learn-tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.learn-tag-pill {
    background: var(--surface_alt);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.learn-reader {
    font-size: 1.125rem;
    line-height: 1.75;
}

.learn-reader__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--space-8);
    align-items: start;
}

.learn-reader__main {
    min-width: 0;
}

.learn-reader__rail--right {
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: var(--space-5) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--pui-radius-md);
}

.learn-reader__cover {
    width: 100%;
    height: 220px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    margin-bottom: 1.5rem;
}

.learn-reader__meta {
    color: var(--text_muted);
    font-size: 0.9rem;
}

.learn-reader__summary {
    font-size: 1.1rem;
    color: var(--text_muted);
}

.learn-bookmark {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface_alt);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.learn-bookmark:hover {
    background: var(--state_hover_bg);
}

.learn-author-box {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface_alt);
}

.learn-reader__body {
    display: block;
}

.learn-reader__meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text_muted);
}

.learn-reader__related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.learn-reader__footer-spacer {
    height: 4rem;
}

@media (max-width: 1024px) {
    .learn-reader__layout {
        grid-template-columns: 1fr;
    }

    .learn-reader__rail--right {
        display: none;
    }
}

/* ── Learn home: series section ─────────────────────────────────────────── */
.learn-series-home__intro {
    max-width: 64ch;
    margin: 0 0 var(--space-4);
    color: var(--text_muted);
}

.learn-series-home__grid > .learn-content-card {
    min-width: 0;
}

.learn-series-home__grid .learn-content-card__meta {
    font-size: 0.85rem;
}

.learn-series-home__grid .learn-content-card__title {
    font-size: 1.3rem;
    line-height: 1.3;
}

.learn-series-home__grid .learn-content-card__summary {
    font-size: 0.95rem;
    line-height: 1.65;
}

.learn-series-home__footer {
    display: flex;
    justify-content: flex-start;
    margin-top: var(--space-4);
}

.learn-home-section-state__diagnostic {
    margin-top: var(--space-4);
}

@media (min-width: 768px) {
    .learn-grid,
    .learn-series-home__grid {
        grid-template-columns: repeat(auto-fit, minmax(18rem, 20rem));
        justify-content: start;
    }

    .definitions-page .definitions-grid,
    .learn-section.definitions-mode .definitions-grid {
        grid-template-columns: repeat(auto-fit, minmax(18rem, 20rem));
        justify-content: start;
    }
}

.learn-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.learn-toc li {
    margin-bottom: 0.5rem;
}

.learn-toc .level-2 {
    margin-left: 0.75rem;
}

.learn-audio-player,
.learn-video-embed {
    margin: 2rem 0;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--bg);
}

.admin-sidebar {
    background: var(--surface_alt);
    color: var(--text);
    padding: 1.5rem 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text_muted);
    margin-bottom: 1rem;
}

.admin-sidebar-link,
.admin-sidebar-sublink {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.admin-sidebar-link.active,
.admin-sidebar-sublink.active {
    background: var(--state_selected_bg);
    color: var(--state_selected_text);
}

.admin-sidebar-group {
    margin-top: 0.75rem;
}

.admin-sidebar-sub {
    display: none;
    margin: 0.25rem 0 0.75rem 0.5rem;
    border-left: 1px solid var(--border);
    padding-left: 0.75rem;
}

.admin-sidebar-group.open .admin-sidebar-sub {
    display: block;
}

.admin-sidebar-subheader {
    margin: 0.75rem 0 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text_muted);
}

.admin-main {
    padding: 2rem 2.5rem;
}

.admin-header {
    margin-bottom: 1.5rem;
}

.admin-title {
    margin: 0.25rem 0 0;
    font-size: 2rem;
    color: var(--text);
}

.admin-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-editor-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-action-bar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-action-bar .mud-button-root {
    min-width: 110px;
}

@media (min-width: 1280px) {
    .admin-action-bar {
        flex-wrap: nowrap;
    }
}

.adminShell .mud-button-filled-primary {
    background-color: var(--accent) !important;
    color: var(--accent_text) !important;
    border-color: var(--accent) !important;
}

.adminShell .mud-button-filled-primary:hover {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.admin-collection-add {
    align-items: flex-start;
}

.admin-collection-add-action {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0.2rem;
}

.admin-empty-state {
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    background: var(--surface_alt);
    text-align: center;
}

.admin-empty-state h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--text);
}

.admin-empty-state p {
    margin: 0 0 1rem;
    color: var(--text_muted);
}

.admin-taxonomy-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-taxonomy-form {
    margin-top: 0.5rem;
}

.admin-taxonomy-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.admin-drag-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.admin-drag-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.admin-drag-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.admin-drag-handle {
    color: var(--text_muted);
    cursor: grab;
}

.admin-drag-title {
    font-weight: 600;
    color: var(--text);
}

.admin-drag-sort {
    font-size: 0.85rem;
    color: var(--text_muted);
}

.admin-body {
    background: var(--surface);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow);
    max-width: calc(var(--page-max-width) + (var(--page-gutter-x) * 2));
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.admin-body .mud-input-control {
    padding-top: 0;
}

.admin-body .mud-input-label {
    display: block;
    position: static;
    transform: none;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--text_muted);
    pointer-events: none;
}

.admin-body .mud-input-label::before,
.admin-body .mud-input-label::after {
    content: none !important;
}

.admin-body .mud-input-root,
.admin-body .mud-input,
.admin-body .mud-select,
.admin-body .mud-input-control-input-container {
    min-height: 34px;
}

.admin-body .mud-input-slot,
.admin-body .mud-select-input {
    line-height: 1.35;
}

.admin-body .mud-input-outlined-border {
    border-radius: 10px;
    border-color: var(--border);
}

.admin-body .mud-input > input,
.admin-body .mud-input > textarea {
    line-height: 1.4;
    color: var(--text);
    background: var(--surface);
}

.admin-body .mud-input-adornment {
    margin-top: 0.1rem;
}

.admin-body .mud-input-helper-text {
    margin-top: 0.35rem;
}

.admin-tile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    min-height: 180px;
}

.admin-tiles-grid .mud-grid-item {
    display: flex;
}

.admin-tiles-grid .mud-grid-item > .admin-tile {
    flex: 1;
}

.admin-tile .mud-button-root {
    margin-top: auto;
    width: 100%;
}

.admin-quick-links {
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-main {
        padding: 1.5rem;
    }
}

.learn-video-embed iframe {
    width: 100%;
    min-height: 320px;
    border: none;
    border-radius: 12px;
}

.course-progress__track {
    background: var(--surface_alt);
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
}

.course-progress__fill {
    background: var(--accent);
    height: 100%;
}

.course-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.course-step {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    background: var(--surface);
}

.course-step.active {
    background: var(--accent);
    color: var(--accent_text);
    border-color: var(--accent);
}

.learn-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.learn-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.learn-filter-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text_muted);
    margin-right: 0.4rem;
}

.learn-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.learn-featured {
    padding: 1.5rem;
    border-radius: 16px;
    background: var(--accent);
    color: var(--accent_text);
    margin-bottom: 2rem;
}

.learn-featured__image {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    margin-bottom: 1rem;
}

.learn-featured a {
    color: var(--accent_text);
}

.learn-blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2rem;
    align-items: start;
}

.learn-blog-main {
    min-width: 0;
}

.learn-blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.learn-sidebar-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    background: var(--surface);
}

.learn-archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.learn-archive-list li {
    margin-bottom: 0.4rem;
}

.learn-share {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.learn-pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .learn-blog-layout {
        grid-template-columns: 1fr;
    }
}

.learn-admin-nav {
    flex-wrap: wrap;
    gap: var(--space-2);
}

.adminSignalToolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: center;
    margin-bottom: var(--space-4);
}

.adminSignalDate {
    color: var(--text_muted);
    font-size: 0.95rem;
}

.adminSignalSection {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--pui-radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.adminSignalGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.adminSignalGrid label {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.adminSignalDefinition {
    display: grid;
    gap: var(--space-2);
}

.adminSignalDefinition div {
    display: flex;
    gap: var(--space-2);
    align-items: baseline;
}

.adminSignalDefinition dt {
    min-width: 180px;
    font-weight: 600;
    color: var(--text);
}

.adminSignalDefinition dd {
    margin: 0;
    color: var(--text_muted);
    white-space: pre-wrap;
}

.adminSignalActions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    margin-top: var(--space-3);
}

.adminSignalIntegrity {
    margin-top: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--pui-radius-md);
    border: 1px solid var(--border);
    background: var(--surface_alt);
}

.adminSignalTable {
    width: 100%;
    border-collapse: collapse;
}

.adminSignalTable th,
.adminSignalTable td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.adminSignalInput {
    width: 100%;
    min-width: 200px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--pui-radius-sm);
    background: var(--surface);
    color: var(--text);
}

.adminSignalTruncate {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adminSignalChecklist {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
    font-size: 0.9rem;
}

.adminSignalChecklist label {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* ── Approval page ──────────────────────────────────────────────── */

.admin-approval-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.admin-approval-summary {
    width: 100%;
}

.admin-approval-summary tr.is-selected {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: var(--text);
}

.admin-approval-open {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--pui-radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

/* Review card */
.admin-approval-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--pui-radius-md);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.admin-approval-header h2 {
    margin: 0 0 var(--space-1);
}

.admin-approval-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    color: var(--text_muted);
    font-size: 0.9rem;
}

/* Fields: 2-col grid, thesis spans full width */
.admin-approval-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.admin-approval-block h3 {
    margin: 0 0 var(--space-1);
    font-size: 1rem;
}

.admin-approval-block--full {
    grid-column: 1 / -1;
}

.admin-approval-readonly {
    background: var(--surface_alt);
    border: 1px solid var(--border);
    border-radius: var(--pui-radius-sm);
    padding: var(--space-2) var(--space-3);
    white-space: pre-wrap;
    min-height: 2.5rem;
}

/* Preview link */
.admin-approval-preview {
    display: flex;
}

.admin-approval-preview-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--pui-radius-sm);
    background: var(--accent);
    color: var(--accent_text) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-approval-preview-link:hover {
    opacity: 0.85;
}

/* Footer: checklist + actions */
.admin-approval-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    align-items: start;
    border-top: 1px solid var(--border);
    padding-top: var(--space-4);
}

.admin-approval-checklist h3 {
    margin: 0 0 var(--space-2);
    font-size: 1rem;
}

.admin-approval-checklist-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.admin-approval-check-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.92rem;
    cursor: pointer;
}

.admin-approval-check-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.admin-approval-notes {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: 0.9rem;
    margin-top: var(--space-3);
}

/* Actions column — sits beside checklist */
.admin-approval-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: var(--space-3);
    align-self: end;
}

.admin-approval-helper {
    color: var(--text_muted);
    font-size: 0.85rem;
}

.admin-approval-buttons {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}

.admin-approval-primary,
.admin-approval-secondary {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--pui-radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-approval-primary {
    background: var(--accent);
    color: var(--accent_text);
    border-color: var(--accent);
}

.admin-approval-primary:disabled,
.admin-approval-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-approval-secondary {
    background: var(--surface);
    color: var(--text);
}

.admin-approval-error {
    color: var(--danger);
    font-size: 0.9rem;
}

.admin-approval-empty {
    color: var(--text_muted);
    padding: var(--space-4) 0;
}

/* Responsive: stack footer on narrow screens */
@media (max-width: var(--pui-breakpoint-md)) {
    .admin-approval-fields {
        grid-template-columns: 1fr;
    }
    .admin-approval-footer {
        grid-template-columns: 1fr;
    }
}

.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--text) 24%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.admin-modal {
    background: var(--surface);
    color: var(--text);
    border-radius: var(--pui-radius-md);
    padding: var(--space-5);
    width: min(520px, 90vw);
    box-shadow: var(--pui-shadow-overlay);
    display: grid;
    gap: var(--space-3);
}

.admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

@media (max-width: var(--pui-breakpoint-lg)) {
    .admin-approval-layout {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   FOOTER — approved four-column design over the shared Platform shell.
   Reuses PlatformShellFooter markup (lead column, link groups, legal row)
   and expresses only the BeforeYouTrade brand layout here.
   ══════════════════════════════════════════════════════════════════════ */
.footer-shell {
    background: var(--byt-surface-footer);
    border-top: 1px solid var(--byt-hairline);
    margin-top: 88px;
    padding: 64px 0 0;
}

/* The approved footer carries no rule above the link columns; the only
   rule is the one over the legal row. */
.footer-shell .footer-shell__divider {
    display: none;
}

.footer-top {
    grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, 1fr));
    gap: 48px;
}

.byt-footer-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 16px;
    font-weight: 600;
    color: var(--byt-text);
}

.byt-footer-brand img {
    display: block;
    flex: none;
}

.byt-footer-brand strong {
    color: var(--byt-link);
    font-weight: 700;
}

.byt-footer-tagline {
    margin: 16px 0 0;
    max-width: 300px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--byt-text-muted);
    text-wrap: pretty;
}

.footer-column h4 {
    margin: 0 0 20px;
    font-size: var(--byt-font-label);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--byt-text-label);
}

.footer-links {
    gap: 14px;
}

.footer-links a {
    font-size: 14.5px;
    font-weight: 400;
    color: var(--byt-text-secondary);
}

.footer-links a:hover {
    color: var(--byt-link-hover);
}

.footer-legal {
    justify-content: space-between;
    margin-top: 56px;
    padding-top: 22px;
    padding-bottom: 26px;
    border-top: 1px solid var(--byt-hairline-soft);
    font-size: 13px;
    color: var(--byt-text-muted);
}

.byt-footer-provenance {
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--byt-text-faint);
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }
}

@media (max-width: 560px) {
    .footer-top {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   BYT CONTROL LANGUAGE — approved design primitives shared by the
   Compare Brokers surfaces. Declared once here because CSS isolation
   cannot cross component boundaries; every value comes from a token.
   ══════════════════════════════════════════════════════════════════════ */
.byt-label {
    display: block;
    font-size: var(--byt-font-label);
    font-weight: 600;
    letter-spacing: var(--byt-letter-spacing-label);
    text-transform: uppercase;
    color: var(--byt-text-label);
}

.byt-input {
    width: 100%;
    min-height: var(--byt-control-min-height);
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--byt-text);
    background: var(--byt-surface);
    border: 1px solid var(--byt-border-control);
    border-radius: var(--byt-radius-control);
    box-sizing: border-box;
}

.byt-input::placeholder {
    color: var(--byt-text-faint);
}

.byt-input:hover {
    border-color: var(--byt-border-hover);
}

.byt-input:focus-visible {
    border-color: var(--byt-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--byt-accent-soft-strong);
}

.byt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: var(--byt-control-min-height);
    padding: 0 16px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--byt-radius-control);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.byt-button--primary {
    background: var(--byt-accent);
    color: var(--byt-on-accent);
}

.byt-button--primary:hover {
    background: var(--byt-accent-hover);
}

.byt-button--primary:active {
    background: var(--byt-accent-active);
}

.byt-button--secondary {
    background: transparent;
    color: var(--byt-text-secondary);
    border-color: var(--byt-border-hover);
}

.byt-button--secondary:hover {
    background: var(--byt-surface-hover);
    border-color: var(--byt-border-selected);
    color: var(--byt-text);
    text-decoration: none;
}

.byt-button--secondary:active {
    background: var(--byt-surface-tag);
}

.byt-button--ghost {
    background: transparent;
    color: var(--byt-link);
    padding: 0 10px;
}

.byt-button--ghost:hover {
    background: var(--byt-accent-soft);
    color: var(--byt-link-hover);
    text-decoration: none;
}

.byt-button--outlined {
    background: var(--byt-accent-soft);
    color: var(--byt-link-hover);
    border-color: var(--byt-border-selected);
}

.byt-button--outlined:hover {
    background: var(--byt-accent-soft-strong);
    border-color: var(--byt-accent);
    text-decoration: none;
}

.byt-segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--byt-surface-segment);
    border: 1px solid var(--byt-border-control);
    border-radius: var(--byt-radius-inset);
}

.byt-segmented__option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 13px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--byt-text-secondary);
    background: none;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.byt-segmented__option:hover {
    background: var(--byt-surface-hover);
    color: var(--byt-text);
}

.byt-segmented__option--selected {
    background: var(--byt-surface-segment-selected);
    color: var(--byt-text);
    box-shadow: inset 0 0 0 1px var(--byt-border-selected);
}

.byt-segmented__count {
    padding: 1px 7px;
    border-radius: var(--byt-radius-pill);
    background: var(--byt-border-control);
    color: var(--byt-link-hover);
    font-size: var(--byt-font-label);
    font-variant-numeric: tabular-nums;
}

.byt-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    flex: none;
    margin: 0;
    border: 1px solid var(--byt-border-hover);
    border-radius: 4px;
    background: var(--byt-surface-inset);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.byt-checkbox--radio {
    border-radius: var(--byt-radius-pill);
}

.byt-checkbox:hover {
    border-color: var(--byt-border-selected);
}

.byt-checkbox:checked {
    background: var(--byt-accent);
    border-color: var(--byt-accent);
}

.byt-checkbox:checked::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid var(--byt-on-accent);
    border-bottom: 2px solid var(--byt-on-accent);
    transform: rotate(-45deg) translate(0, -1px);
}

.byt-checkbox--radio:checked::after {
    width: 6px;
    height: 6px;
    border: 0;
    border-radius: var(--byt-radius-pill);
    background: var(--byt-on-accent);
    transform: none;
}

.byt-icon {
    width: 16px;
    height: 16px;
    flex: none;
    stroke-width: 2;
    transition: transform 0.12s ease;
}

.byt-icon--xs {
    width: 10px;
    height: 10px;
}

.byt-icon--sm {
    width: 15px;
    height: 15px;
}

.byt-icon--flipped {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .byt-button,
    .byt-icon,
    .byt-segmented__option,
    .learn-format-segment,
    .learn-filter-chip {
        transition: none;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   HEADER NAV ALIGNMENT — centre the primary navigation in the header.
   The shared shell lays the header out as brand | (nav-list … actions)
   with space-between, so the nav sits hard against the brand. Auto inline
   margins centre it in the free space while keeping it in flow, so it can
   never overlap the brand or the actions the way absolute centring would.
   Desktop only: below the shared 900px breakpoint the nav becomes a
   vertical drawer whose items stay left aligned.
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {
    /* `display: contents` drops the list box so the nav items become flex
       children of the header row. That lets the status indicator sit in the
       right hand cluster beside the actions instead of travelling with the
       centred menu, without changing the shared shell markup. */
    .nav-links > .nav-list {
        display: contents;
    }

    .nav-container > .nav-links {
        justify-content: flex-end;
        gap: 18px;
    }

    /* Two auto margins: one before the menu, one before the status. The menu
       settles between the brand and the right hand cluster. */
    .nav-links > .nav-list > li:first-child,
    .nav-links > .nav-list > li:has(.nav-status-link) {
        margin-left: auto;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   HEADER REFLOW — approved design behaviour for the shared shell nav.
   Below 1140px the status pill drops out and the gaps tighten so the
   primary call to action never overflows before the mobile drawer takes
   over at the shared 900px breakpoint. Host density choice, so it lives
   with the host rather than in Platform.Shell.
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) and (max-width: 1140px) {
    .nav-links {
        gap: 20px;
    }

    .nav-list {
        gap: 4px;
    }

    .nav-actions {
        gap: 8px;
    }

    .nav-list a,
    .nav-list .nav-dropdown-button {
        white-space: nowrap;
    }

    .nav-status-link {
        display: none;
    }
}
