h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.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."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ZHubPro Blazor skeleton loading system */
.zhub-skeleton {
    display: block;
    position: relative;
    overflow: hidden;
    background: #e9ecef;
}

.zhub-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    animation: zhub-skeleton-shimmer 1.25s infinite;
}

.zhub-skeleton-table {
    display: grid;
    gap: .75rem;
}

.zhub-skeleton-table-row {
    display: grid;
    gap: .75rem;
    align-items: center;
}

.zhub-skeleton-card {
    display: grid;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid #edf0f2;
    border-radius: .75rem;
    background: #fff;
}

.zhub-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .72);
}

.zhub-loading-box {
    display: grid;
    gap: .75rem;
    min-width: 220px;
    padding: 1rem;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .12);
    text-align: center;
}

.zhub-public-layout,
.zhub-admin-layout,
.zhub-auth-layout {
    min-height: 100vh;
}

.zhub-public-header,
.zhub-admin-sidebar {
    padding: 1rem;
}

.zhub-brand {
    font-weight: 700;
    text-decoration: none;
}

@keyframes zhub-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ZHubPro Blazor convert B06.1/B06.2 scaffold */
.zhub-public-main {
    min-height: calc(100vh - 64px);
}

.zhub-hero-panel,
.zhub-search-box,
.zhub-card,
.zhub-admin-metric,
.zhub-admin-module {
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 1rem;
    background: #fff;
}

.zhub-hero-panel,
.zhub-search-box {
    padding: 1.25rem;
}

.zhub-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.zhub-card:hover,
.zhub-admin-metric:hover,
.zhub-admin-module:hover {
    transform: translateY(-2px);
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .08);
}

.zhub-card-cover {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
}

.zhub-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zhub-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem;
}

.zhub-card a {
    color: inherit;
    text-decoration: none;
}

.zhub-admin-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    background: #f6f8fb;
}

.zhub-admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.zhub-admin-menu {
    display: grid;
    gap: .25rem;
}

.zhub-admin-menu-group {
    margin: 1rem 0 .35rem;
    color: rgba(255, 255, 255, .55);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.zhub-admin-menu-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .75rem;
    border-radius: .75rem;
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
}

.zhub-admin-menu-link:hover,
.zhub-admin-menu-link.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.zhub-admin-content {
    min-width: 0;
}

.zhub-admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 70px;
    padding: 1rem 1.5rem;
}

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

.zhub-admin-metric,
.zhub-admin-module {
    display: block;
    height: 100%;
    padding: 1rem;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}

.zhub-auth-layout {
    display: grid;
    place-items: center;
    padding: 2rem;
    background: #f6f8fb;
}

.zhub-auth-card {
    width: min(100%, 460px);
    padding: 1.5rem;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 1rem;
    background: #fff;
}

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

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

.zhub-admin-preview-table {
    table-layout: auto;
}

.zhub-admin-preview-table td,
.zhub-admin-preview-table th {
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zhub-admin-autozip-status code,
.zhub-exclude-chip {
    display: inline-block;
    max-width: 100%;
    padding: .35rem .5rem;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: .5rem;
    background: #f8fafc;
    color: #0f172a;
    overflow-wrap: anywhere;
}

/* ZHubPro Blazor convert B06.3 API compatibility */
.zhub-api-rule {
    height: 100%;
    padding: 1rem;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 1rem;
    background: #fff;
}

.zhub-api-rule > i {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: .75rem;
    border-radius: .75rem;
    background: rgba(13, 110, 253, .08);
}

.zhub-api-route-note td {
    border-top: 0;
    background: rgba(248, 250, 252, .72);
}

/* B05 legacy auth */
.zhub-auth-page {
    min-height: calc(100vh - 90px);
}

.zhub-auth-card {
    border-radius: 1rem;
}

.zhub-auth-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(13, 110, 253, .1);
    color: #0d6efd;
    font-size: 1.35rem;
}

.zhub-nav-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: .35rem;
}

/* B06-B10 public detail/economy/launcher compatibility */
.zhub-detail-cover {
    max-height: 420px;
    object-fit: cover;
}

.zhub-rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.zhub-rich-content pre,
.zhub-rich-content code {
    white-space: pre-wrap;
}

.zhub-shop-buy-card {
    top: 1rem;
}


.zhub-route-progress-inline{position:fixed;top:0;left:0;right:0;height:3px;z-index:2147483640;pointer-events:none;overflow:hidden;opacity:0;transition:opacity .16s ease}.zhub-route-progress-inline::before{content:"";position:absolute;top:0;left:0;height:3px;width:100%;transform:translateX(-100%) scaleX(.32);transform-origin:left center;background:linear-gradient(90deg,var(--zh-primary,#17a899),var(--zh-primary-2,#25b8d6),var(--zh-orange,#ff8b3d));opacity:.9;z-index:2147483640;animation:zhub-route-run 1s ease-in-out infinite}html[data-zhub-navigating="true"] .zhub-route-progress-inline{opacity:1}@keyframes zhub-route-run{0%{transform:translateX(-100%) scaleX(.32)}50%{transform:translateX(30%) scaleX(.52)}100%{transform:translateX(100%) scaleX(.25)}}
.zhub-layout-widget-host:empty{display:none}.zhub-layout-widget-host{margin-bottom:1rem}

.zhub-table-pager{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin:.65rem 0 0}.zhub-table-pager .pagination{margin-bottom:0}.zhub-table-pager .page-link{padding:.25rem .55rem;font-size:.85rem}.zhub-table-pager-info{font-size:.82rem;color:var(--bs-secondary-color,#6c757d)}.zhub-table-page-size{max-width:92px}.zhub-table-empty-row td{color:var(--bs-secondary-color,#6c757d);font-style:italic}.zhub-table-search-input{max-width:360px}.zhub-ajax-pill{font-weight:800;color:var(--zh-primary,#17a899)}

/* U01-U03 PHP layout parity shell overrides */
.admin-shell.zhub-admin-layout{display:grid;grid-template-columns:300px minmax(0,1fr);background:transparent}
.admin-shell .sidebar.zhub-admin-sidebar{min-height:100vh;height:100vh}
.admin-shell .sidebar a.active{background:rgba(255,255,255,.18);color:#fff}
.admin-shell .zhub-admin-topbar{min-height:0;margin-bottom:1rem}
.zhub-public-navbar .zhub-icon-btn{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center}
@media (max-width: 991.98px){.admin-shell.zhub-admin-layout{grid-template-columns:1fr}.admin-shell .sidebar.zhub-admin-sidebar{position:fixed;height:100vh;max-width:min(86vw,320px);transform:translateX(-105%);transition:transform .2s ease}.admin-sidebar-open .admin-shell .sidebar.zhub-admin-sidebar{transform:translateX(0)}}

/* Z99 parity hardening: generic PHP-style data table defaults. */
.zhub-object-table-search { min-width: min(22rem, 100%); }
.zhub-object-table .zhub-select-col { width: 2.75rem; }
.zhub-object-table .zhub-actions-col { width: 7rem; white-space: nowrap; }
.zhub-object-table .zhub-page-size { width: 5.25rem; }
.zhub-object-table tbody td { vertical-align: middle; }

/* Z99 mailbox/mailcenter parity hardening */
.account-item .account-main-button,
.account-item .account-main-button:hover,
.account-item .account-main-button:focus {
    color: inherit;
    box-shadow: none;
}
.account-item .account-row-actions .btn {
    border-radius: 999px;
}
html[data-zhub-navigating="true"] [data-zhub-route-body="true"] {
    opacity: .72;
    transition: opacity .12s ease-in-out;
}

/* Z99 content / commerce / file parity hardening */
.public-php-parity-page .object-fit-cover,
.file-card .object-fit-cover,
.shop-account-card .object-fit-cover,
.blog-hero-card .object-fit-cover {
    object-fit: cover;
}

.file-thumb {
    height: 170px;
}

.zhub-php-parity-crud .table td {
    max-width: 320px;
    overflow-wrap: anywhere;
}

.zhub-php-parity-crud textarea.form-control {
    font-family: inherit;
}

.forum-editor-modal .modal-dialog,
.note-modal.modal-dialog {
    max-width: min(1180px, calc(100vw - 1rem));
}

/* Z99 rich editor + file preview parity */
.zhub-rich-editor-textarea{min-height:320px;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;line-height:1.65;resize:vertical}
.zhub-rich-editor-preview{min-height:320px;background:#fff}
.zhub-rich-editor-toolbar .btn{min-width:2.25rem}
.zhub-file-picker-thumb{height:150px;overflow:hidden}
.file-preview-frame{min-height:520px;overflow:auto}
.file-preview-iframe{min-height:520px;border:0;background:#fff}
.file-card .file-thumb{height:170px;overflow:hidden;cursor:pointer}
.shop-account-card .badge{font-weight:600}
.zhub-shop-secret-card code,.zhub-purchase-secret code{user-select:all}
.zhub-rich-editor-preview{cursor:default}
.zhub-rich-editor-textarea:focus{box-shadow:none;outline:0}


/* Z99 editor/manual IMAP patch */
html, body, input, textarea, select, button {
    font-family: "Roboto", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.zhub-rich-editor {
    background: var(--zh-card, #fff);
    color: var(--zh-text, #0f172a);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.zhub-rich-editor-toolbar {
    background: linear-gradient(180deg, rgba(248,250,252,.96), rgba(241,245,249,.92));
    border-color: var(--zh-border, #e2e8f0) !important;
}

.zhub-rich-editor-visual {
    min-height: 260px;
    outline: none;
    background: var(--zh-card, #fff);
    color: var(--zh-text, #0f172a);
    cursor: text;
}

.zhub-rich-editor-visual:empty::before {
    content: attr(data-placeholder);
    color: var(--zh-muted, #64748b);
}

.zhub-rich-editor-visual:focus {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, .18);
}

.zhub-rich-editor-html,
.zhub-rich-editor-textarea {
    min-height: 260px;
    font-family: "Roboto Mono", Consolas, "Courier New", monospace;
    background: var(--zh-card, #fff);
    color: var(--zh-text, #0f172a);
}

.zhub-editor-font-select { width: 145px; }
.zhub-editor-size-select { width: 74px; }
.zhub-editor-color { width: 46px; min-height: 31px; padding: .15rem; }

.zhub-file-input-preview {
    width: 180px;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--zh-border, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
    background: var(--zh-card-2, #f8fafc);
}

.zhub-file-input-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .table,
html[data-theme="dark"] .list-group-item {
    background-color: var(--zh-card) !important;
    color: var(--zh-text) !important;
    border-color: var(--zh-border) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white {
    background: var(--zh-card-2) !important;
    color: var(--zh-text) !important;
    border-color: var(--zh-border) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: #0b1627 !important;
    color: var(--zh-text) !important;
    border-color: var(--zh-border) !important;
}

html[data-theme="dark"] .form-control::placeholder {
    color: rgba(226, 232, 240, .5);
}

html[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, .4);
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(148, 163, 184, .16);
    color: #fff;
}

/* Z99 smart mail toast UI */
.zhub-js-toast-stack { max-width: min(430px, calc(100vw - 1.25rem)); }
.zhub-toast-glass {
  --bs-toast-color: #fff;
  --bs-toast-bg: transparent;
  color: #fff !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, .98), rgba(30, 64, 175, .97));
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.2) !important;
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .36), inset 0 1px 0 rgba(255,255,255,.18) !important;
}
.zhub-toast-success { background: linear-gradient(135deg, rgba(6, 78, 59, .99), rgba(21, 128, 61, .98)); }
.zhub-toast-danger { background: linear-gradient(135deg, rgba(127, 29, 29, .99), rgba(190, 18, 60, .98)); }
.zhub-toast-warning { background: linear-gradient(135deg, rgba(120, 53, 15, .99), rgba(194, 65, 12, .98)); }
.zhub-toast-info { background: linear-gradient(135deg, rgba(8, 47, 73, .99), rgba(29, 78, 216, .98)); }
.zhub-toast-primary { background: linear-gradient(135deg, rgba(30, 41, 59, .99), rgba(37, 99, 235, .98)); }
.zhub-toast-secondary { background: linear-gradient(135deg, rgba(51, 65, 85, .99), rgba(71, 85, 105, .98)); }
.zhub-toast-inner { display: grid; grid-template-columns: 46px minmax(0, 1fr) 28px; gap: .75rem; align-items: start; padding: .98rem; }
.zhub-toast-icon { width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); font-size: 1.12rem; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.zhub-toast-content { min-width: 0; color: #fff; }
.zhub-toast-title-row { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.zhub-toast-title-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: .96rem; font-weight: 800; letter-spacing: .01em; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.zhub-toast-title-row small { margin-left: auto; color: rgba(255,255,255,.88); white-space: nowrap; font-size: .72rem; font-weight: 700; }
.zhub-toast-message { color: #f8fafc; font-size: .9rem; font-weight: 600; line-height: 1.42; margin-top: .24rem; word-break: break-word; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.zhub-toast-action { display: inline-flex; align-items: center; width: fit-content; margin-top: .58rem; padding: .28rem .62rem; border-radius: 999px; background: rgba(255,255,255,.92); color: #0f172a; font-weight: 800; font-size: .76rem; box-shadow: 0 8px 18px rgba(15,23,42,.2); }
.zhub-toast-close { align-self: start; opacity: .95; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.zhub-toast-clickable { cursor: pointer; transition: transform .16s ease, filter .16s ease; }
.zhub-toast-clickable:hover { transform: translateY(-2px); filter: brightness(1.06); }
[data-bs-theme="dark"] .zhub-toast-glass { box-shadow: 0 18px 48px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.16) !important; }

/* Z99 communication/chat parity: compact responsive tables + Messenger-like dock */
.zhub-js-toast-item { color: #fff; }
.zhub-js-toast-item .zhub-toast-message,
.zhub-js-toast-item .zhub-toast-title-row { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.zhub-js-toast-item .zhub-toast-action { display:inline-flex; align-items:center; width:max-content; max-width:100%; margin-top:.35rem; padding:.2rem .55rem; border-radius:999px; background:rgba(255,255,255,.92); color:#0f172a; text-shadow:none; font-weight:800; }
.zhub-toast-primary,.zhub-toast-info { background:linear-gradient(135deg,#1558d6,#1495d8); }
.zhub-toast-success { background:linear-gradient(135deg,#147a45,#21a366); }
.zhub-toast-warning { background:linear-gradient(135deg,#a15c00,#d28a09); }
.zhub-toast-danger { background:linear-gradient(135deg,#b42318,#d64545); }
.zhub-toast-clickable { cursor:pointer; }

.zhub-chat-dock { position:fixed; right:18px; bottom:18px; z-index:1088; }
.zhub-chat-dock[data-zhub-draggable="true"] { right:auto; bottom:auto; touch-action:none; transition:left .18s ease, top .18s ease, transform .16s ease; }
.zhub-chat-dock[data-zhub-dragging="true"] { transition:none; cursor:grabbing; }
.zhub-chat-dock[data-zhub-draggable="true"] .zhub-chat-fab,
.zhub-chat-dock[data-zhub-draggable="true"] .zhub-chat-header { cursor:grab; touch-action:none; -webkit-user-select:none; user-select:none; }
.zhub-chat-dock[data-zhub-dragging="true"] .zhub-chat-fab,
.zhub-chat-dock[data-zhub-dragging="true"] .zhub-chat-header { cursor:grabbing; }
.zhub-chat-dock[data-zhub-dragging="true"] .zhub-chat-fab { transform:scale(1.04); box-shadow:0 18px 42px rgba(37,99,235,.28) !important; }
html.zhub-chat-dragging-page, html.zhub-chat-dragging-page * { cursor:grabbing !important; user-select:none !important; }
.zhub-chat-panel { width:min(390px,calc(100vw - 24px)); max-height:min(720px,calc(100vh - 32px)); background:var(--bs-body-bg); border:1px solid rgba(0,0,0,.08); display:flex; flex-direction:column; }
.zhub-chat-header { padding:.75rem .85rem; color:#fff; background:linear-gradient(135deg,#0d6efd,#6f42c1); }
.zhub-chat-header small { color:rgba(255,255,255,.75); }
.zhub-chat-header-icon { display:inline-grid; place-items:center; width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,.18); }
.zhub-chat-tabs .btn { border-radius:0 !important; }
.zhub-chat-body { min-height:270px; max-height:390px; overflow-y:auto; padding:.75rem; background:linear-gradient(180deg,rgba(13,110,253,.04),rgba(111,66,193,.04)); flex:1 1 auto; }
.zhub-chat-message { display:flex; gap:.55rem; align-items:flex-start; margin-bottom:.65rem; }
.zhub-chat-message.is-me { justify-content:flex-end; }
.zhub-chat-message.is-me .zhub-chat-bubble { flex:0 1 auto; max-width:82%; color:#fff; background:linear-gradient(135deg,#0d6efd,#5b6cff); border-color:transparent; border-bottom-right-radius:.35rem; }
.zhub-chat-message:not(.is-me) .zhub-chat-bubble { border-bottom-left-radius:.35rem; }
.zhub-chat-message.is-me .zhub-chat-meta, .zhub-chat-message.is-me .zhub-chat-meta strong { color:rgba(255,255,255,.82); }
.zhub-chat-message.is-me .zhub-chat-meta span { background:rgba(255,255,255,.18); color:#fff; }
.zhub-chat-message.is-new .zhub-chat-bubble { border-color:rgba(13,110,253,.38); box-shadow:0 8px 24px rgba(13,110,253,.12); }
.zhub-chat-message.is-pending { opacity:.72; }
.zhub-chat-bubble { min-width:0; flex:1; padding:.55rem .65rem; border-radius:1rem; background:var(--bs-body-bg); border:1px solid rgba(0,0,0,.06); }
.zhub-chat-meta { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; font-size:.76rem; color:var(--bs-secondary-color); }
.zhub-chat-meta strong { color:var(--bs-body-color); max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.zhub-chat-meta span { border-radius:999px; padding:.05rem .4rem; background:var(--bs-tertiary-bg); }
.zhub-chat-text { overflow-wrap:anywhere; word-break:break-word; }
.zhub-chat-compose-bottom { flex:0 0 auto; }
.zhub-chat-input-row { display:flex; align-items:center; gap:.45rem; }
.zhub-chat-input-row .form-control { min-height:38px; background:var(--bs-tertiary-bg); border-color:transparent; }
.zhub-chat-send { width:38px; height:38px; display:inline-grid; place-items:center; flex:0 0 auto; }
.zhub-chat-search { position:relative; }
.zhub-user-search-results { position:absolute; left:.5rem; right:.5rem; top:calc(100% - .25rem); max-height:330px; overflow:auto; background:var(--bs-body-bg); border:1px solid rgba(0,0,0,.08); z-index:2; }
.zhub-user-result { width:100%; display:flex; gap:.55rem; align-items:center; padding:.5rem .6rem; border:0; background:transparent; text-align:left; }
.zhub-user-result:hover { background:var(--bs-tertiary-bg); }
.zhub-avatar-img,.zhub-avatar-fallback { flex:0 0 auto; border-radius:50%; object-fit:cover; box-shadow:0 0 0 2px rgba(255,255,255,.85); }
.zhub-avatar-fallback { display:inline-grid; place-items:center; font-weight:800; color:#fff; background:linear-gradient(135deg,#0d6efd,#6f42c1); }
.zhub-chat-fab { position:relative; display:inline-grid; place-items:center; width:58px; height:58px; border-radius:50%; border:0; color:#fff; background:linear-gradient(135deg,#0d6efd,#6f42c1); font-size:1.35rem; }
.zhub-chat-fab .badge { position:absolute; top:-4px; right:-4px; }

.table, .zhub-object-table, .data-table, .admin-table { table-layout:fixed; width:100%; }
.table th, .table td, .zhub-object-table th, .zhub-object-table td, .data-table th, .data-table td, .admin-table th, .admin-table td { white-space:normal !important; overflow-wrap:anywhere; word-break:break-word; vertical-align:middle; }
.table-responsive { scrollbar-width:thin; }
.zhub-admin-content .table-responsive, .zhub-public-layout .table-responsive { overflow-x:auto; }
@media (min-width: 992px) {
  .zhub-admin-content .table-responsive, .zhub-public-layout .table-responsive { overflow-x:visible; }
  .zhub-admin-content table, .zhub-public-layout table { font-size:.92rem; }
}
@media (max-width: 575.98px) {
  .zhub-chat-dock { right:8px; bottom:8px; left:8px; }
  .zhub-chat-panel { width:100%; max-height:calc(100vh - 16px); }
  .zhub-chat-body { max-height:calc(100vh - 330px); }
  .zhub-chat-fab { margin-left:auto; }
  .zhub-chat-dock[data-zhub-draggable="true"] { left:auto; right:auto; bottom:auto; width:max-content; max-width:calc(100vw - 16px); }
  .zhub-chat-dock[data-zhub-draggable="true"].is-open { width:auto; }
  .zhub-chat-dock[data-zhub-draggable="true"] .zhub-chat-panel { width:min(390px, calc(100vw - 16px)); max-height:calc(100vh - 16px); }
  .zhub-chat-dock[data-zhub-draggable="true"] .zhub-chat-fab { margin-left:0; }
}


/* Z99 release + mailbox iframe theme injection */
.viewer-frame.zhub-mail-frame,
iframe[data-zhub-mail-frame="true"] {
    width: 100%;
    min-height: min(62vh, 680px);
    border: 1px solid var(--zh-border, #d8e2ed);
    border-radius: 16px;
    background: var(--zh-card, #fff);
    color: var(--zh-text, #0f172a);
    display: block;
}
.zhub-mail-detail-tabs,
.zhub-mail-html-viewer,
.zhub-mail-text-viewer {
    background: var(--zh-card, #fff) !important;
    color: var(--zh-text, #0f172a) !important;
    border-color: var(--zh-border, #d8e2ed) !important;
}
html[data-theme="dark"] .viewer-frame.zhub-mail-frame,
html[data-theme="dark"] iframe[data-zhub-mail-frame="true"] {
    background: #0b1220;
    color: #e5edf8;
}
@media (max-width: 768px) {
    .viewer-frame.zhub-mail-frame,
    iframe[data-zhub-mail-frame="true"] {
        min-height: 56vh;
        border-radius: 12px;
    }
}

/* B32: Blazor-native SignalR toast should always render above public/admin shells. */
.zhub-toast-stack {
  z-index: 1125;
}

.zhub-toast-stack .zhub-toast-item {
  animation: zhubToastSlideIn .18s ease-out;
}

@keyframes zhubToastSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* B33 compact CRUD/table + MySQL CSS theme manager */
.zhub-compact-table-wrap { max-width: 100%; overflow: auto; }
.zhub-compact-data-table th, .zhub-compact-data-table td, .zhub-auto-compact-table th, .zhub-auto-compact-table td { vertical-align: top; }
.zhub-short-group-cell { min-width: 220px; line-height: 1.45; }
.zhub-short-group-cell > div { border-bottom: 1px dashed rgba(148,163,184,.35); padding: .12rem 0; }
.zhub-short-group-cell > div:last-child { border-bottom: 0; }
.zhub-long-scroll-cell, .zhub-auto-long-cell { max-width: 420px; }
.zhub-long-scroll-cell { max-height: 150px; overflow: auto; border: 1px solid rgba(148,163,184,.35); background: rgba(248,250,252,.86); border-radius: 12px; padding: .65rem; }
.zhub-long-scroll-cell pre, .zhub-theme-preview-box pre { white-space: pre-wrap; word-break: break-word; margin: 0; font-size: .78rem; }
.zhub-auto-long-cell { max-height: 160px; overflow: auto; white-space: normal; word-break: break-word; }
.zhub-auto-short-cell { white-space: normal; }
.zhub-theme-choice-card { transition: transform .16s ease, box-shadow .16s ease; }
.zhub-theme-choice-card:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(15,23,42,.12) !important; }
.zhub-theme-preview-box { max-height: 130px; overflow: auto; border: 1px solid rgba(148,163,184,.35); border-radius: 14px; padding: .75rem; background: rgba(248,250,252,.84); }
[data-theme="dark"] .zhub-long-scroll-cell, [data-theme="dark"] .zhub-theme-preview-box { background: rgba(15,23,42,.72); border-color: rgba(148,163,184,.24); }
@media (max-width: 767.98px) {
  .zhub-auto-compact-table { min-width: 720px; }
  .zhub-long-scroll-cell, .zhub-auto-long-cell { max-width: 280px; }
}

/* B64 - mobile-friendly desktop skin after removing physical *Mobile route/layout runtime. */
.zhub-html-clamp {
    --zhub-clamp-lines: 2;
    display: -webkit-box;
    -webkit-line-clamp: var(--zhub-clamp-lines);
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
.zhub-html-clamp :where(p,div,h1,h2,h3,h4,h5,h6,blockquote,ul,ol) {
    display: inline;
    margin: 0;
    padding: 0;
}
.zhub-html-clamp :where(br) { display: none; }
.zhub-html-clamp :where(img,video,iframe,table,pre,code) { display: none !important; }
.zhub-card-title { color: var(--bs-heading-color, #0f172a); font-weight: 800; line-height: 1.25; }
.zhub-card-summary { line-height: 1.55; }

.admin-shell .admin-mobile-toggle,
.admin-shell .admin-sidebar-backdrop { display: none; }
.admin-shell .admin-sidebar-backdrop { border: 0; padding: 0; }
@media (max-width: 991.98px) {
    .admin-shell.zhub-admin-layout { display: block !important; }
    .admin-shell .sidebar.zhub-admin-sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: min(86vw, 340px) !important;
        max-width: min(86vw, 340px) !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
        transform: translateX(-108%) !important;
        transition: transform .22s ease !important;
        z-index: 1045 !important;
        box-shadow: 0 24px 70px rgba(15,23,42,.28) !important;
    }
    html.admin-sidebar-open .admin-shell .sidebar.zhub-admin-sidebar,
    .admin-sidebar-open .admin-shell .sidebar.zhub-admin-sidebar {
        transform: translateX(0) !important;
    }
    .admin-shell .admin-mobile-toggle,
    body > .admin-mobile-toggle {
        display: inline-flex !important;
        align-items: center;
        gap: .45rem;
        position: fixed !important;
        left: 1rem !important;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 1055 !important;
        border: 1px solid rgba(15,23,42,.1) !important;
        background: rgba(255,255,255,.96) !important;
        color: #0f172a !important;
        border-radius: 999px !important;
        padding: .72rem 1rem !important;
        font-weight: 900 !important;
        box-shadow: 0 16px 42px rgba(15,23,42,.18) !important;
    }
    .admin-shell .admin-sidebar-backdrop,
    body > .admin-sidebar-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1040 !important;
        background: rgba(15,23,42,.48) !important;
        backdrop-filter: blur(5px) !important;
    }
    html.admin-sidebar-open .admin-shell .admin-sidebar-backdrop,
    html.admin-sidebar-open body > .admin-sidebar-backdrop,
    .admin-sidebar-open .admin-shell .admin-sidebar-backdrop {
        display: block !important;
    }
    .admin-shell .zhub-admin-content,
    .zhub-admin-content {
        padding: 1rem .78rem 5.25rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .zhub-admin-topbar {
        border-radius: 1.15rem !important;
        background: rgba(255,255,255,.78) !important;
        backdrop-filter: blur(12px) !important;
        padding: .85rem !important;
        box-shadow: 0 12px 32px rgba(15,23,42,.08) !important;
    }
}

@media (max-width: 575.98px) {
    html { font-size: 15px; }
    body { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
    .container, .container-fluid { padding-left: .85rem !important; padding-right: .85rem !important; }
    h1, .h1 { font-size: clamp(1.55rem, 7vw, 2.05rem) !important; line-height: 1.16; letter-spacing: -.025em; }
    h2, .h2 { font-size: clamp(1.28rem, 5.6vw, 1.65rem) !important; line-height: 1.2; letter-spacing: -.018em; }
    h3, .h3 { font-size: clamp(1.12rem, 4.8vw, 1.38rem) !important; line-height: 1.24; }
    .h4, h4 { font-size: 1.08rem !important; }
    .h5, h5 { font-size: 1rem !important; }
    p, .text-muted, .small { line-height: 1.55; }
    .small { font-size: .84rem; }
    .card, .zhub-card, .zhub-search-box, .zhub-hero-panel {
        border-radius: 1.18rem !important;
        box-shadow: 0 12px 34px rgba(15,23,42,.08) !important;
    }
    .card-body, .zhub-card-body { padding: 1rem !important; }
    .btn { border-radius: .9rem; font-weight: 800; }
    .btn-sm { border-radius: .78rem; }
    .form-control, .form-select, .input-group-text { border-radius: .9rem; min-height: 42px; }
    .input-group > .form-control:not(:first-child), .input-group > .form-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
    .input-group > .form-control:not(:last-child), .input-group > .form-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
    .zhub-card-title { font-size: 1.02rem !important; letter-spacing: -.01em; }
    .zhub-card-summary { font-size: .88rem !important; }
    .blog-hero-card .card-body { padding: 1.1rem !important; }
    .list-group-item { border-radius: 1rem !important; margin-bottom: .65rem; border: 1px solid rgba(15,23,42,.08) !important; }
    .table-responsive { border-radius: 1rem; }
}

/* B80: smooth SPA/mail scroll targets */
html {
    scroll-behavior: smooth;
}

#admin-mail-account-section,
#admin-mail-list-section,
#adminMailViewerPane,
#mailbox-account-section,
#mailbox-email-section,
#mailbox-viewer-section,
#mailViewerPane,
#mailbox-game-note-section,
[data-mail-account-id],
[data-admin-mail-id],
.account-item,
.mail-item {
    scroll-margin-top: 88px;
}

.zhub-scroll-focus {
    animation: zhub-scroll-focus-pulse 1.35s ease-out 1;
}

.account-item,
.mail-item,
[data-mail-account-id],
[data-admin-mail-id],
.zhub-card,
.card,
.table tbody tr,
.btn {
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease;
}

@keyframes zhub-scroll-focus-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, .32);
        transform: translateY(-1px);
    }
    65% {
        box-shadow: 0 0 0 .5rem rgba(13, 110, 253, 0);
        transform: translateY(0);
    }
    100% {
        box-shadow: none;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .zhub-scroll-focus,
    .account-item,
    .mail-item,
    [data-mail-account-id],
    [data-admin-mail-id],
    .zhub-card,
    .card,
    .table tbody tr,
    .btn {
        animation: none !important;
        transition: none !important;
    }
}

/* B63 form layout hardening: keep PHP form->table columns; only roles picker owns a full row. */

textarea.form-control,
.zhub-rich-editor,
.zhub-full-width-editor,
.zhub-rich-editor .zhub-rich-editor-textarea,
.zhub-rich-editor .zhub-rich-editor-visual,
.zhub-role-checkbox-picker {
    display: block;
    width: 100%;
    max-width: 100%;
}

.zhub-rich-editor,
.zhub-full-width-editor {
    grid-column: auto;
}

/* B63 Launcher PHP manager split: keep form/tooling on the left and data table on the right, like PHP manager pages. */
.zhub-launcher-php-manager {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.zhub-launcher-php-manager > form,
.zhub-launcher-php-manager > form + .card:not(.zhub-launcher-crud-panel) {
    grid-column: 1;
}

.zhub-launcher-php-manager > .zhub-launcher-crud-panel {
    grid-column: 2;
}

.zhub-launcher-php-manager > .card:not(.zhub-launcher-crud-panel):not(:has(+ .zhub-launcher-crud-panel)) {
    grid-column: 2;
}

@media (max-width: 991.98px) {
    .zhub-launcher-php-manager {
        display: block;
    }
}
