/* MK Codeworx shared components: theme picker, footer maker mark, red x. Uses only brand-tokens.css variables. */
:root { --mk-control-h: 2.125rem; }

/* Theme picker (markup: MkThemePicker; behavior: mk-theme.js) */
.theme-toggle { position: relative; }
.theme-trigger { display: inline-grid; place-items: center; width: var(--mk-control-h); height: var(--mk-control-h); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.theme-trigger:hover, .theme-trigger[aria-expanded="true"] { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.theme-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-trigger svg { width: 1.3rem; height: 1.3rem; }
.theme-backdrop { position: fixed; inset: 0; z-index: 11; }
.theme-backdrop[hidden], .theme-panel[hidden] { display: none; }
.theme-panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 12; min-width: 10rem; padding: .35rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 .375rem .875rem -.125rem rgb(0 0 0 / .2); }
.theme-panel fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.theme-panel legend { padding: .35rem .6rem .25rem; font-size: var(--text-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.theme-option { display: flex; align-items: center; gap: .6rem; min-height: var(--mk-control-h); padding: .2rem .6rem; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; }
.theme-option:hover { background: var(--surface-2); }
.theme-option input { accent-color: var(--brand); width: 1rem; height: 1rem; margin: 0; }

/* "Powered by {MK} MK Codeworx": the {MK} follows the brand red; the x is always red */
.mk-maker { display: inline-flex; align-items: center; gap: 6px; vertical-align: baseline; }
.mk-mark { width: 44px; height: 20px; flex: none; background: var(--brand); -webkit-mask: url(../brand/mk-codeworx-mark.svg) center / contain no-repeat; mask: url(../brand/mk-codeworx-mark.svg) center / contain no-repeat; }
.cw-x { color: var(--brand); }
.mk-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.mk-link:hover strong { text-decoration: underline; text-underline-offset: .2em; }

/* Reconnect banner (markup: MkReconnectBanner). Blazor's default #components-reconnect-modal is an
   unstyled white box with a blue spinner; declaring the element ourselves with this content means
   Blazor toggles these classes on our own markup instead of attaching its own shadow-root UI. A small
   pill near the top, not a full-screen dialog, since a brief reconnect should not block the page. */
#components-reconnect-modal { display: none; position: fixed; z-index: 1000; top: .5rem; left: 50%; transform: translateX(-50%);
    max-width: calc(100vw - 2rem); padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); color: var(--text); font-size: .85rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
#components-reconnect-modal .reconnect-text { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected,
#components-reconnect-modal.components-reconnect-paused,
#components-reconnect-modal.components-reconnect-resume-failed { display: block; }
#components-reconnect-modal.components-reconnect-show .reconnect-trying { display: inline; }
#components-reconnect-modal.components-reconnect-failed .reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-failed,
#components-reconnect-modal.components-reconnect-paused .reconnect-failed,
#components-reconnect-modal.components-reconnect-resume-failed .reconnect-failed { display: inline; }
#components-reconnect-modal a { color: var(--brand); }
