/* CUBE Dashboard operation assistant. All rules are isolated from existing pages. */
.cube-help-root { --ch-ink:#283252; --ch-muted:#70798b; --ch-border:#e5e8ef; --ch-soft:#f6f7fa; --ch-primary:#ff596f; color:var(--ch-ink); font-family:inherit; font-size:14px; line-height:1.55; text-align:left; }
.cube-help-root *, .cube-help-root *::before, .cube-help-root *::after { box-sizing:border-box; }
.cube-help-root [hidden] { display:none !important; }
.cube-help-root h1, .cube-help-root h2, .cube-help-root h3, .cube-help-root p { margin:0; }
.cube-help-root button, .cube-help-root input, .cube-help-root select, .cube-help-root textarea { font:inherit; }
.cube-help-root button, .cube-help-root a { -webkit-tap-highlight-color:transparent; }
.cube-help-root button:focus-visible, .cube-help-root a:focus-visible, .cube-help-root input:focus-visible, .cube-help-root select:focus-visible, .cube-help-root textarea:focus-visible { outline:2px solid #b52b49; outline-offset:3px; }
.cube-help-root button:disabled { cursor:not-allowed; opacity:.55; }
.cube-help-page { background:#f6f7fa; }
.cube-help-page-card, .cube-help-admin-card { border:1px solid var(--ch-border); border-radius:14px; background:#fff; box-shadow:0 3px 16px #28325205; overflow:hidden; }
.cube-help-page-card { max-width:1100px; margin:0 auto; }
.cube-help-loading, .cube-help-empty { padding:40px 20px; text-align:center; color:var(--ch-muted); }
.cube-help-empty > i { display:block; font-size:27px; color:#c2c8d4; margin-bottom:10px; }
.cube-help-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:18px 20px; border-bottom:1px solid var(--ch-border); flex-shrink:0; }
.cube-help-heading { display:flex; align-items:center; min-width:0; gap:10px; }
.cube-help-icon { display:grid; place-items:center; flex:0 0 38px; height:38px; width:38px; border-radius:50%; color:var(--ch-primary); background:#fff0f3; font-size:18px; }
.cube-help-copy { display:flex; flex-direction:column; gap:2px; min-width:0; text-align:left; }
.cube-help-copy h1, .cube-help-copy h2, .cube-help-copy h3 { font-size:18px; line-height:1.4; font-weight:800; color:var(--ch-ink); }
.cube-help-copy p { font-size:12px; color:var(--ch-muted); line-height:1.45; overflow-wrap:anywhere; }
.cube-help-eyebrow { font-size:10px; font-weight:800; letter-spacing:.1em; color:#dd8a2a; }
.cube-help-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex-shrink:0; }
.cube-help-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; height:36px; min-height:36px; margin:0; padding:0 16px; border:1px solid #dce1ea; border-radius:999px; background:#fff; color:var(--ch-ink); font-size:14px !important; font-weight:700 !important; line-height:1.2; white-space:nowrap; cursor:pointer; text-decoration:none; }
.cube-help-btn:hover { background:#f7f8fa; color:var(--ch-ink); }
.cube-help-btn-primary { background:var(--ch-primary); border-color:var(--ch-primary); color:#fff; }
.cube-help-btn-primary:hover { background:#ef4d64; border-color:#ef4d64; color:#fff; }
.cube-help-btn-danger { color:#b42842; border-color:#f2c6ce; }
.cube-help-btn-icon { width:36px; padding:0; flex:0 0 36px; border-radius:50%; }
.cube-help-text-link { border:0; padding:0; background:transparent; color:#70798b; text-decoration:underline; cursor:pointer; font-size:12px; }
.cube-help-chat { display:flex; flex-direction:column; height:min(760px, calc(100dvh - 185px)); min-height:480px; }
.cube-help-chat-main { min-height:0; overflow:auto; overscroll-behavior:contain; flex:1; padding:20px; scroll-behavior:auto; }
.cube-help-welcome { max-width:680px; margin:22px auto; }
.cube-help-welcome h3 { margin-bottom:7px; font-size:22px; font-weight:800; letter-spacing:-.02em; }
.cube-help-welcome p { color:var(--ch-muted); font-size:13px; }
.cube-help-suggestions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:18px; }
.cube-help-suggestion { display:flex; align-items:center; justify-content:space-between; gap:8px; text-align:left; padding:11px 13px; border:1px solid var(--ch-border); border-radius:12px; color:var(--ch-ink); background:#fff; cursor:pointer; line-height:1.4; font-size:13px !important; }
.cube-help-suggestion:hover { border-color:#f3b4bf; background:#fff9fa; }
.cube-help-suggestion i { color:#9ba2b2; }
.cube-help-message { display:flex; gap:9px; max-width:850px; margin:0 auto 20px; }
.cube-help-message-user { justify-content:flex-end; }
.cube-help-message-icon { display:grid; place-items:center; width:28px; height:28px; flex:0 0 28px; border-radius:50%; background:#fff0f3; color:#e55067; font-size:13px; }
.cube-help-message-content { min-width:0; max-width:calc(100% - 37px); }
.cube-help-message-label { color:var(--ch-muted); font-size:11px; margin-bottom:4px; }
.cube-help-message-text { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--ch-ink); font-size:14px; line-height:1.75; }
.cube-help-message-user .cube-help-message-content { padding:10px 14px; border-radius:14px 14px 3px 14px; background:#f2f4f8; max-width:88%; }
.cube-help-message-error .cube-help-message-text { color:#af364d; }
.cube-help-message-attachment { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--ch-muted); margin-top:5px; }
.cube-help-sources { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.cube-help-source { display:inline-flex; align-items:center; gap:5px; max-width:100%; color:#496386; border:1px solid #e1e7ef; background:#f8fafc; border-radius:999px; padding:4px 9px; font-size:12px; text-decoration:none; overflow-wrap:anywhere; }
.cube-help-source:hover { color:#b7334e; background:#fff5f7; border-color:#f2c5cf; }
.cube-help-feedback { display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin-top:9px; color:var(--ch-muted); font-size:11px; }
.cube-help-feedback button { width:30px; height:30px; border:1px solid transparent; border-radius:50%; color:#7b8497; background:transparent; cursor:pointer; }
.cube-help-feedback button:hover, .cube-help-feedback button[aria-pressed="true"] { color:#d74560; background:#fff1f4; border-color:#f5ccd5; }
.cube-help-composer { flex-shrink:0; padding:12px 20px 14px; background:#fff; border-top:1px solid var(--ch-border); }
.cube-help-compose-box { border:1px solid #dfe3ec; border-radius:12px; padding:10px; background:#fff; }
.cube-help-compose-box:focus-within { border-color:#ed91a2; box-shadow:0 0 0 2px #ff596f0b; }
.cube-help-root textarea.cube-help-input { display:block; width:100%; min-height:58px; max-height:145px; resize:vertical; border:0; padding:0 2px; margin:0 0 7px; box-shadow:none; background:transparent; color:var(--ch-ink); font-size:14px; line-height:1.5; outline:none; }
.cube-help-compose-tools { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.cube-help-compose-side { display:flex; align-items:center; gap:8px; min-width:0; }
.cube-help-file-note { font-size:10px; color:var(--ch-muted); }
.cube-help-composer-meta { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-top:7px; font-size:10px; color:#8991a1; }
.cube-help-composer-meta > span:first-child { max-width:70%; }
.cube-help-usage { white-space:nowrap; }
.cube-help-alert { padding:9px 11px; border:1px solid #f0d2d7; border-radius:8px; background:#fff6f7; color:#a93249; margin-bottom:9px; font-size:12px; overflow-wrap:anywhere; }
.cube-help-preview { display:flex; align-items:center; gap:9px; width:100%; padding:7px; margin-bottom:8px; border:1px solid var(--ch-border); border-radius:9px; background:#f8f9fb; }
.cube-help-preview img { width:46px; height:46px; object-fit:cover; border-radius:5px; }
.cube-help-preview-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.cube-help-preview button { flex-shrink:0; }
.cube-help-thinking { color:var(--ch-muted); font-size:13px; }
.cube-help-thinking::after { display:inline-block; content:'…'; animation:cube-help-pulse 1s ease-in-out infinite alternate; }
@keyframes cube-help-pulse { to { opacity:.25; } }
.cube-help-launcher { position:fixed; right:22px; bottom:calc(24px + var(--cube-help-bottom-clearance, 0px)); z-index:9000; isolation:isolate; display:flex; gap:8px; align-items:center; border-radius:999px; padding:0 16px; height:36px; border:1px solid #ff8293; color:#fff; background:#ff596f; box-shadow:0 6px 24px #c4475c35; font-weight:800; font-size:13px; cursor:pointer; }
.cube-help-launcher:hover { background:#ef4d64; }
.cube-help-launcher > i { font-size:19px; }
.cube-help-widget { position:fixed; bottom:calc(80px + var(--cube-help-bottom-clearance, 0px)); right:22px; z-index:9001; isolation:isolate; width:430px; max-width:calc(100vw - 30px); background:#fff; border:1px solid var(--ch-border); border-radius:16px; box-shadow:0 12px 55px #25304824; overflow:hidden; }
.cube-help-widget .cube-help-chat { height:min(680px,calc(100dvh - 115px - var(--cube-help-bottom-clearance, 0px))); min-height:0; }
.cube-help-widget .cube-help-head { padding:13px 14px; }
.cube-help-widget .cube-help-copy h2 { font-size:15px; }
.cube-help-widget .cube-help-copy p { font-size:11px; }
.cube-help-widget .cube-help-icon { width:32px; height:32px; flex-basis:32px; }
.cube-help-widget .cube-help-chat-main { padding:15px; }
.cube-help-widget .cube-help-welcome { margin:10px 0 18px; }
.cube-help-widget .cube-help-welcome h3 { font-size:20px; }
.cube-help-widget .cube-help-suggestions { grid-template-columns:minmax(0,1fr); gap:6px; margin-top:13px; }
.cube-help-widget .cube-help-suggestion { padding:9px 11px; }
.cube-help-widget .cube-help-composer { padding:10px 12px; }
.cube-help-widget .cube-help-file-note { display:none; }
.cube-help-widget .cube-help-message-text { font-size:13px; }
.cube-help-admin-card { padding:20px; }
.cube-help-admin-card > .cube-help-head { padding:0 0 16px; border:0; }
.cube-help-stat-row { display:flex; gap:10px; flex-wrap:wrap; margin:0 0 16px; }
.cube-help-stat { width:160px; padding:12px 14px; border:1px solid var(--ch-border); border-radius:10px; background:#fff; }
.cube-help-stat span { display:block; font-size:11px; color:var(--ch-muted); }
.cube-help-stat strong { display:block; margin-top:2px; font-size:23px; line-height:1.25; font-weight:800; }
.cube-help-filter { padding:14px; margin:0 0 14px; border:1px solid #e9ebf0; border-radius:12px; background:#f7f8fa; }
.cube-help-filter-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.cube-help-filter-head .cube-help-copy { gap:4px; }
.cube-help-filter-head h3 { font-size:14px; }
.cube-help-filter-summary { display:flex; flex-wrap:wrap; gap:5px; font-size:11px; color:var(--ch-muted); }
.cube-help-filter-summary span { display:inline-block; border:1px solid #e0e4ec; border-radius:999px; padding:2px 8px; background:#fff; }
.cube-help-fields { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,171px)); gap:10px; }
.cube-help-field { display:flex; flex-direction:column; gap:5px; min-width:0; margin:0; }
.cube-help-field > span { font-size:12px; font-weight:700; color:#586278; }
.cube-help-root .cube-help-field input, .cube-help-root .cube-help-field select { width:100%; max-width:100%; height:36px; min-height:36px; padding:0 10px; border:1px solid #dce1ea; border-radius:8px; background:#fff; color:var(--ch-ink); font-size:13px; margin:0; box-shadow:none; }
.cube-help-settings { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px; padding:14px; border:1px solid #f4d8de; border-radius:12px; background:#fff9fa; margin-bottom:14px; }
.cube-help-settings > .cube-help-copy { flex:1; min-width:190px; align-self:center; }
.cube-help-settings .cube-help-copy h3 { font-size:14px; }
.cube-help-settings .cube-help-field { width:145px; }
.cube-help-switch { display:flex; align-items:center; gap:7px; height:36px; padding:0 4px; font-size:13px; }
.cube-help-switch input { position:static !important; opacity:1 !important; appearance:auto; width:16px; height:16px; accent-color:#ff596f; }
.cube-help-table-info { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; color:var(--ch-muted); font-size:12px; }
.cube-help-table-shell { overflow:auto; border:1px solid var(--ch-border); border-radius:10px; max-height:680px; }
.cube-help-table { width:100%; min-width:850px; border-collapse:separate; border-spacing:0; table-layout:fixed; }
.cube-help-table th, .cube-help-table td { padding:11px 12px; border-bottom:1px solid #edf0f4; text-align:left; vertical-align:top; font-size:12px; color:#4f5b74; overflow-wrap:anywhere; }
.cube-help-table th { position:sticky; top:0; z-index:2; background:#f8f9fb; color:#697387; font-size:11px; font-weight:700; }
.cube-help-table th:last-child, .cube-help-table td:last-child { position:sticky; right:0; background:#fff; border-left:1px solid var(--ch-border); width:84px; text-align:center; }
.cube-help-table th:last-child { z-index:3; background:#f8f9fb; }
.cube-help-table tr:last-child td { border-bottom:0; }
.cube-help-table tbody tr:hover td { background:#fbfcfe; }
.cube-help-table .cube-help-table-question { color:var(--ch-ink); font-weight:600; }
.cube-help-table .cube-help-table-sub { color:#9299a7; font-size:10px; margin-top:3px; }
.cube-help-pill { display:inline-flex; padding:3px 7px; border-radius:999px; background:#edf6f2; color:#3b8064; font-size:10px; line-height:1.4; white-space:nowrap; }
.cube-help-pill-bad { background:#fff0f3; color:#b1455a; }
.cube-help-pill-pending { background:#fff5e6; color:#a47829; }
.cube-help-table-buttons { display:flex; justify-content:center; gap:6px; min-width:0; }
.cube-help-table-buttons .cube-help-btn-icon { width:30px; height:30px; min-height:30px; flex-basis:30px; font-size:12px !important; }
.cube-help-pagination { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:12px; font-size:12px; color:var(--ch-muted); }
.cube-help-dialog-backdrop { position:fixed; inset:0; z-index:1005; background:#17213d66; display:flex; align-items:center; justify-content:center; padding:20px; }
.cube-help-dialog { display:flex; flex-direction:column; width:760px; max-width:100%; max-height:calc(100dvh - 40px); background:#fff; border-radius:14px; box-shadow:0 15px 60px #0003; overflow:hidden; }
.cube-help-dialog-body { padding:18px 20px; overflow:auto; min-height:0; }
.cube-help-detail-meta { display:flex; flex-wrap:wrap; gap:6px 16px; padding:11px 13px; border:1px solid var(--ch-border); border-radius:9px; background:#f8f9fb; margin-bottom:18px; font-size:11px; color:var(--ch-muted); }
.cube-help-detail-section { margin-bottom:18px; }
.cube-help-detail-section h3 { font-size:12px; color:var(--ch-muted); margin-bottom:6px; }
.cube-help-detail-text { white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.75; }
.cube-help-detail-image { display:block; max-width:100%; max-height:600px; margin-top:8px; border:1px solid var(--ch-border); border-radius:8px; }
.cube-help-dialog-foot { padding:12px 20px; border-top:1px solid var(--ch-border); display:flex; justify-content:flex-end; gap:8px; flex-shrink:0; }
.cube-help-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:700px) {
 .cube-help-admin-card { padding:14px; }
 .cube-help-admin-card > .cube-help-head { align-items:flex-start; flex-wrap:wrap; }
 .cube-help-head { padding:14px; }
 .cube-help-head .cube-help-actions { gap:5px; }
 .cube-help-head .cube-help-actions .cube-help-btn { padding:0 11px; font-size:12px !important; }
 .cube-help-head .cube-help-actions .cube-help-btn-icon { padding:0; }
 .cube-help-chat { height:calc(100dvh - 185px); min-height:430px; }
 .cube-help-chat-main { padding:15px; }
 .cube-help-composer { padding:10px 12px; }
 .cube-help-welcome { margin:10px auto; }
 .cube-help-suggestions { grid-template-columns:minmax(0,1fr); }
 .cube-help-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .cube-help-filter-head .cube-help-actions { width:100%; justify-content:flex-end; }
 .cube-help-stat { width:calc(50% - 5px); }
 .cube-help-settings .cube-help-field { flex:1; min-width:120px; }
 .cube-help-dialog-backdrop { padding:10px; }
 .cube-help-dialog { max-height:calc(100dvh - 20px); }
 .cube-help-dialog-body { padding:14px; }
 .cube-help-dialog .cube-help-head { padding:14px; }
 .cube-help-file-note { display:none; }
}
@media(max-width:480px) {
 .cube-help-launcher { right:12px; bottom:calc(14px + var(--cube-help-bottom-clearance, 0px)); height:36px; padding:0 14px; }
 .cube-help-widget { right:8px; bottom:calc(64px + var(--cube-help-bottom-clearance, 0px)); width:calc(100vw - 16px); max-width:none; }
 .cube-help-widget .cube-help-chat { height:calc(100dvh - 84px - var(--cube-help-bottom-clearance, 0px)); min-height:0; }
 .cube-help-copy h1 { font-size:16px; }
 .cube-help-page-card .cube-help-head .cube-help-icon { display:none; }
 .cube-help-composer-meta { font-size:9px; gap:6px; }
 .cube-help-fields { grid-template-columns:minmax(0,1fr); }
}
@media(prefers-reduced-motion:reduce) { .cube-help-chat-main { scroll-behavior:auto; } .cube-help-thinking::after { animation:none; } }

/* Helpers are body portals: above navigation/table menus and support notices, below confirmations.
   Legacy generic dialogs use z-index 40 (Huro: 100); temporarily lower helpers while dialogs own input. */
body:has(.modal.is-active, .modal.modal-in, .modal.show, .right-panel-wrapper.is-active, .cube-help-dialog-backdrop) > .cube-help-launcher,
body:has(.modal.is-active, .modal.modal-in, .modal.show, .right-panel-wrapper.is-active, .cube-help-dialog-backdrop) > .cube-help-widget { z-index:30; }
.cube-help-message-text.is-revealing::after { content:''; display:inline-block; width:3px; height:1em; margin-left:3px; vertical-align:-.12em; border-radius:2px; background:#ff596f; }
