/* MOS Desk – application styles (supplement to MudBlazor) */
:root {
    --mh-primary: #1f4e79;
    --mh-border: #e1e5ea;
    --mh-muted: #5f6b7a;
    --mh-bg: #f3f5f8;
    --mh-note: #fff8e1;
    --mh-note-border: #f2d98a;
    --mh-outbound: #eef5fc;
    --mh-outbound-border: #c9dff3;
    --mh-text: #1f2933;
    --mh-surface: #fff;
    --mh-surface-2: #f3f5f8;
    --mh-border-strong: #cfd6de;
    --mh-error: #b3261e;
    --mh-warn-text: #8a5300;
}

html, body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--mh-bg);
    margin: 0;
}

a { color: var(--mh-primary); }
code, kbd, pre { font-family: Consolas, "Courier New", monospace; font-size: .85em; }
kbd { border: 1px solid #c5cbd3; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }

/* ---------- Shell ---------- */
.mh-appbar .mud-toolbar { gap: 4px; }
.mh-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.05rem; line-height: 1; letter-spacing: .01em; white-space: nowrap; margin-right: 24px; }
/* The mark is a red disc with transparent cut-outs: the colour of the bar shows through. The image is a
   pre-scaled 96 px version, which stays sharp at this size on normal and high-resolution screens. */
.mh-brand-mark { width: 28px; height: 28px; display: block; flex: 0 0 auto; }
.mh-global-search { flex: 1 1 520px; max-width: 640px; }
.mh-search-field .mud-input.mud-input-outlined { background: rgba(255,255,255,.14); border-radius: 6px; color: #fff; }
.mh-search-field .mud-input-outlined-border { border-color: transparent !important; }
.mh-search-field input::placeholder { color: rgba(255,255,255,.8); opacity: 1; }
.mh-search-field .mud-input-adornment .mud-icon-root, .mh-search-field .mud-icon-button { color: rgba(255,255,255,.9); }
.mh-search-field .mud-input-control-input-container, .mh-search-field { margin: 0 !important; }
.mh-search-field .mud-input.mud-input-outlined { height: 36px; }
.mh-search-field .mud-input-slot { padding-top: 6px !important; padding-bottom: 6px !important; }
.mh-search-field .mud-input:focus-within { background: rgba(255,255,255,.24); }

.mh-drawer { border-right: 1px solid var(--mh-border); }
.mh-nav { padding: 8px 0 24px; }
.mh-nav-section { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mh-muted); padding: 16px 16px 4px; }
.mh-nav .mud-nav-link { padding-top: 5px; padding-bottom: 5px; }
.mh-nav .mud-nav-link-text { display: flex; align-items: center; gap: 8px; width: 100%; }
.mh-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-nav-count { font-size: .72rem; font-weight: 600; color: var(--mh-muted); background: #eef1f5; border-radius: 10px; padding: 0 7px; min-width: 22px; text-align: center; }
.mh-nav-count:empty { display: none; }
.mh-nav-count-alert { background: #fdecea; color: #b3261e; }
.mh-nav .mud-nav-link.active { font-weight: 600; }

.mh-main { min-height: 100vh; }
.mh-page { padding: 16px 20px 32px; max-width: 1680px; }
.mh-page-narrow { max-width: 1100px; }
.mh-page-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
/* A long name (a contact, a company) wraps instead of running off the screen. */
.mh-page-header h1 { font-size: 1.3rem; font-weight: 600; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mh-page-header .mh-sub { color: var(--mh-muted); font-size: .85rem; }
.mh-spacer { flex: 1; }
.mh-center-message { padding: 48px; text-align: center; color: var(--mh-muted); }
.mh-muted { color: var(--mh-muted); }
.mh-small { font-size: .78rem; }
.mh-nowrap { white-space: nowrap; }
/* Long words without spaces (an e-mail address, a Graph id, a message from the database) break inside their cell. */
.mh-break { overflow-wrap: anywhere; }
.mh-card { background: #fff; border: 1px solid var(--mh-border); border-radius: 8px; }
.mh-card-pad { padding: 14px 16px; }
.mh-card-title { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mh-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.mh-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--mh-border); }
.mh-toolbar .mud-input-control { margin: 0; }
.mh-filter { width: 158px; flex: 0 0 auto; }
.mh-filter-wide { width: 240px; flex: 0 0 auto; }
/* No empty space for helper text below filters in a toolbar. */
.mh-toolbar .mud-input-control > .mud-input-control-helper-container { display: none; }
.mh-link-row { cursor: pointer; }
.mh-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: .85rem; }
.mh-dl dt { color: var(--mh-muted); }
.mh-dl dd { margin: 0; overflow-wrap: anywhere; }
.mh-chip { display: inline-flex; align-items: center; border-radius: 12px; padding: 1px 9px; font-size: .74rem; font-weight: 600; color: #fff; white-space: nowrap; line-height: 1.6; }
.mh-chip-outline { background: #fff !important; border: 1px solid currentColor; }
.mh-badge-new { display: inline-block; background: #e8f1fb; color: #1558a6; border-radius: 10px; font-size: .68rem; font-weight: 700; padding: 0 7px; margin-left: 6px; vertical-align: middle; }
.mh-prio { font-weight: 600; font-size: .78rem; }
.mh-prio-4 { color: #b3261e; }
.mh-prio-3 { color: #c25e00; }
.mh-prio-2 { color: #46627f; }
.mh-prio-1 { color: #8a94a0; }

/* ---------- Tables ---------- */
.mud-table .mud-table-cell { padding: 6px 12px; }
.mud-table-head .mud-table-cell { font-weight: 600; color: var(--mh-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.mh-ticket-subject { font-weight: 500; }
.mh-row-unread .mh-ticket-subject { font-weight: 700; }
.mh-bulkbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #e8f1fb; border-bottom: 1px solid #c9dff3; }

/* ---------- Dashboard ---------- */
.mh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mh-stat { display: block; text-decoration: none; color: inherit; padding: 14px 16px; }
.mh-stat:hover { border-color: #b9c6d6; }
.mh-stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; color: var(--mh-primary); }
.mh-stat-label { color: var(--mh-muted); font-size: .82rem; }
.mh-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }

/* ---------- Ticket detail ---------- */
.mh-ticket { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .mh-ticket { grid-template-columns: 1fr; } }
.mh-ticket-head { padding: 12px 16px; border-bottom: 1px solid var(--mh-border); }
.mh-ticket-title { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.mh-ticket-title h1 { font-size: 1.2rem; font-weight: 600; margin: 0; flex: 1; min-width: 240px; overflow-wrap: anywhere; }
.mh-ticket-number { color: var(--mh-muted); font-weight: 600; }
.mh-ticket-browse { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.mh-ticket-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mh-conversation { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.mh-msg { border: 1px solid var(--mh-border); border-radius: 8px; background: #fff; }
.mh-msg-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--mh-border); font-size: .82rem; flex-wrap: wrap; }
.mh-msg-author { font-weight: 600; }
.mh-msg-type { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; padding: 1px 6px; }
.mh-msg-body { padding: 10px 14px; overflow-x: auto; overflow-wrap: anywhere; font-size: .9rem; }
.mh-msg-body img { max-width: 100%; height: auto; }

/* Enlarging an image from a message or an article (lightbox in app.js). */
img.mh-zoomable { cursor: zoom-in; }
html.mh-lightbox-open { overflow: hidden; }
.mh-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(12, 16, 22, .92); display: flex; flex-direction: column; color: #fff; }
.mh-lightbox-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; flex: 0 0 auto; }
.mh-lightbox-count { margin-right: auto; font-size: .9rem; opacity: .85; }
.mh-lightbox-btn { border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; border-radius: 6px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; text-decoration: none; line-height: 1.4; }
.mh-lightbox-btn:hover, .mh-lightbox-nav:hover { background: rgba(255, 255, 255, .22); }
.mh-lightbox-btn:focus-visible, .mh-lightbox-nav:focus-visible { outline: 2px solid #9cc7f5; outline-offset: 2px; }
.mh-lightbox-btn[hidden] { display: none; }
.mh-lightbox-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 64px 16px; }
.mh-lightbox-image { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 6px 30px rgba(0, 0, 0, .5); cursor: zoom-in; }
.mh-lightbox-image.mh-lightbox-fits { cursor: default; }
/* Actual size: the image keeps its own size and the stage scrolls. */
.mh-lightbox-actual .mh-lightbox-stage { display: block; overflow: auto; padding: 0 16px 16px; }
.mh-lightbox-actual .mh-lightbox-image { max-width: none; max-height: none; cursor: zoom-out; }
.mh-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 44px; height: 64px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.mh-lightbox-prev { left: 10px; }
.mh-lightbox-next { right: 10px; }
.mh-lightbox-single .mh-lightbox-nav { display: none; }
@media (max-width: 700px) { .mh-lightbox-stage { padding: 0 8px 8px; } .mh-lightbox-nav { top: auto; bottom: 12px; transform: none; } }
.mh-msg-body p { margin: 0 0 .6em; }
.mh-msg-body table { border-collapse: collapse; }
.mh-msg-body td, .mh-msg-body th { border: 1px solid #cfd6de; padding: 3px 8px; }
.mh-msg-body blockquote { border-left: 3px solid #cfd6de; margin: 8px 0; padding-left: 10px; color: var(--mh-muted); }
.mh-msg-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.mh-file { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--mh-border); border-radius: 6px; padding: 3px 9px; font-size: .78rem; text-decoration: none; background: #fafbfc; color: inherit; }
.mh-file:hover { border-color: #b9c6d6; }
.mh-video { flex: 0 0 100%; max-width: 560px; border-radius: 6px; background: #000; }
.mh-msg-inbound .mh-msg-type { background: #e7f4ea; color: #1b5e20; }
.mh-msg-outbound { background: var(--mh-outbound); border-color: var(--mh-outbound-border); }
.mh-msg-outbound .mh-msg-head { border-color: var(--mh-outbound-border); }
.mh-msg-outbound .mh-msg-type { background: #d2e6f8; color: #0d47a1; }
.mh-msg-note { background: var(--mh-note); border-color: var(--mh-note-border); }
.mh-msg-note .mh-msg-head { border-color: var(--mh-note-border); }
.mh-msg-note .mh-msg-type { background: #f5d76e; color: #5d4500; }
.mh-event { display: flex; gap: 8px; align-items: flex-start; color: var(--mh-muted); font-size: .78rem; padding: 0 6px; }
.mh-event-text { white-space: pre-line; flex: 1; }
.mh-event-resolved { color: #1b5e20; }
.mh-event-silent { color: #8a5300; }
/* An attachment of the customer's e-mail that is not in the ticket: the agent must notice it. */
.mh-event-missing { color: #8a5300; font-weight: 600; }
.mh-compose { border-top: 1px solid var(--mh-border); padding: 12px 16px 16px; }
.mh-compose-note { background: var(--mh-note); }
.mh-compose-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mh-attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* The side panel stays in view and scrolls on its own, so ticket details and related Solutions
   remain reachable even with a long conversation while writing a reply. */
.mh-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 64px; max-height: calc(100vh - 76px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
@media (max-width: 1100px) { .mh-side { position: static; max-height: none; overflow: visible; } }
.mh-side .mud-input-control { margin-top: 4px; margin-bottom: 4px; }

/* Collapsible side panel of the ticket. The state lives on <html> (set by mhSide in app.js), so it is applied
   before the page is drawn and survives every re-render. */
.mh-side-rail { display: none; }
.mh-side-collapse, .mh-side-rail-button { border: 0; background: transparent; color: var(--mh-muted); cursor: pointer; border-radius: 6px; padding: 2px; display: inline-flex; align-items: center; }
.mh-side-collapse:hover, .mh-side-rail-button:hover { background: rgba(127, 127, 127, .16); color: var(--mh-primary); }
.mh-side-collapse:focus-visible, .mh-side-rail-button:focus-visible { outline: 2px solid var(--mh-primary); outline-offset: 1px; }
html[data-ticket-side="collapsed"] .mh-ticket { grid-template-columns: minmax(0, 1fr) 44px; }
html[data-ticket-side="collapsed"] .mh-side > :not(.mh-side-rail) { display: none; }
html[data-ticket-side="collapsed"] .mh-side { overflow: visible; padding-right: 0; }
html[data-ticket-side="collapsed"] .mh-side-rail { display: block; }
.mh-side-rail-button { position: relative; flex-direction: column; gap: 8px; width: 44px; padding: 10px 0; background: var(--mh-surface, #fff); border: 1px solid var(--mh-border); border-radius: 8px; }
.mh-side-rail-label { writing-mode: vertical-rl; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mh-side-rail-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #e65100; }
@media (max-width: 1100px) {
    /* Narrow screens: the panel sits below the conversation, so the rail becomes a bar. */
    html[data-ticket-side="collapsed"] .mh-ticket { grid-template-columns: 1fr; }
    .mh-side-rail-button { flex-direction: row; width: 100%; padding: 8px 12px; justify-content: flex-start; }
    .mh-side-rail-label { writing-mode: horizontal-tb; }
}
.mh-related-item { border-top: 1px solid var(--mh-border); padding: 8px 0; }
.mh-related-item:first-child { border-top: none; }
.mh-related-title { font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--mh-primary); }
.mh-related-title:hover { text-decoration: underline; }
.mh-presence { display: inline-flex; align-items: center; gap: 4px; background: #fff4e5; color: #8a5300; border-radius: 12px; padding: 1px 10px; font-size: .76rem; font-weight: 600; }
.mh-upload-label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--mh-primary); font-size: .82rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.mh-upload-label:hover { background: #eef3f8; }
.mh-upload-label input[type=file] { display: none; }

/* ---------- Editor ---------- */
.mh-editor .jodit-container { border-color: #c5cbd3 !important; border-radius: 6px; }
.mh-editor .jodit-wysiwyg { font-size: .9rem; font-family: "Segoe UI", Arial, sans-serif; }
.mh-editor .jodit-wysiwyg img { max-width: 100%; height: auto; }
.mh-editor .jodit-wysiwyg table { border-collapse: collapse; }
.mh-editor .jodit-wysiwyg td, .mh-editor .jodit-wysiwyg th { border: 1px solid #b9c2cc; padding: 3px 8px; min-width: 2em; }
.jodit-popup, .jodit-dialog { z-index: 2000 !important; }
/* The editor in full screen covers the app (its bar is at --mud-zindex-appbar), but stays below the dialogs and messages
   of the app. Jodit's own value (100000) put a dialog or message that a toolbar button opens behind the editor. */
:root { --jd-z-index-full-size: calc(var(--mud-zindex-dialog) - 50); }
/* In full screen Jodit shrinks html and body to 0 by 0, which gave a list in a dialog of the app (the language in
   "Code invoegen") a width of 0. Full size with the overflow hidden keeps the page underneath from scrolling as well. */
html.jodit_fullsize-box_true, body.jodit_fullsize-box_true { width: 100% !important; height: 100% !important; }
/* "Opslaan" in the toolbar (the editor of Solutions) is for full screen only; outside it the page's own button is there. */
.jodit-container:not(.jodit_fullsize) .jodit-toolbar-button_mhSave { display: none; }
/* The colleagues "@" offers in an interne notitie (RichTextEditor.razor.js), placed under the cursor. */
.mh-mention-list { position: fixed; z-index: 2000; min-width: 12rem; max-width: 20rem; padding: 4px 0; background: var(--mh-surface);
    border: 1px solid var(--mh-border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); font-size: .875rem; }
.mh-mention-item { padding: 4px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-mention-item:hover, .mh-mention-item-active { background: var(--mh-surface-2); }
/* A named colleague in the editor and in a stored note. */
.mh-editor .jodit-wysiwyg span[data-mention], .mh-msg-body span[data-mention] { color: #0b5cad; font-weight: 600; }

/* ---------- Article content (internal and public) ---------- */
.mh-article { font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
/* A link within the text scrolls to its place; keep that place clear of the fixed bar at the top. */
.mh-article, .mh-msg-body, [data-anchor] { scroll-margin-top: 80px; }
.mh-article h1, .mh-article h2, .mh-article h3 { font-weight: 600; margin: 1.2em 0 .4em; }
.mh-article h2 { font-size: 1.2rem; }
.mh-article h3 { font-size: 1.05rem; }
.mh-article img { max-width: 100%; height: auto; border: 1px solid var(--mh-border); border-radius: 4px; }
.mh-article table { border-collapse: collapse; margin: .6em 0; }
.mh-article td, .mh-article th { border: 1px solid #cfd6de; padding: 5px 10px; text-align: left; }
.mh-article th { background: #f3f5f8; }
.mh-article pre, .mh-article code { background: #f3f5f8; border-radius: 4px; padding: 1px 5px; }
.mh-article pre { padding: 10px 12px; overflow-x: auto; }

/* ---------- Lists in stored text ----------
   Articles (Solutions, the public knowledge base and their previews), ticket messages and the print view, signatures,
   standard answers, the outbox and the editor. MudBlazor's reset (* { margin: 0; padding: 0 }) takes away the indent
   the browser gives a list, so bullets and numbers stood on or over the left margin, and were cut off where the text
   can scroll sideways (a ticket message, the editor). Lists indent by the browser's own 40px, as in a word processor
   and as in the e-mail the customer receives, which has no such reset; each nested list one step further. The lists
   of the app itself (menus and other MudBlazor parts) are not inside these blocks and keep their own look. */
:is(.mh-article, .mh-msg-body, .mh-signature-body, .mh-editor .jodit-wysiwyg) :is(ul, ol) { margin: 0 0 .6em; padding-left: 40px; }
:is(.mh-article, .mh-msg-body, .mh-signature-body, .mh-editor .jodit-wysiwyg) :is(ul, ol) :is(ul, ol) { margin-bottom: 0; }
.mh-kb-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .mh-kb-layout { grid-template-columns: 1fr; } }
.mh-tree-item { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: .86rem; }
.mh-tree-item:hover { background: #f0f5fb; }
.mh-tree-item.active { background: #e2edf8; font-weight: 600; }
.mh-tree-cat { font-weight: 700; padding: 3px 10px 3px 4px; margin-top: 2px; border-radius: 6px; font-size: .86rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.mh-tree-cat:hover { background: #f0f5fb; }
.mh-tree-cat.active { background: #e2edf8; }
.mh-tree-toggle { border: 0; background: none; padding: 2px; margin: 0; border-radius: 4px; cursor: pointer; color: var(--mh-muted); display: inline-flex; align-items: center; }
.mh-tree-toggle:hover { background: rgba(0, 0, 0, .08); }
.mh-tree-toggle:focus-visible { outline: 2px solid var(--mh-primary); outline-offset: 1px; }
a.mh-sub-link { text-decoration: none; }
a.mh-sub-link:hover { text-decoration: underline; }
.mh-tree-count { margin-left: auto; color: var(--mh-muted); font-size: .74rem; }
.mh-tag { display: inline-block; background: #eef1f5; border-radius: 10px; padding: 0 8px; font-size: .74rem; margin: 0 4px 2px 0; color: #3d4955; }

/* ---------- Search ---------- */
.mh-hit { padding: 10px 14px; border-bottom: 1px solid var(--mh-border); display: block; color: inherit; text-decoration: none; }
.mh-hit:hover { background: #f5f8fc; }
.mh-hit-title { font-weight: 600; color: var(--mh-primary); }
.mh-hit-snippet { color: #47525e; font-size: .84rem; margin-top: 2px; }
.mh-hit-meta { color: var(--mh-muted); font-size: .76rem; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* A name of hundreds of characters without a space (contact, company) breaks off instead of running out of the page. */
.mh-hit-meta > * { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Account (static pages) ---------- */
.mh-account { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #1f4e79 0%, #173b5c 55%, #12304b 100%); }
.mh-account-card { background: #fff; border-radius: 10px; padding: 32px 36px; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.mh-account-brand { display: flex; align-items: flex-end; gap: 12px; color: var(--mh-muted); margin-bottom: 20px; }
.mh-account-logo { display: block; width: 200px; height: auto; }
.mh-account-product { font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding-bottom: 9px; }
.mh-account-title { font-size: 1.25rem; margin: 0 0 14px; font-weight: 600; }
.mh-account-form { display: flex; flex-direction: column; }
.mh-account-form label { font-size: .82rem; font-weight: 600; margin: 10px 0 4px; color: #3d4955; }
.mh-account-form input[type=email], .mh-account-form input[type=password], .mh-account-form input[type=text] { border: 1px solid #c5cbd3; border-radius: 6px; padding: 9px 11px; font-size: .95rem; font-family: inherit; }
.mh-account-form input:focus { outline: 2px solid #3a6ea5; outline-offset: 1px; border-color: #3a6ea5; }
.mh-account-check { display: flex !important; flex-direction: row; align-items: center; gap: 8px; font-weight: 400 !important; margin-top: 14px !important; }
.mh-account-form button { margin-top: 18px; background: var(--mh-primary); color: #fff; border: none; border-radius: 6px; padding: 10px 14px; font-size: .95rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.mh-account-form button:hover { background: #173b5c; }
.mh-account-form .validation-message { color: #b3261e; font-size: .78rem; margin-top: 3px; }
.mh-account-error { background: #fdecea; color: #8c1d18; border: 1px solid #f5c2be; border-radius: 6px; padding: 9px 12px; font-size: .86rem; margin-bottom: 6px; }
.mh-account-logout { margin: 14px 0 0; text-align: center; }
.mh-account-logout button { background: none; border: none; color: var(--mh-muted); text-decoration: underline; font: inherit; font-size: .86rem; cursor: pointer; }
.mh-account-demo { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--mh-border); font-size: .78rem; color: var(--mh-muted); display: flex; flex-direction: column; gap: 6px; }
.mh-account-demo table { border-collapse: collapse; }
.mh-account-demo td { padding: 1px 10px 1px 0; }
.mh-account-demo form { margin: 0; }
.mh-account-demo button { background: none; border: 1px solid var(--mh-border); border-radius: 4px; padding: 1px 8px; font: inherit; color: inherit; cursor: pointer; }
.mh-account-demo button:hover { border-color: currentColor; }
.mh-account-qr { display: block; margin: 8px auto 12px; width: 200px; height: auto; image-rendering: pixelated; }
.mh-account-codes { columns: 2; padding-left: 20px; font-size: .9rem; }
.mh-account-footer { color: rgba(255,255,255,.7); font-size: .78rem; margin-top: 18px; }

/* ---------- Public knowledge base ---------- */
.mh-public-hero { background: linear-gradient(160deg, #1f4e79 0%, #173b5c 100%); color: #fff; padding: 36px 20px 40px; text-align: center; }
.mh-public-hero h1 { font-size: 1.7rem; margin: 0 0 6px; font-weight: 600; }
.mh-public-hero p { margin: 0 0 18px; opacity: .9; }
.mh-public-search { max-width: 640px; margin: 0 auto; background: var(--mh-surface); border-radius: 8px; border: 1px solid var(--mh-border-strong); display: flex; align-items: center; }
.mh-public-search:focus-within { outline: 2px solid var(--mud-palette-primary); outline-offset: -1px; }
.mh-public-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; padding: 14px 16px; outline: none; }
.mh-public-search button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 8px 12px; display: flex; }
.mh-public-main { background: var(--mh-surface); }
.mh-public-container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }
.mh-public-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.mh-public-footer { text-align: center; color: var(--mh-muted); font-size: .78rem; padding: 24px; }
.mh-public-list a { display: block; padding: 5px 0; text-decoration: none; }
.mh-public-list a:hover { text-decoration: underline; }

/* ---------- Standard answers (picker dialog) ---------- */
.mh-canned-list { margin-top: 10px; max-height: 56vh; overflow-y: auto; }
.mh-canned-folder { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .84rem; padding: 8px 2px 4px; }
.mh-canned-item { border: 1px solid var(--mh-border); border-radius: 6px; margin-bottom: 6px; background: #fff; }
.mh-canned-row { display: flex; align-items: center; gap: 6px; padding: 3px 6px; }
.mh-canned-title { flex: 1; min-width: 0; cursor: pointer; font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-canned-preview { padding: 8px 14px 10px 40px; border-top: 1px solid var(--mh-border); background: #fafbfc; font-size: .86rem; }

/* ---------- Signature preview below the reply editor ---------- */
.mh-signature-preview { margin-top: 6px; padding: 6px 12px 8px; border: 1px dashed #c5cbd3; border-radius: 6px; background: #fafbfc; }
.mh-signature-body { font-size: .86rem; color: #47525e; margin-top: 2px; }
.mh-signature-body p { margin: 0 0 .5em; }
.mh-signature-body img { max-width: 260px; max-height: 90px; height: auto; }

/* ---------- Code snippets (Solutions) ---------- */
.mh-article pre.mh-code, .mh-msg-body pre.mh-code { margin: .8em 0; padding: 0; background: #f6f8fa; border: 1px solid #d8dee4; border-left: 5px solid #3b82c4; border-radius: 4px; overflow: hidden; font-family: Consolas, "Cascadia Mono", "Courier New", monospace; font-size: .84rem; line-height: 1.5; white-space: pre; }
.mh-code-head { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 12px; background: #eaeef2; border-bottom: 1px solid #d8dee4; font-family: "Segoe UI", Arial, sans-serif; font-size: .74rem; color: var(--mh-muted); white-space: normal; }
.mh-code-lang { flex: 1; font-weight: 600; }
.mh-code-copy { border: 1px solid #c5cbd3; background: #fff; color: var(--mh-primary); border-radius: 4px; padding: 1px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.mh-code-copy:hover { background: #eef4fa; }
.mh-code-copied { color: #1b5e20; border-color: #1b5e20; }
.mh-article pre.mh-code code.mh-code-body, .mh-msg-body pre.mh-code code.mh-code-body { display: block; overflow-x: auto; padding: 6px 0; background: transparent; border-radius: 0; counter-reset: mh-line; }
.mh-code-line { display: block; width: max-content; min-width: 100%; min-height: 1.5em; padding-right: 14px; counter-increment: mh-line; }
.mh-code-line::before { content: counter(mh-line); display: inline-block; width: 3em; margin-right: 12px; padding-right: 8px; text-align: right; color: #8a94a0; border-right: 1px solid #d8dee4; user-select: none; }
.mh-code-line:nth-child(even) { background: #eef2f6; }
/* Each colour has a contrast of at least 4.5:1 on both line backgrounds (#f6f8fa and #eef2f6). */
.mh-tok-kw { color: #0550ae; }
.mh-tok-str { color: #1a7f37; }
.mh-tok-com { color: #5f6873; font-style: italic; }
.mh-tok-num { color: #953800; }
.mh-tok-attr { color: #7a3fd6; }
.mh-tok-fn { color: #735b00; }
.mh-tok-op { color: #a3195b; }
.mh-tok-lit { color: #0e6a84; }
/* In the editor a snippet is shown as a plain block with its language; colouring happens when the article is read. */
.mh-editor .jodit-wysiwyg pre[data-language] { position: relative; background: #f6f8fa; border: 1px solid #d8dee4; border-left: 5px solid #3b82c4; border-radius: 4px; padding: 24px 12px 8px; font-family: Consolas, "Cascadia Mono", "Courier New", monospace; font-size: .82rem; white-space: pre; overflow-x: auto; }
.mh-editor .jodit-wysiwyg pre[data-language]::before { content: "Code · " attr(data-language); position: absolute; top: 4px; left: 12px; font: 600 .68rem "Segoe UI", Arial, sans-serif; color: var(--mh-muted); }
.mh-code-input textarea { font-family: Consolas, "Cascadia Mono", "Courier New", monospace !important; font-size: .84rem !important; line-height: 1.45 !important; white-space: pre !important; overflow-x: auto !important; }
@media print { .mh-code-copy { display: none; } }

/* ---------- Selection list in dialogs (merge) ---------- */
.mh-pick-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--mh-border); border-radius: 6px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.mh-pick-row:hover { background: #f5f8fb; }
.mh-pick-row-selected { border-color: var(--mh-primary); background: #eef4fa; }

/* ---------- Notifications (bell) ---------- */
.mh-notif-list { width: 380px; max-width: 92vw; max-height: 70vh; overflow-y: auto; }
.mh-notif-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--mh-border); }
.mh-notif-empty { padding: 18px 14px; color: var(--mh-muted); font-size: .84rem; }
.mh-notif { display: block; padding: 8px 14px; border-bottom: 1px solid var(--mh-border); text-decoration: none; color: inherit; border-left: 3px solid transparent; }
/* A notification without a ticket is a button, not a link: take the look of a button away. Stands before the
   rules for hover and unread, so those still set the background. */
.mh-notif-plain { width: 100%; text-align: left; background: none; border-top: 0; border-right: 0; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.mh-notif-plain > span:not(.mh-notif-kind) { display: block; }
.mh-notif:hover { background: #f5f8fb; }
.mh-notif-unread { border-left-color: var(--mh-primary); background: #f3f8fd; }
.mh-notif-setting { display: flex; align-items: center; gap: 12px; padding: 4px 8px 4px 14px; border-bottom: 1px solid var(--mh-border); font-size: .86rem; }
.mh-notif-setting-top { padding-top: 10px; padding-bottom: 10px; background: #f6f8fa; }
.mh-notif-setting-text { flex: 1; min-width: 0; }
.mh-notif-setting .mud-input-control { margin: 0; flex: 0 0 auto; }
.mh-notif-kind { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--mh-muted); }
.mh-notif-kind .mud-icon-root { font-size: 1rem; }
.mh-notif-title { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-notif-text { font-size: .82rem; white-space: pre-line; }

/* ---------- Print view ---------- */
.mh-print-page { background: #fff; min-height: 100vh; }
.mh-print { max-width: 900px; margin: 0 auto; padding: 18px 28px 40px; color: #1c1f23; }
.mh-print-toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: #f3f5f8; border: 1px solid var(--mh-border); border-radius: 8px; margin-bottom: 20px; font-size: .86rem; }
.mh-print-toolbar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mh-print-btn { background: var(--mh-primary); color: #fff; border: none; border-radius: 6px; padding: 7px 16px; font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.mh-print-btn:hover { background: #173b5c; }
.mh-print-brand { display: flex; align-items: flex-end; gap: 10px; font-size: .74rem; font-weight: 700; color: var(--mh-muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.mh-print-brand span { padding-bottom: 7px; }
.mh-print-logo { display: block; height: 48px; width: auto; }
.mh-print h1 { font-size: 1.35rem; margin: 2px 0 0; font-weight: 600; }
.mh-print-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 28px; font-size: .84rem; margin: 12px 0 18px; padding: 10px 0; border-top: 1px solid #cfd6de; border-bottom: 1px solid #cfd6de; }
.mh-print-meta > div { display: flex; gap: 8px; min-width: 0; }
.mh-print-meta dt { color: var(--mh-muted); min-width: 112px; }
.mh-print-meta dd { margin: 0; overflow-wrap: anywhere; }
.mh-print-msg { border: 1px solid #cfd6de; border-radius: 6px; margin-bottom: 12px; }
.mh-print-msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid #cfd6de; background: #f6f8fa; font-size: .82rem; break-after: avoid; }
.mh-print-note { border-style: dashed; }
.mh-print-note .mh-print-msg-head { background: var(--mh-note); }
.mh-print-files { padding: 6px 12px; border-top: 1px solid #e3e7ec; font-size: .8rem; color: var(--mh-muted); }
.mh-print-event { font-size: .78rem; color: var(--mh-muted); margin: 0 4px 10px; white-space: pre-line; }
.mh-print-footer { margin-top: 18px; font-size: .76rem; color: var(--mh-muted); }
@media print {
    .mh-noprint { display: none !important; }
    html, body { background: #fff !important; }
    .mh-print { max-width: none; padding: 0; }
    .mh-print-msg-head, .mh-print-note .mh-print-msg-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    #blazor-error-ui, #components-reconnect-modal { display: none !important; }
}

/* ---------- Dark mode ----------
   Switched on with data-theme="dark" on <html> (set by App.razor from a cookie, changed by mhTheme in app.js).
   MudBlazor components follow the dark palette in AppTheme; the rules below do the same for our own styles.

   Content that comes from outside or goes to a customer (ticket messages, articles, the editor, the signature
   preview, the print view) stays on light "paper". E-mails and articles carry their own colours and screenshots,
   and those are only reliably readable on a light background. Inside such a block the variables get their light
   values back, so everything in it looks exactly as in light mode. */
html[data-theme="dark"] {
    color-scheme: dark;
    --mh-primary: #8ec1f0;
    --mh-border: #2f3a47;
    --mh-border-strong: #3d4a59;
    --mh-muted: #9aa7b5;
    --mh-bg: #12171d;
    --mh-text: #e3e8ee;
    --mh-surface: #1b222b;
    --mh-surface-2: #232c37;
    --mh-note: #38301a;
    --mh-note-border: #6b5a1e;
    --mh-outbound: #1c2f42;
    --mh-outbound-border: #2f4c69;
    --mh-error: #ff8a80;
    --mh-warn-text: #f2c063;
}
html[data-theme="dark"], html[data-theme="dark"] body { color: var(--mh-text); }

html[data-theme="dark"] :is(.mh-msg, .mh-article, .mh-editor, .mh-signature-preview, .mh-canned-preview, .mh-print-page, .jodit-dialog, .jodit-popup) {
    color-scheme: light;
    --mh-primary: #1f4e79;
    --mh-border: #e1e5ea;
    --mh-border-strong: #cfd6de;
    --mh-muted: #5f6b7a;
    --mh-text: #1f2933;
    --mh-surface: #fff;
    --mh-surface-2: #f3f5f8;
    --mh-note: #fff8e1;
    --mh-note-border: #f2d98a;
    --mh-outbound: #eef5fc;
    --mh-outbound-border: #c9dff3;
    --mh-error: #b3261e;
    --mh-warn-text: #8a5300;
    color: #1f2933;
}
/* An article has no background of its own in light mode (it sits on a white card); here it needs its own paper. */
html[data-theme="dark"] .mh-article { background: #fff; padding: 12px 16px; border-radius: 6px; }

html[data-theme="dark"] kbd { background: var(--mh-surface-2); border-color: var(--mh-border-strong); }
html[data-theme="dark"] :is(.mh-card, .mh-canned-item, .mh-pick-row) { background: var(--mh-surface); }
html[data-theme="dark"] .mh-chip-outline { background: var(--mh-surface) !important; }
html[data-theme="dark"] .mh-nav-count { background: #2a3440; }
html[data-theme="dark"] .mh-nav-count-alert { background: #4a1f1c; color: #ffb4ab; }
html[data-theme="dark"] .mh-badge-new { background: #1c3a57; color: #a8d1f7; }
html[data-theme="dark"] .mh-prio-4 { color: #ff8a80; }
html[data-theme="dark"] .mh-prio-3 { color: #ffb74d; }
html[data-theme="dark"] .mh-prio-2 { color: #a9c1da; }
html[data-theme="dark"] .mh-prio-1 { color: #7d8996; }
html[data-theme="dark"] .mh-bulkbar { background: #1c3048; border-color: #2f4c69; }
html[data-theme="dark"] :is(.mh-stat:hover, .mh-file:hover) { border-color: #56657a; }
html[data-theme="dark"] .mh-file { background: var(--mh-surface-2); }
html[data-theme="dark"] .mh-event-resolved { color: #81c995; }
html[data-theme="dark"] .mh-event-silent { color: #f2c063; }
html[data-theme="dark"] .mh-event-missing { color: #f2c063; }
html[data-theme="dark"] .mh-presence { background: #40300f; color: #f2c063; }
html[data-theme="dark"] :is(.mh-upload-label:hover, .mh-tree-item:hover, .mh-tree-cat:hover, .mh-hit:hover, .mh-pick-row:hover, .mh-notif:hover) { background: var(--mh-surface-2); }
html[data-theme="dark"] :is(.mh-tree-item.active, .mh-tree-cat.active, .mh-pick-row-selected) { background: #1f3a56; }
html[data-theme="dark"] .mh-notif-unread { background: #1c2f42; }
html[data-theme="dark"] .mh-notif-setting-top { background: var(--mh-surface-2); }
html[data-theme="dark"] .mh-tag { background: #2a3440; color: #cfd8e3; }
html[data-theme="dark"] .mh-hit-snippet { color: #b6c2cf; }
html[data-theme="dark"] #blazor-error-ui { background: #40300f; color: var(--mh-text); }

/* Login and error pages (static, no MudBlazor). The logo has dark lettering, so it keeps a white plate. */
html[data-theme="dark"] .mh-account-card { background: var(--mh-surface); color: var(--mh-text); }
html[data-theme="dark"] .mh-account-logo { background: #fff; border-radius: 8px; padding: 6px 10px; box-sizing: content-box; }
html[data-theme="dark"] .mh-account-form label { color: #cfd8e3; }
html[data-theme="dark"] .mh-account-form :is(input[type=email], input[type=password], input[type=text]) { background: #12171d; border-color: #4a5766; color: var(--mh-text); }
html[data-theme="dark"] .mh-account-form button { background: #2f6fae; }
html[data-theme="dark"] .mh-account-form button:hover { background: #3a7fc1; }
html[data-theme="dark"] .mh-account-form .validation-message { color: var(--mh-error); }
html[data-theme="dark"] .mh-account-error { background: #4a1f1c; color: #ffdad6; border-color: #7a2e29; }

/* ---------- Blazor error bar ---------- */
#blazor-error-ui { background: #fff4e5; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 3000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
