/* Xassist. The assistant page has its own light and dark palette (the
   platform shell is light-only); admin pages use the platform look plus the
   few helpers at the end of this file. */
:root {
  --xa-bg: #F5F6FA; --xa-surface: #FFFFFF; --xa-raise: #FFFFFF; --xa-ink: #141A2E; --xa-muted: #5B6480; --xa-line: #E2E5EE;
  --xa-accent: #2F4BD8; --xa-accent-ink: #FFFFFF; --xa-accent-soft: #E9EDFF; --xa-accent-text: #2338B5;
  --xa-me: #2F4BD8; --xa-me-ink: #FFFFFF; --xa-ai: transparent;
  --xa-ok: #13795B; --xa-ok-soft: #E2F4EC; --xa-warn: #A15C00; --xa-warn-soft: #FFF2DE; --xa-bad: #B42335; --xa-bad-soft: #FDE8EB;
  --xa-shadow: 0 1px 2px rgba(20, 26, 46, .06), 0 8px 24px rgba(20, 26, 46, .06);
  --xa-font: var(--font, "IBM Plex Sans", system-ui, sans-serif);
  --xa-mono: var(--font-mono, ui-monospace, monospace);
}
:root[data-theme="dark"] {
  --xa-bg: #0D1120; --xa-surface: #141A2C; --xa-raise: #1A2136; --xa-ink: #E6E9F4; --xa-muted: #98A1BF; --xa-line: #273050;
  --xa-accent: #8DA1FF; --xa-accent-ink: #0D1120; --xa-accent-soft: #1E2750; --xa-accent-text: #AEBBFF;
  --xa-me: #3A55E0; --xa-me-ink: #FFFFFF;
  --xa-ok: #5FD3A6; --xa-ok-soft: #12321F; --xa-warn: #F3B562; --xa-warn-soft: #3A2A10; --xa-bad: #FF8A99; --xa-bad-soft: #3B1820;
  --xa-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --xa-bg: #0D1120; --xa-surface: #141A2C; --xa-raise: #1A2136; --xa-ink: #E6E9F4; --xa-muted: #98A1BF; --xa-line: #273050;
    --xa-accent: #8DA1FF; --xa-accent-ink: #0D1120; --xa-accent-soft: #1E2750; --xa-accent-text: #AEBBFF;
    --xa-me: #3A55E0; --xa-me-ink: #FFFFFF;
    --xa-ok: #5FD3A6; --xa-ok-soft: #12321F; --xa-warn: #F3B562; --xa-warn-soft: #3A2A10; --xa-bad: #FF8A99; --xa-bad-soft: #3B1820;
    --xa-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

html, body.xa-app { height: 100%; }
body.xa-app { margin: 0; background: var(--xa-bg); color: var(--xa-ink); font: 15px/1.55 var(--xa-font); -webkit-font-smoothing: antialiased; }
.xa-app [hidden] { display: none !important; }
.xa-app a { color: var(--xa-accent-text); }
.xa-app button { font: inherit; color: inherit; }
.xa-muted { color: var(--xa-muted); font-size: 13px; margin: 0; }
.xa-pad { padding: 8px 12px; }

/* ---------------------------------------------------------------- frame */
.xa-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr) 320px; grid-template-rows: 56px minmax(0, 1fr); height: 100dvh; }
.xa-shell.is-panel-off { grid-template-columns: 264px minmax(0, 1fr) 0; }
.xa-shell.is-panel-off .xa-panel { display: none; }
.xa-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: var(--xa-surface); border-bottom: 1px solid var(--xa-line); min-width: 0; z-index: 30; }
.xa-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--xa-ink) !important; text-decoration: none; letter-spacing: -.01em; }
.xa-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--xa-accent); color: var(--xa-accent-ink); }
.xa-mark-lg { width: 52px; height: 52px; border-radius: 15px; }
.xa-scope { font-size: 12px; color: var(--xa-muted); border: 1px solid var(--xa-line); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.xa-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.xa-pill-link { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--xa-line);
  color: var(--xa-ink) !important; text-decoration: none; font-size: 13px; background: var(--xa-surface); }
.xa-pill-link b { background: var(--xa-accent); color: var(--xa-accent-ink); border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.xa-pill-link.is-alert { border-color: var(--xa-warn); color: var(--xa-warn) !important; background: var(--xa-warn-soft); }
.xa-pill-link.is-alert b { background: var(--xa-warn); color: #fff; }
.xa-icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--xa-muted); cursor: pointer; }
.xa-icon-btn:hover { background: var(--xa-accent-soft); color: var(--xa-accent-text); }
.xa-avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--xa-accent-soft); color: var(--xa-accent-text); font-weight: 700; cursor: pointer; }
.xa-menu-wrap, .launcher-wrap { position: relative; }
.xa-account { min-width: 240px; padding: 6px; background: var(--xa-raise); border: 1px solid var(--xa-line); box-shadow: var(--xa-shadow); border-radius: 12px; z-index: 50; }
.xa-account-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--xa-line); margin-bottom: 4px; display: flex; flex-direction: column; }
.xa-account-head span { font-size: 12px; color: var(--xa-muted); }
.xa-account a, .xa-account button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  color: var(--xa-ink) !important; text-decoration: none; font-size: 14px; cursor: pointer; text-align: left; }
.xa-account a:hover, .xa-account button:hover { background: var(--xa-accent-soft); }
.xa-account form { margin: 0; }
.xa-app .launcher-panel { background: var(--xa-raise); border-color: var(--xa-line); color: var(--xa-ink); }
.xa-app .launcher-btn { background: transparent; border-color: var(--xa-line); color: var(--xa-muted); }

/* ---------------------------------------------------------------- threads */
.xa-threads { grid-row: 2; border-right: 1px solid var(--xa-line); background: var(--xa-surface); display: flex; flex-direction: column; min-height: 0; padding: 12px 10px; gap: 10px; }
.xa-new { display: flex; align-items: center; gap: 8px; justify-content: center; height: 40px; border-radius: 10px; border: 1px solid var(--xa-line); background: var(--xa-bg);
  font-weight: 600; cursor: pointer; color: var(--xa-ink); }
.xa-new:hover { border-color: var(--xa-accent); color: var(--xa-accent-text); }
.xa-thread-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.xa-thread-list h3 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--xa-muted); margin: 10px 10px 4px; font-weight: 600; }
.xa-thread { display: block; padding: 8px 10px; border-radius: 8px; color: var(--xa-ink) !important; text-decoration: none; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xa-thread:hover { background: var(--xa-bg); }
.xa-thread.is-on { background: var(--xa-accent-soft); color: var(--xa-accent-text) !important; font-weight: 600; }

/* ---------------------------------------------------------------- chat */
.xa-main { grid-row: 2; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.xa-log { flex: 1; overflow-y: auto; padding: 24px max(16px, calc((100% - 760px) / 2)) 12px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.xa-hello { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 0; }
.xa-hello h1 { font-size: 26px; margin: 6px 0 0; letter-spacing: -.02em; text-wrap: balance; }
.xa-hello p { color: var(--xa-muted); max-width: 52ch; margin: 0; text-wrap: balance; }
.xa-ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; width: 100%; max-width: 640px; margin-top: 12px; }
.xa-idea { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--xa-line); background: var(--xa-surface);
  cursor: pointer; font-size: 14px; color: var(--xa-ink); min-width: 0; }
.xa-idea svg { color: var(--xa-accent-text); flex: none; }
.xa-idea:hover { border-color: var(--xa-accent); box-shadow: var(--xa-shadow); }
.xa-next { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 10px !important; }

.xa-msg { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.xa-msg.is-me { justify-content: flex-end; }
.xa-bubble { max-width: min(88%, 640px); padding: 10px 14px; border-radius: 16px; min-width: 0; overflow-wrap: anywhere; }
.is-me .xa-bubble { background: var(--xa-me); color: var(--xa-me-ink); border-bottom-right-radius: 5px; white-space: pre-wrap; }
.is-ai .xa-bubble { background: var(--xa-ai); padding: 2px 0; max-width: 100%; flex: 1; }
.is-ai .xa-mark { flex: none; margin-top: 2px; }
.xa-sys { align-self: center; font-size: 12.5px; color: var(--xa-muted); background: var(--xa-surface); border: 1px solid var(--xa-line); border-radius: 999px; padding: 3px 12px; }
.xa-md p { margin: 0 0 10px; } .xa-md p:last-child { margin-bottom: 0; }
.xa-md ul, .xa-md ol { margin: 4px 0 10px; padding-left: 22px; } .xa-md ul { list-style: disc; } .xa-md ol { list-style: decimal; } .xa-md li { margin: 2px 0; }
.xa-md h3 { font-size: 15px; margin: 12px 0 6px; }
.xa-md code { font-family: var(--xa-mono); font-size: 13px; background: var(--xa-accent-soft); padding: 1px 5px; border-radius: 5px; }
.xa-md .xa-table { overflow-x: auto; margin: 6px 0 10px; border: 1px solid var(--xa-line); border-radius: 10px; }
.xa-md table { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.xa-md th, .xa-md td { padding: 7px 10px; border-bottom: 1px solid var(--xa-line); text-align: left; vertical-align: top; }
.xa-md th { background: var(--xa-bg); font-size: 12px; color: var(--xa-muted); font-weight: 600; }
.xa-md tr:last-child td { border-bottom: 0; }
.xa-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--xa-muted); margin-top: 6px; align-items: center; }
.xa-meta button { border: 0; background: none; color: var(--xa-muted); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.xa-meta button:hover { color: var(--xa-accent-text); }
.xa-thinking { display: inline-flex; gap: 5px; align-items: center; color: var(--xa-muted); font-size: 13.5px; }
.xa-thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--xa-accent); animation: xa-dot 1.2s infinite ease-in-out; }
.xa-thinking i:nth-child(2) { animation-delay: .15s; } .xa-thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes xa-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.xa-error { color: var(--xa-bad); background: var(--xa-bad-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

/* confirm cards */
.xa-card { margin-top: 10px; border: 1px solid var(--xa-accent); border-radius: 14px; overflow: hidden; background: var(--xa-surface); max-width: 520px; box-shadow: var(--xa-shadow); }
.xa-card header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--xa-accent-soft); color: var(--xa-accent-text); font-weight: 600; font-size: 14px; }
.xa-card dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; padding: 12px 14px; font-size: 14px; }
.xa-card dt { color: var(--xa-muted); }
.xa-card dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.xa-card-acts { display: flex; gap: 8px; padding: 0 14px 14px; flex-wrap: wrap; }
.xa-card-acts button { height: 36px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--xa-line); background: var(--xa-surface); color: var(--xa-ink); font-weight: 600; cursor: pointer; }
.xa-card-acts .is-primary { background: var(--xa-accent); border-color: var(--xa-accent); color: var(--xa-accent-ink); }
.xa-card-acts button:disabled { opacity: .6; cursor: default; }
.xa-card-state { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13.5px; border-top: 1px solid var(--xa-line); }
.xa-card.is-done { border-color: var(--xa-ok); } .xa-card.is-done header { background: var(--xa-ok-soft); color: var(--xa-ok); }
.xa-card.is-failed { border-color: var(--xa-bad); } .xa-card.is-failed header { background: var(--xa-bad-soft); color: var(--xa-bad); }
.xa-card.is-cancelled, .xa-card.is-expired { border-color: var(--xa-line); opacity: .8; } .xa-card.is-cancelled header, .xa-card.is-expired header { background: var(--xa-bg); color: var(--xa-muted); }

/* composer */
.xa-composer { padding: 8px max(16px, calc((100% - 760px) / 2)) max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--xa-bg) 70%, transparent); }
.xa-box { display: flex; align-items: flex-end; gap: 8px; background: var(--xa-surface); border: 1px solid var(--xa-line); border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: var(--xa-shadow); }
.xa-box:focus-within { border-color: var(--xa-accent); }
.xa-box textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; color: var(--xa-ink); font: inherit; line-height: 1.5; max-height: 180px; padding: 6px 0; min-width: 0; }
.xa-box-tools { display: flex; gap: 4px; align-items: center; }
.xa-mic, .xa-send { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; }
.xa-mic { background: var(--xa-accent-soft); color: var(--xa-accent-text); }
.xa-mic.is-listening { background: var(--xa-bad); color: #fff; animation: xa-pulse 1.4s infinite; }
@keyframes xa-pulse { 0% { box-shadow: 0 0 0 0 rgba(180, 35, 53, .45); } 70% { box-shadow: 0 0 0 10px rgba(180, 35, 53, 0); } 100% { box-shadow: 0 0 0 0 rgba(180, 35, 53, 0); } }
.xa-send { background: var(--xa-accent); color: var(--xa-accent-ink); }
.xa-send:disabled { opacity: .45; cursor: default; }
[data-xa-speak] .xa-on { display: none; } [data-xa-speak][aria-pressed="true"] .xa-on { display: inline; } [data-xa-speak][aria-pressed="true"] .xa-off { display: none; }
[data-xa-speak][aria-pressed="true"] { color: var(--xa-accent-text); background: var(--xa-accent-soft); }
.xa-foot { text-align: center; font-size: 11.5px; color: var(--xa-muted); margin: 6px 0 0; }
.xa-interim { color: var(--xa-muted); font-style: italic; }

/* ---------------------------------------------------------------- panel */
.xa-panel { grid-row: 2; border-left: 1px solid var(--xa-line); background: var(--xa-surface); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.xa-panel h2 { display: flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--xa-muted); margin: 0 0 8px; font-weight: 600; }
.xa-item { padding: 9px 10px; border: 1px solid var(--xa-line); border-radius: 10px; margin-bottom: 6px; font-size: 13px; background: var(--xa-bg); min-width: 0; }
.xa-item b { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.xa-item span { color: var(--xa-muted); font-size: 12px; }
.xa-item.is-late { border-color: var(--xa-bad); }
.xa-item.is-ask { border-color: var(--xa-warn); background: var(--xa-warn-soft); }
.xa-item form { display: flex; gap: 6px; margin-top: 6px; }
.xa-item input { flex: 1; min-width: 0; height: 32px; border-radius: 8px; border: 1px solid var(--xa-line); padding: 0 8px; background: var(--xa-surface); color: var(--xa-ink); font: inherit; font-size: 13px; }
.xa-item form button { height: 32px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--xa-accent); color: var(--xa-accent-ink); font-weight: 600; cursor: pointer; font-size: 12.5px; }
.xa-chip-state { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--xa-accent-soft); color: var(--xa-accent-text); margin-top: 4px; }
.xa-chip-state.is-done { background: var(--xa-ok-soft); color: var(--xa-ok); }
.xa-chip-state.is-late { background: var(--xa-bad-soft); color: var(--xa-bad); }
.xa-chip-state.is-wait { background: var(--xa-warn-soft); color: var(--xa-warn); }
.xa-scrim { position: fixed; inset: 0; background: rgba(10, 14, 28, .35); z-index: 35; }

/* ---------------------------------------------------------------- narrow */
.xa-only-narrow { display: none; }
@media (max-width: 1180px) {
  .xa-shell, .xa-shell.is-panel-off { grid-template-columns: 248px minmax(0, 1fr) 0; }
  .xa-panel { display: none; position: fixed; top: 56px; right: 0; bottom: 0; width: min(340px, 92vw); z-index: 40; box-shadow: var(--xa-shadow); }
  .xa-shell.is-panel-open .xa-panel { display: flex; }
}
@media (max-width: 780px) {
  .xa-shell, .xa-shell.is-panel-off { grid-template-columns: minmax(0, 1fr) 0 0; }
  .xa-threads { display: none; position: fixed; top: 56px; left: 0; bottom: 0; width: min(300px, 86vw); z-index: 40; box-shadow: var(--xa-shadow); }
  .xa-shell.is-threads-open .xa-threads { display: flex; }
  .xa-main { grid-column: 1; }
  .xa-only-narrow { display: inline-grid; }
  .xa-hide-narrow, .xa-scope { display: none; }
  .xa-hello h1 { font-size: 22px; }
  .xa-ideas { grid-template-columns: 1fr; }
  .xa-log { padding-top: 16px; }
}
@media (min-width: 1181px) { .xa-only-wide { display: inline-grid; } }
@media (max-width: 1180px) { .xa-only-wide { display: inline-grid; } }
@media (prefers-reduced-motion: reduce) { .xa-thinking i, .xa-mic.is-listening { animation: none; } .xa-log { scroll-behavior: auto; } }
.xa-shell.is-embed .xa-top .xa-brand span:last-child, .xa-shell.is-embed .launcher-wrap { display: none; }

/* ---------------------------------------------------------------- admin portal helpers (platform shell) */
.xa-callout { margin-bottom: 16px; }
.xa-callout.is-alert { border-color: var(--danger-border, #f3b7b7); background: var(--danger-soft, #fff5f5); }
.xa-row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.xa-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.xa-actions form { margin: 0; }
.input.input-sm { height: 30px; font-size: 12.5px; width: auto; }
.xa-switch-form { display: flex; flex-direction: column; gap: 14px; }
.xa-switch-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.xa-switch-cols fieldset { border: 1px solid var(--border-card, #e5e7eb); border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.xa-switch-cols legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.xa-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.xa-check input { margin-top: 3px; }
.xa-check span { display: flex; flex-direction: column; }
.xa-check small { color: var(--muted, #6b7280); font-size: 12px; }
.xa-check.is-soon { opacity: .55; cursor: default; }
.xa-note { font-size: 12.5px; margin: 0; display: flex; gap: 6px; align-items: center; }
.xa-grant { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.xa-grant-note { grid-column: span 2; }
@media (max-width: 640px) { .xa-grant-note { grid-column: auto; } }
.xa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.xa-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-card, #e5e7eb); color: var(--muted, #6b7280); text-decoration: line-through; }
.xa-chip.is-on { text-decoration: none; color: var(--text, #111827); background: var(--brand-soft, #eef2ff); border-color: transparent; }
.xa-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.xa-unit { display: flex; align-items: center; gap: 8px; } .xa-unit .input { max-width: 110px; } .xa-unit span { font-size: 13px; color: var(--muted, #6b7280); }
.xa-meter { height: 8px; border-radius: 999px; background: var(--bg, #f3f4f6); overflow: hidden; margin-top: 8px; } .xa-meter span { display: block; height: 100%; background: var(--brand, #2F4BD8); }
.xa-prose p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.xa-fu-asks { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.xa-fu-ask { border-left: 3px solid var(--warning, #d97706); padding: 6px 10px; background: var(--warning-soft, #fffbeb); border-radius: 6px; font-size: 13px; }
.xa-fu-ask form { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; } .xa-fu-ask .input { flex: 1; min-width: 180px; }
.xa-reply { display: flex; flex-direction: column; gap: 14px; }
.xa-reply-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; margin: 0; }
.xa-reply-facts dt { color: var(--muted, #6b7280); } .xa-reply-facts dd { margin: 0; font-weight: 500; }

/* ---------------------------------------------------------------- admin tables and cards (from the Inventory/Helpdesk shell, 2026-11-30) */
/* desk tokens */
:root {
   --hd-ink: #0F172A;
   --hd-ink-2: #1E293B;
   --hd-line: #EEF0F3;
   --hd-row-hover: #F8FAFC;
   --hd-violet: #7C3AED;
   --hd-note: #FFFBEB;
   --hd-note-line: #FDE68A;
   --hd-radius: 12px;
   --hd-shadow: 0 1px 2px rgb(16 24 40 / .04), 0 1px 3px rgb(16 24 40 / .06);
   --hd-shadow-lg: 0 4px 6px -2px rgb(16 24 40 / .05), 0 12px 24px -4px rgb(16 24 40 / .10);
}
.st {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; line-height: 1;
}
.mt { width: 100%; border-collapse: collapse; font-size: 13px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.hd-muted { color: var(--muted); }
.hd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-card {
  background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--hd-radius);
  box-shadow: var(--hd-shadow);
}
.hd-card-pad { padding: 18px; }
.hd-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--hd-line);
}
.hd-card-head h3, .hd-card-head h2 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.hd-card-head .icon { color: var(--text-2); }
.hd-card-body { padding: 16px 18px; }
.hd-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.hd-empty .icon { width: 28px; height: 28px; color: #CBD5E1; display: block; margin: 0 auto 8px; }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.st-info    { background: #EFF6FF; color: #1D4ED8; border-color: #DBEAFE; }
.st-violet  { background: #F5F3FF; color: #6D28D9; border-color: #EDE9FE; }
.st-warning { background: #FFFBEB; color: #B45309; border-color: #FEF3C7; }
.st-neutral { background: #F3F4F6; color: #4B5563; border-color: #E5E7EB; }
.st-success { background: #F0FDF4; color: #15803D; border-color: #DCFCE7; }
.st-muted   { background: #F9FAFB; color: #6B7280; border-color: #E5E7EB; }
.st-lg { height: 26px; padding: 0 11px; font-size: 12.5px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.filters .search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filters .search input { padding-left: 34px; height: 36px; }
.filters select.input { height: 36px; width: auto; min-width: 0; padding-right: 30px; font-size: 13px; }
.filters select.input.is-set { border-color: var(--brand); background-color: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.filters .clear { font-size: 13px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.dropzone .icon, .tk-meta .icon, .hd-muted .icon { display: inline-block; vertical-align: -3px; }
.filters select.input { max-width: 168px; }
.filters .search { flex: 1 1 220px; max-width: 320px; }
.flash-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.flash span { flex: 1; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.flash-info    { background: #f0f9ff; border-color: #bae6fd; color: #0c4a6e; }
.mt th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: #F9FAFB; padding: 9px 14px; border-bottom: 1px solid var(--hd-line); white-space: nowrap; }
.mt td { padding: 10px 14px; border-bottom: 1px solid var(--hd-line); vertical-align: middle; }
.mt tr:last-child td { border-bottom: 0; }
.mt .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt .p { font-weight: 600; color: var(--text); }
.mt .s { display: block; font-size: 11.5px; color: var(--muted); }
.mt tr.is-sub td { background: #F9FAFB; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); padding: 7px 14px; }
.mt tfoot td { font-weight: 700; background: #F9FAFB; }
.mt a { color: var(--text); font-weight: 600; }
.mt a:hover { color: var(--brand-text); }
.fchip { height: 30px; padding: 0 12px; border: 1px solid #E5E7EB; border-radius: 999px; background: #fff; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.fchip b { color: var(--text); font-variant-numeric: tabular-nums; }
.fchip:hover { border-color: #CBD5E1; text-decoration: none; }
.fchip.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); font-weight: 600; }
.fchip-sep { width: 1px; height: 20px; background: #E5E7EB; margin: 0 2px; }
.hd-card-head .chart-note { font-size: 12px; color: var(--muted); font-weight: 500; }
.hd-card-head .hd-link-more { margin-left: auto; }
.mt th.sortable a { color: inherit; text-decoration: none; display: inline-flex; gap: 2px; }
.mt th.sortable a:hover { color: var(--text); }
.mt th.is-sorted { color: var(--text); }
.mt tbody tr:hover td { background: #FAFBFC; }
.mt td .share { min-width: 110px; }
.st-danger { background: #FEF2F2; color: #B91C1C; border-color: #FEE2E2; }
.filters .input[type=date] { max-width: 180px; } .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; } .filters .input { width: auto; }
.xa-ctx { margin: 0 max(16px, calc((100% - 760px) / 2)); font-size: 12.5px; color: var(--xa-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .xa-ctx code { font-family: var(--xa-mono); background: var(--xa-accent-soft); padding: 0 5px; border-radius: 4px; }
