@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,600&display=swap');

/* Monet Helpdesk components. Every value comes from tokens.css; class prefix mh-. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 14px; line-height: 22px; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11" 1; }
button, input, select, textarea { font-family: inherit; }
.mh-num, .mh-table, .mh-wait, .mh-count, .mh-kbd, .mh-status, .mh-ticket-no { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.mh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icons (Lucide geometry, 24 grid, inline SVG) */
.mh-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.mh-icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.mh-icon-xs { width: 10px; height: 10px; stroke-width: 2.25; }
.mh-icon-lg { width: 20px; height: 20px; }

/* Kbd */
.mh-kbd { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-secondary); font: 500 11px/1 var(--font-sans); white-space: nowrap; }
.mh-btn-primary .mh-kbd, .mh-btn-note .mh-kbd, .mh-btn-danger .mh-kbd, .mh-inverse .mh-kbd { background: transparent; border-color: currentColor; color: inherit; }
.mh-kbd-group { display: inline-flex; gap: 2px; }

/* Buttons */
.mh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-height); padding: 0 12px; border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--bg); color: var(--ink); font: 500 13px/1 var(--font-sans); white-space: nowrap; text-decoration: none; cursor: pointer; }
.mh-btn:hover { background: var(--bg-hover); }
.mh-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mh-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.mh-btn-note { background: var(--note-fill); border-color: var(--note-fill); color: var(--on-note); }
.mh-btn-note:hover { background: var(--note-fill); filter: brightness(1.12); }
.mh-btn-danger { background: var(--danger-fill); border-color: var(--danger-fill); color: var(--on-danger); }
.mh-btn-danger-ghost { border-color: transparent; background: transparent; color: var(--danger); }
.mh-btn-danger-ghost:hover { background: var(--danger-subtle); }
.mh-btn-ghost { border-color: transparent; background: transparent; color: var(--ink-secondary); }
.mh-btn-ghost:hover { background: var(--bg-hover); color: var(--ink); }
.mh-btn-sm { height: var(--control-height-sm); padding: 0 8px; font-size: 12px; gap: 4px; }
.mh-btn-icon { width: var(--control-height); padding: 0; }
.mh-btn-sm.mh-btn-icon { width: var(--control-height-sm); }
.mh-btn[disabled], .mh-btn[aria-disabled="true"] { background: var(--bg-disabled); border-color: var(--bg-disabled); color: var(--ink-disabled); cursor: not-allowed; filter: none; }
.mh-split { position: relative; display: inline-flex; }
.mh-split > .mh-btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.mh-split > details { margin-left: 1px; }
.mh-split > details > summary.mh-btn { border-top-left-radius: 0; border-bottom-left-radius: 0; width: 30px; padding: 0; }
.mh-split > details[open] > .mh-menu { right: 0; bottom: calc(100% + 6px); }
.mh-menu-anchor { position: relative; }

/* Menu (details/summary, no framework) */
.mh-menu { position: absolute; z-index: 30; min-width: 248px; padding: 4px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.mh-menu-static { position: static; display: inline-block; }
.mh-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: 400 13px/20px var(--font-sans); text-align: left; cursor: pointer; text-decoration: none; }
.mh-menu-item:hover, .mh-menu-item[aria-selected="true"] { background: var(--bg-hover); }
.mh-menu-item > .mh-kbd, .mh-menu-item > .mh-kbd-group, .mh-menu-item > .mh-menu-hint { margin-left: auto; }
.mh-menu-hint { color: var(--ink-muted); font-size: 12px; }
.mh-menu-label { padding: 8px 8px 4px; font: 600 11px/16px var(--font-sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.mh-menu-sep { height: 1px; margin: 4px 0; background: var(--border); }

/* Fields */
.mh-field { display: grid; gap: 4px; }
.mh-label { font: 500 12px/16px var(--font-sans); color: var(--ink-secondary); }
.mh-input, .mh-select, .mh-textarea { width: 100%; height: var(--control-height); padding: 0 10px; border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--bg); color: var(--ink); font: 400 13px/20px var(--font-sans); }
.mh-textarea { height: auto; min-height: 72px; padding: 6px 10px; resize: vertical; }
.mh-input::placeholder, .mh-textarea::placeholder { color: var(--ink-muted); }
.mh-input:focus, .mh-select:focus, .mh-textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.mh-input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-subtle); }
.mh-input[disabled] { background: var(--bg-disabled); border-color: var(--bg-disabled); color: var(--ink-disabled); }
.mh-input-icon { position: relative; }
.mh-input-icon > .mh-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.mh-input-icon > .mh-input { padding-left: 32px; }
.mh-input-icon > .mh-kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.mh-select-wrap { position: relative; }
.mh-select { appearance: none; padding-right: 30px; cursor: pointer; }
.mh-select-wrap > .mh-icon { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-secondary); pointer-events: none; }
.mh-help { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.mh-help-error { color: var(--danger); }

/* Tag input */
.mh-taginput { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: var(--control-height); padding: 4px; border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--bg); }
.mh-taginput:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.mh-taginput > input { flex: 1; min-width: 96px; height: 22px; padding: 0 6px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 13px/20px var(--font-sans); }
.mh-taginput > input::placeholder { color: var(--ink-muted); }
.mh-tag { max-width: 100%; min-width: 0; display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 2px 0 8px; border-radius: var(--radius-sm); background: var(--bg-tag); color: var(--ink-secondary); font: 500 12px/1 var(--font-sans); white-space: nowrap; }
.mh-tag-static { padding-right: 8px; }
.mh-tag > span { overflow: hidden; text-overflow: ellipsis; }
.mh-tag > button { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 3px; background: none; color: var(--ink-secondary); cursor: pointer; }
.mh-tag > button:hover { background: var(--bg-hover-subtle); color: var(--ink); }

/* Checkbox + switch */
.mh-check { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.mh-switch { display: inline-flex; align-items: center; gap: 10px; font: 500 13px/20px var(--font-sans); color: var(--ink); cursor: pointer; }
.mh-switch > input { appearance: none; position: relative; flex: none; width: 32px; height: 18px; margin: 0; border-radius: var(--radius-full); background: var(--border-control); cursor: pointer; transition: background .12s; }
.mh-switch > input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--switch-knob); transition: transform .12s; }
.mh-switch > input:checked { background: var(--accent); }
.mh-switch > input:checked::after { transform: translateX(14px); }

/* Status pill */
.mh-status { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: var(--radius-sm); font: 600 12px/16px var(--font-sans); white-space: nowrap; }
.mh-status-new { background: var(--status-new); color: var(--on-status-new); }
.mh-status-open { background: var(--status-open); color: var(--on-status); }
.mh-status-pending { background: var(--status-pending); color: var(--on-status); }
.mh-status-hold { background: var(--status-hold); color: var(--on-status-hold); }
.mh-status-solved { background: var(--status-solved); color: var(--on-status); }
.mh-status-closed { background: var(--status-closed); color: var(--on-status-closed); }
.mh-status-letter { width: 20px; padding: 0; justify-content: center; }

/* Waiting time */
.mh-wait { display: inline-flex; align-items: center; gap: 5px; font: 500 13px/20px var(--font-sans); color: var(--wait-ok); white-space: nowrap; }
.mh-wait-soon { color: var(--wait-soon); }
.mh-wait-late { color: var(--wait-late); font-weight: 600; }
.mh-wait-none { color: var(--ink-muted); font-weight: 400; }

/* Avatars */
.mh-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: var(--radius-full); font: 600 11px/1 var(--font-sans); letter-spacing: .02em; }
.mh-avatar-sm { width: 20px; height: 20px; font-size: 9px; }
.mh-avatar-lg { width: 36px; height: 36px; font-size: 13px; }
.mh-avatar-staff { background: var(--accent-subtle); color: var(--accent-ink); }
.mh-avatar-requester { background: var(--bg-tag); color: var(--ink-secondary); }
.mh-avatar-colleague { background: var(--bg); color: var(--ink-secondary); box-shadow: inset 0 0 0 1.5px var(--border-control); }
.mh-avatar-bot { border-radius: var(--radius-md); background: var(--ink); color: var(--bg); }
.mh-avatar-sm.mh-avatar-bot { border-radius: var(--radius-sm); }
.mh-avatar-badge { position: absolute; right: -4px; bottom: -4px; display: flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); color: var(--ink-secondary); box-shadow: 0 0 0 1px var(--border-strong); }
.mh-avatar-stack { display: inline-flex; }
.mh-avatar-stack > .mh-avatar + .mh-avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.mh-author-badge { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--bg-tag); color: var(--ink-secondary); font: 500 11px/1 var(--font-sans); white-space: nowrap; }

/* Presence + collision */
.mh-presence { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/16px var(--font-sans); color: var(--ink-secondary); white-space: nowrap; }
.mh-collision { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-md); background: var(--accent-subtle); color: var(--ink); font: 500 13px/20px var(--font-sans); }
.mh-collision strong { font-weight: 600; }
.mh-typing { display: inline-flex; gap: 3px; }
.mh-typing > span { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-ink); }

/* Sidebar */
.mh-sidebar { display: flex; flex-direction: column; flex: none; width: var(--sidebar-width); padding: 12px 8px; background: var(--bg-subtle); border-right: 1px solid var(--border); overflow-y: auto; scrollbar-width: none; }
.mh-brand { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; margin-bottom: 8px; }
.mh-brand-name { font: 600 18px/24px var(--font-serif); color: var(--ink); }
.mh-brand-sub { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); }
.mh-side-section { padding: 16px 8px 4px; font: 600 11px/16px var(--font-sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.mh-side-item { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--radius-md); color: var(--ink-secondary); font: 500 13px/1 var(--font-sans); text-decoration: none; white-space: nowrap; }
.mh-side-item > span:not(.mh-count) { overflow: hidden; text-overflow: ellipsis; }
.mh-side-item:hover { background: var(--bg-hover-subtle); color: var(--ink); }
.mh-side-item[aria-current="page"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
.mh-count { margin-left: auto; color: var(--ink-muted); font: 500 12px/1 var(--font-sans); }
.mh-side-item[aria-current="page"] > .mh-count, .mh-count-attn { color: var(--ink); font-weight: 600; }
.mh-side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 8px 4px; border-top: 1px solid var(--border); }

/* Ticket table */
.mh-table { width: 100%; border-collapse: collapse; font: 400 13px/20px var(--font-sans); }
.mh-table th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 12px; background: var(--bg); border-bottom: 1px solid var(--border); color: var(--ink-muted); font: 500 12px/16px var(--font-sans); text-align: left; white-space: nowrap; }
.mh-table td { height: var(--row-height); padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.mh-table td.mh-col-subject { white-space: normal; max-width: 0; width: 40%; }
.mh-table th:first-child, .mh-table td:first-child { padding-left: 24px; width: 44px; }
.mh-table tbody tr { cursor: pointer; }
.mh-table tbody tr:hover { background: var(--bg-hover); }
.mh-table tbody tr[aria-selected="true"] { background: var(--bg-selected); }
.mh-table tbody tr.mh-row-focus { box-shadow: inset 2px 0 0 var(--focus-ring); }
.mh-ticket-no { color: var(--ink-muted); }
.mh-subject { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.mh-row-unread .mh-subject { font-weight: 600; }
.mh-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }
.mh-subject-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mh-subject-line > .mh-subject { flex: 0 1 auto; }
.mh-person { display: flex; align-items: center; gap: 8px; color: var(--ink-secondary); }
.mh-mailbox { color: var(--ink-secondary); }
.mh-muted { color: var(--ink-muted); }

/* Bulk bar */
.mh-bulkbar { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 6px 0 14px; border-radius: var(--radius-lg); background: var(--inverse-bg); color: var(--inverse-ink); font: 500 13px/1 var(--font-sans); box-shadow: var(--shadow-pop); }
.mh-bulkbar-count { margin-right: 10px; white-space: nowrap; }
.mh-bulkbar-count .mh-muted-inv { color: var(--inverse-muted); font-weight: 400; }
.mh-bulkbar .mh-btn { height: var(--control-height-sm); border-color: transparent; background: transparent; color: var(--inverse-ink); font-size: 13px; padding: 0 8px; }
.mh-bulkbar .mh-btn:hover { background: var(--inverse-hover); }
.mh-bulkbar .mh-kbd { background: transparent; border-color: var(--inverse-muted); color: var(--inverse-muted); }
.mh-bulkbar-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--inverse-hover); }

/* App frame */
.mh-app { display: flex; height: 100vh; min-height: 0; background: var(--bg); }
.mh-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mh-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.mh-scroll:hover { scrollbar-color: var(--border-strong) transparent; }
.mh-viewhead { display: flex; align-items: center; gap: 12px; padding: 16px 24px 12px; }
.mh-viewhead h1 { margin: 0; font: 600 20px/28px var(--font-sans); letter-spacing: -.01em; }
.mh-viewhead .mh-count { margin-left: 0; font-size: 14px; }
.mh-toolbar { display: flex; align-items: center; gap: 8px; padding: 0 24px 12px; }
.mh-spacer { flex: 1; }

/* Ticket header */
.mh-ticket-head { display: flex; align-items: flex-start; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.mh-ticket-title { margin: 0; font: 600 20px/28px var(--font-sans); letter-spacing: -.01em; }
.mh-ticket-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; color: var(--ink-muted); font: 400 13px/20px var(--font-sans); }
.mh-ticket-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.mh-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-muted); }

/* Timeline: ONE column. Cards, notes, events and composer share the left edge and max width. */
.mh-column { width: 100%; max-width: var(--content-max); }
.mh-timeline { display: flex; flex-direction: column; gap: 16px; padding: 24px 24px 32px; }
.mh-entry { display: flex; flex-direction: column; gap: 6px; }
.mh-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }
.mh-card-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 0; }
.mh-card-who { flex: 1; min-width: 0; }
.mh-card-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mh-card-name { color: var(--ink); font: 600 14px/20px var(--font-sans); }
.mh-card-addr { color: var(--ink-muted); font: 400 13px/20px var(--font-sans); }
.mh-card-meta { color: var(--ink-muted); font: 400 12px/16px var(--font-sans); margin-top: 2px; }
.mh-card-meta b { color: var(--ink-secondary); font-weight: 500; }
.mh-card-time { color: var(--ink-muted); font: 500 12px/20px var(--font-sans); white-space: nowrap; }
.mh-card-body { padding: 12px 16px 16px; color: var(--ink); font: 400 14px/22px var(--font-sans); }
.mh-card-body p { margin: 0 0 10px; }
.mh-card-body p:last-child { margin-bottom: 0; }
.mh-card-quote { color: var(--ink-muted); font-size: 12px; cursor: pointer; }
.mh-card-attach { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.mh-attachment { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg); color: var(--ink); font: 500 13px/1 var(--font-sans); text-decoration: none; }
.mh-attachment small { color: var(--ink-muted); font-weight: 400; font-size: 12px; }
.mh-card-via { padding: 0 2px; color: var(--ink-muted); font: 400 12px/16px var(--font-sans); }
.mh-card-label { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font: 600 12px/16px var(--font-sans); }
.mh-card-reply { background: var(--reply-bg); border-color: var(--reply-border); }
.mh-card-reply .mh-card-label { color: var(--accent-ink); }
.mh-card-note { background: var(--note-bg); border: 1px dashed var(--note-border); }
.mh-card-note .mh-card-label { color: var(--note-ink); }
.mh-event { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 2px 0; color: var(--ink-muted); font: 400 12px/16px var(--font-sans); text-align: center; }
.mh-event b { color: var(--ink-secondary); font-weight: 500; }
.mh-event .mh-status { height: 18px; font-size: 11px; padding: 0 5px; }

/* Composer */
.mh-composer { border: 1px solid var(--border-control); border-radius: var(--radius-lg); background: var(--bg); overflow: hidden; }
.mh-composer-banner { display: none; align-items: center; gap: 8px; padding: 8px 16px; background: var(--note-band); color: var(--note-ink); font: 600 13px/20px var(--font-sans); }
.mh-composer-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0; }
.mh-tab { display: inline-flex; align-items: center; gap: 6px; height: var(--control-height-sm); padding: 0 10px; border: 0; border-radius: var(--radius-md); background: none; color: var(--ink-secondary); font: 500 13px/1 var(--font-sans); cursor: pointer; }
.mh-tab:hover { background: var(--bg-hover); color: var(--ink); }
.mh-tab[aria-selected="true"] { background: var(--bg-hover); color: var(--ink); font-weight: 600; }
.mh-composer-to { display: flex; flex-wrap: nowrap; min-width: 0; align-items: center; gap: 6px; padding: 6px 16px 0; color: var(--ink-muted); font: 400 12px/20px var(--font-sans); }
.mh-composer-to b { color: var(--ink-secondary); font-weight: 500; }
.mh-composer-text { display: block; width: 100%; min-height: 104px; padding: 8px 16px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink); font: 400 14px/22px var(--font-sans); }
.mh-composer-text::placeholder { color: var(--ink-muted); }
.mh-composer-foot { display: flex; align-items: center; gap: 2px; padding: 8px; }
.mh-composer-foot .mh-btn-ghost { color: var(--ink-secondary); }
.mh-suggest { display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 6px 8px 6px 10px; border-radius: var(--radius-md); background: var(--accent-subtle); color: var(--ink); font: 400 13px/20px var(--font-sans); }
.mh-suggest b { font-weight: 600; }
.mh-suggest > .mh-icon { color: var(--accent-ink); }
.mh-suggest-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ink-secondary); font-size: 12px; }
.mh-composer[data-mode="note"] { background: var(--note-bg); border: 2px solid var(--note-border); }
.mh-composer[data-mode="note"] .mh-composer-banner { display: flex; }
.mh-composer[data-mode="note"] .mh-tab[aria-selected="true"] { background: var(--note-band); color: var(--note-ink); }
.mh-composer[data-mode="note"] .mh-tab:not([aria-selected="true"]):hover { background: var(--note-band); }
.mh-composer[data-mode="note"] .mh-composer-foot .mh-btn-ghost:hover { background: var(--note-band); }
.mh-composer[data-mode="reply"] [data-when="note"], .mh-composer[data-mode="note"] [data-when="reply"] { display: none !important; }

/* Details panel */
.mh-details { display: flex; flex-direction: column; flex: none; width: var(--details-width); background: var(--bg-subtle); border-left: 1px solid var(--border); overflow-y: auto; scrollbar-width: none; }
.mh-details-section { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.mh-details-section:last-child { border-bottom: 0; }
.mh-details-title { margin: 0 0 10px; font: 600 11px/16px var(--font-sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.mh-props { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 6px 8px; margin: 0; font: 400 13px/20px var(--font-sans); }
.mh-props dt { padding-top: 4px; color: var(--ink-muted); }
.mh-props dd { margin: 0; min-width: 0; color: var(--ink); }
.mh-props .mh-select, .mh-props .mh-input { height: var(--control-height-sm); }
.mh-requester { display: flex; align-items: center; gap: 10px; }
.mh-requester-name { font: 600 14px/20px var(--font-sans); }
.mh-requester-mail { font: 400 13px/20px var(--font-sans); color: var(--accent-ink); text-decoration: none; }
.mh-mini-ticket { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--radius-md); color: var(--ink); font: 400 13px/20px var(--font-sans); text-decoration: none; }
.mh-mini-ticket:hover { background: var(--bg-hover-subtle); }
.mh-mini-ticket > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dialog */
.mh-overlay { display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; background: var(--overlay); }
.mh-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); color: var(--ink); box-shadow: var(--shadow-pop); }
.mh-dialog::backdrop { background: var(--overlay); }
.mh-dialog-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.mh-dialog-head h2 { flex: 1; margin: 0; font: 600 16px/24px var(--font-sans); }
.mh-dialog-body { display: grid; gap: 16px; padding: 16px 20px 20px; }
.mh-dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.mh-dialog-foot .mh-help { margin-right: auto; }
.mh-directory { border: 1px solid var(--border-control); border-radius: var(--radius-md); overflow: hidden; }
.mh-directory-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font: 400 13px/18px var(--font-sans); cursor: pointer; }
.mh-directory-item:first-child { border-top: 0; }
.mh-directory-item:hover { background: var(--bg-hover); }
.mh-directory-item[aria-selected="true"] { background: var(--bg-selected); }
.mh-directory-item .mh-who { flex: 1; min-width: 0; }
.mh-directory-item .mh-who b { display: block; font-weight: 600; color: var(--ink); }
.mh-directory-item .mh-who span { color: var(--ink-muted); }
.mh-directory-item .mh-team { color: var(--ink-secondary); font-size: 12px; }
.mh-segmented { display: inline-flex; padding: 2px; border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--bg); }
.mh-segmented > label { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--ink-secondary); font: 500 13px/1 var(--font-sans); cursor: pointer; }
.mh-segmented > label:has(input:checked) { background: var(--ink); color: var(--bg); }
.mh-segmented input { position: absolute; opacity: 0; pointer-events: none; }

/* Command palette */
.mh-palette { width: min(640px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); box-shadow: var(--shadow-pop); overflow: hidden; }
.mh-palette-input { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--ink-muted); }
.mh-palette-input input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 15px/22px var(--font-sans); }
.mh-palette-input input::placeholder { color: var(--ink-muted); }
.mh-palette-scope { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--bg-tag); color: var(--ink-secondary); font: 500 12px/1 var(--font-sans); }
.mh-palette-list { max-height: 480px; padding: 4px 6px 8px; overflow-y: auto; scrollbar-width: thin; }
.mh-palette .mh-menu-item { min-height: 36px; }
.mh-palette .mh-menu-item[aria-selected="true"] { background: var(--bg-selected); }
.mh-palette-foot { display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--ink-muted); font: 400 12px/16px var(--font-sans); }
.mh-palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* Toast */
.mh-toast { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 6px 6px 14px; border-radius: var(--radius-lg); background: var(--inverse-bg); color: var(--inverse-ink); font: 500 13px/20px var(--font-sans); box-shadow: var(--shadow-pop); }
.mh-toast .mh-muted-inv { color: var(--inverse-muted); font-weight: 400; }
.mh-toast .mh-btn { height: var(--control-height-sm); border-color: transparent; background: transparent; color: var(--inverse-ink); }
.mh-toast .mh-btn:hover { background: var(--inverse-hover); }
.mh-toast .mh-kbd { background: transparent; border-color: var(--inverse-muted); color: var(--inverse-muted); }
.mh-toast-success > .mh-icon { color: var(--success); }

/* Empty state */
.mh-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: var(--space-12) 24px; text-align: center; }
.mh-empty-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 4px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--ink-secondary); }
.mh-empty h2 { margin: 0; font: 600 16px/24px var(--font-sans); color: var(--ink); }
.mh-empty p { margin: 0; max-width: 360px; font: 400 13px/20px var(--font-sans); color: var(--ink-muted); }

/* Suspended queue */
.mh-susp { display: grid; grid-template-columns: 44px minmax(180px, 220px) 1fr 190px 210px; align-items: center; border-bottom: 1px solid var(--border); }
.mh-susp > * { padding: 10px 12px; min-width: 0; }
.mh-susp > :first-child { padding-left: 24px; }
.mh-susp-head { height: 36px; color: var(--ink-muted); font: 500 12px/16px var(--font-sans); }
.mh-susp-head > * { padding-top: 0; padding-bottom: 0; }
.mh-susp-row { font: 400 13px/20px var(--font-sans); }
.mh-susp-row:hover { background: var(--bg-hover); }
.mh-susp-row[aria-selected="true"] { background: var(--bg-selected); }
.mh-susp-actions { display: flex; justify-content: flex-end; gap: 6px; padding-right: 24px !important; }
.mh-susp-preview { grid-column: 2 / -1; padding: 0 24px 14px 12px !important; color: var(--ink-secondary); font: 400 13px/20px var(--font-sans); }
.mh-susp-preview blockquote { margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.mh-reason { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--bg-tag); color: var(--ink-secondary); font: 500 12px/1 var(--font-sans); white-space: nowrap; }
.mh-reason-spam { color: var(--danger); background: var(--danger-subtle); }
.mh-trunc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mobile (≤ 767 px): read and reply only */
.mh-m { width: 360px; height: 760px; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; }
.mh-m-bar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.mh-m-bar h1 { margin: 0; font: 600 16px/24px var(--font-sans); }
.mh-m-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.mh-m-row .mh-subject { grid-column: 1 / -1; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mh-m-meta { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-muted); font: 400 12px/20px var(--font-sans); }
.mh-m-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.mh-m .mh-timeline { padding: 16px 12px; gap: 12px; }
.mh-m .mh-card-head { padding: 10px 12px 0; }
.mh-m .mh-card-body { padding: 10px 12px 12px; }
.mh-m .mh-composer { border-radius: 0; border-width: 1px 0 0; }
.mh-m .mh-composer[data-mode="note"] { border-width: 2px 0 0; }
.mh-m .mh-kbd, .mh-m .mh-kbd-group { display: none; }
.mh-m .mh-composer-text { min-height: 64px; }
