/* MailboxOS — shared utility styles.
 * Adapted from the HR OS design system (2026-06 refresh). Raw color values
 * match the tokens in tailwind-config.js so they work without the Tailwind
 * JIT @apply machinery (the Play CDN doesn't process external stylesheets).
 * HR-specific sections (org chart, faceted list, quick search) trimmed;
 * run-activity component classes added at the bottom.
 */

/* ---- Body baseline ---- */
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1A1816;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
input, button, select, textarea { font-family: inherit; }
input::placeholder, textarea::placeholder { color: #9A968F; }
[x-cloak] { display: none !important; }

/* ---- Page canvas + content card (2026-06 design refresh) ----
   Soft paper canvas with a whisper of dot-grid texture; page content sits
   in a white card with a hairline border. */
body.page-canvas {
  background-color: #F7F5F0;
  background-image: radial-gradient(rgba(122,118,111,0.13) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.page-card {
  background: #fff;
  border: 1px solid #E8E3D9;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(28,24,18,0.04), 0 12px 32px -20px rgba(28,24,18,0.10);
  padding: 14px 16px 12px;
}
@media (max-width: 767px) { .page-card { padding: 10px 10px 12px; border-radius: 10px; } }
.page-title-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: #fff; border: 1px solid #E8E3D9;
  display: inline-flex; align-items: center; justify-content: center;
  color: #3A3833; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(28,24,18,0.05);
}

/* ---- Brand wordmark ---- */
.wordmark { letter-spacing: -0.02em; }
.wordmark .brand-accent { color: #DC2626; font-weight: 700; }
.wordmark .brand-rest { color: #1A1816; font-weight: 500; }

/* ---- Left nav items ---- */
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #3A3833;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.nav-link:hover { background: #F4F1EA; }
.nav-link.is-active { background: #F4F1EA; color: #1A1816; font-weight: 600; }
.nav-link .nav-icon { color: #6B6862; display: inline-flex; }
.nav-link:hover .nav-icon { color: #3A3833; }
.nav-link.is-active .nav-icon { color: #DC2626; }
.nav-icon svg { width: 15px; height: 15px; }
/* Disabled ("coming soon") nav items */
.nav-link.is-disabled { color: #B8B3A9; cursor: default; pointer-events: none; }
.nav-link.is-disabled .nav-icon { color: #CBC6BC; }

/* Small-caps group labels between nav sections */
.nav-section-label {
  padding: 16px 12px 5px;
  font-size: 10.5px; font-weight: 600;
  color: #9A968F;
  letter-spacing: 0.08em; text-transform: uppercase;
  user-select: none;
}
.nav-soon {
  margin-left: auto;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em;
  color: #B0ABA1; background: #F1EEE7;
  padding: 1px 6px; border-radius: 5px; text-transform: uppercase;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost   { background: #fff; border-color: #DDD8CE; color: #1A1816; }
.btn-ghost:hover:not(:disabled) { background: #FBFAF7; }
.btn-primary { background: #1A1816; border-color: #1A1816; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2E2A24; border-color: #2E2A24; }
.btn-accent  { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn-accent:hover:not(:disabled) { background: #B91C1C; border-color: #B91C1C; }
.btn-link    { color: #DC2626; font-weight: 500; padding: 0; background: transparent; border: 0; cursor: pointer; }

/* ---- Inputs ---- */
.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #DDD8CE;
  border-radius: 6px;
  background: #fff;
  color: #1A1816;
  font-size: 13px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: #1A1816; box-shadow: 0 0 0 3px rgba(26,24,22,0.06); }
.input[disabled], .input:disabled { background: #FBFAF7; color: #7A766F; }
.label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #3A3833;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.help { font-size: 11.5px; color: #7A766F; margin-top: 4px; }

/* ---- Status pill ---- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 3px; }
.pill-active      { background: #E7F3EC; color: #0F7A3C; }
.pill-active .dot { background: #1F9D55; }
.pill-leave       { background: #FFF3DA; color: #8A5A00; }
.pill-leave .dot  { background: #D89B14; }
.pill-off         { background: #FBE1E1; color: #A02323; }
.pill-off .dot    { background: #D33A3A; }
.pill-pending     { background: #F1EEE7; color: #7A766F; }
.pill-pending .dot{ background: #B0ABA1; }
/* Pulsing dot for the running pill */
.pill-leave .dot.is-live { animation: dot-pulse 1.3s ease-in-out infinite; }
@keyframes dot-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- Chip ---- */
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #F4F1EA;
  color: #3A3833;
  font-size: 12px;
  font-weight: 500;
}

/* ---- Keyboard chip ---- */
.kbd {
  font-size: 10.5px; color: #7A766F;
  border: 1px solid #E4DFD4; border-radius: 4px;
  padding: 2px 6px; letter-spacing: 0.05em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Popover menu ---- */
.pop { background: #fff; border: 1px solid #EDEAE3; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04); padding: 6px; min-width: 120px; }
.pop-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; font-size: 12.5px; color: #1A1816; cursor: pointer; }
.pop-item:hover { background: #F4F1EA; }

/* ---- Table-like flex rows ---- */
.row {
  display: flex; align-items: center;
  padding: 0 8px;
  height: 52px;
  border-bottom: 1px solid #F4F1EA;
  background: #fff;
  font-size: 13px;
  color: #3A3833;
  transition: background .08s;
  text-decoration: none;
}
.row:hover { background: #FCFBF7; }
.row .cell {
  display: flex; align-items: center;
  padding: 0 10px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-head {
  display: flex; align-items: center;
  padding: 0 8px; height: 34px;
  border-bottom: 1px solid #EDEAE3;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #9A968F;
}
.row-head .cell { padding: 0 10px; }

/* ---- Cards ---- */
.card { background: #fff; border: 1px solid #EDEAE3; border-radius: 8px; }
.card-head { padding: 14px 16px; border-bottom: 1px solid #EDEAE3; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 13px; font-weight: 600; color: #1A1816; }
.card-body { padding: 16px; }

/* ---- Toast ---- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 420px; background: #1A1816; color: #fff; border-radius: 6px; padding: 10px 14px; font-size: 13px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,0.18); display: flex; gap: 10px; align-items: flex-start; pointer-events: auto; }
.toast.success { background: #0F7A3C; }
.toast.error { background: #A02323; }

/* ---- Indeterminate progress bar ---- */
.progress-bar { position: relative; width: 100%; height: 3px; border-radius: 999px; background: #EDEAE3; overflow: hidden; }
.progress-bar::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0;
  width: 40%; border-radius: 999px; background: #DC2626;
  animation: progress-indeterminate 1.1s ease-in-out infinite;
}
@keyframes progress-indeterminate { 0% { left: -40%; } 100% { left: 100%; } }

/* ---- Modal ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,12,8,0.42); }
.modal-card {
  width: 100%; max-width: 460px; background: #fff; border: 1px solid #E8E3D9;
  border-radius: 12px; box-shadow: 0 24px 60px -12px rgba(28,24,18,0.35);
  overflow: hidden;
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid #EDEAE3; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 600; color: #1A1816; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #EDEAE3; display: flex; align-items: center; justify-content: flex-end; gap: 8px; background: #FBFAF7; }
.modal-x { width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #8A8579; background: transparent; border: 0; cursor: pointer; }
.modal-x:hover { background: #F0EDE4; color: #1A1816; }

/* ---- Segmented preset control ---- */
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg-btn {
  padding: 6px 12px; border-radius: 7px; border: 1px solid #E4DFD4;
  background: #fff; color: #7A766F; font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.seg-btn:hover { background: #FBFAF7; }
.seg-btn.is-active { background: #1A1816; border-color: #1A1816; color: #fff; }

/* ---- Toggle switch ---- */
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #D9D4C9; cursor: pointer; transition: background .15s; flex-shrink: 0; border: 0; padding: 0; }
.switch.is-on { background: #DC2626; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform .15s; }
.switch.is-on::after { transform: translateX(16px); }

/* ---- Key entry panel (401 / missing key) ---- */
.key-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background-color: #F7F5F0; background-image: radial-gradient(rgba(122,118,111,0.13) 1px, transparent 1.2px); background-size: 22px 22px; }
.key-card { background: #fff; border: 1px solid #E8E3D9; border-radius: 12px; box-shadow: 0 1px 2px rgba(28,24,18,0.04), 0 12px 32px -20px rgba(28,24,18,0.10); padding: 36px 40px; max-width: 420px; width: 100%; text-align: center; }

/* ============================================================
   Run-activity components (MailboxOS-specific)
   ============================================================ */

/* ---- Stat card ---- */
.stat {
  background: #fff; border: 1px solid #EDEAE3; border-radius: 10px;
  padding: 14px 15px; display: flex; flex-direction: column; gap: 2px;
}
.stat-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #9A968F; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: #1A1816; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: #7A766F; margin-top: 1px; }

/* ---- Stage timeline ---- */
.timeline { display: flex; flex-direction: column; }
.tl-stage { display: flex; gap: 12px; position: relative; padding-bottom: 4px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 16px; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; border: 2px solid #fff; box-shadow: 0 0 0 1px #E0DBD0; z-index: 1; }
.tl-dot.is-succeeded { background: #1F9D55; box-shadow: 0 0 0 1px #1F9D55; }
.tl-dot.is-running   { background: #D89B14; box-shadow: 0 0 0 1px #D89B14; animation: dot-pulse 1.3s ease-in-out infinite; }
.tl-dot.is-failed    { background: #D33A3A; box-shadow: 0 0 0 1px #D33A3A; }
.tl-dot.is-pending   { background: #fff; box-shadow: 0 0 0 1.5px #D6D1C6; }
.tl-line { flex: 1; width: 2px; background: #EDEAE3; margin: 2px 0; min-height: 12px; }
.tl-line.is-done { background: #CDE6D6; }
.tl-body { flex: 1; min-width: 0; padding-bottom: 14px; }
.tl-name { font-size: 13px; font-weight: 600; color: #1A1816; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tl-name.is-pending { color: #9A968F; font-weight: 500; }
.tl-meta { font-size: 11.5px; color: #7A766F; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tl-dur { font-size: 11px; color: #9A968F; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---- Tier / assignment bars ---- */
.tier-row { display: flex; align-items: center; gap: 10px; }
.tier-key { width: 96px; flex-shrink: 0; font-size: 12px; color: #3A3833; display: flex; align-items: center; gap: 7px; }
.tier-swatch { width: 9px; height: 9px; border-radius: 2.5px; flex-shrink: 0; }
.tier-track { flex: 1; height: 8px; border-radius: 999px; background: #F1EEE7; overflow: hidden; }
.tier-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.tier-val { width: 96px; flex-shrink: 0; text-align: right; font-size: 12px; color: #3A3833; font-variant-numeric: tabular-nums; }

/* ---- Spend meter ---- */
.spend-track { width: 100%; height: 8px; border-radius: 999px; background: #F1EEE7; overflow: hidden; }
.spend-fill { height: 100%; border-radius: 999px; background: #DC2626; transition: width .4s ease; }
.spend-fill.is-ok { background: #1F9D55; }
.spend-fill.is-warn { background: #D89B14; }

/* ---- Approval banner ---- */
.approve-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 10px; background: #FFF3DA; border: 1px solid #F0E2C8; }
.approve-icon { width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 1px solid #F0E2C8; color: #8A5A00; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- Activity feed ---- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 11px 2px; border-bottom: 1px solid #F4F1EA; }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: #C5C0B6; margin-top: 5px; flex-shrink: 0; }
.feed-msg { font-size: 12.5px; color: #3A3833; line-height: 1.4; }
.feed-meta { font-size: 11px; color: #9A968F; margin-top: 2px; display: flex; align-items: center; gap: 7px; }
.feed-stage { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: #8A5A00; background: #FFF3DA; padding: 0 6px; border-radius: 4px; }

/* ---- Empty state ---- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 44px 20px; color: #9A968F; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; background: #F4F1EA; color: #B0ABA1; display: grid; place-items: center; margin-bottom: 12px; }
.empty-title { font-size: 14px; font-weight: 600; color: #3A3833; }
.empty-sub { font-size: 12.5px; color: #9A968F; margin-top: 4px; max-width: 320px; }

/* ---- Mailbox card ---- */
.mbx-card { display: block; background: #fff; border: 1px solid #EDEAE3; border-radius: 10px; padding: 15px 16px; transition: border-color .12s, box-shadow .12s, transform .12s; }
.mbx-card:hover { border-color: #DDD8CE; box-shadow: 0 6px 18px -8px rgba(28,24,18,0.16); transform: translateY(-1px); }
.mbx-avatar { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-weight: 600; font-size: 14px; }

/* ---- Taxonomy L1 accent-cycled cards ---- */
.tx-card { border: 1px solid #EDEAE3; border-radius: 12px; overflow: hidden; background: #fff; }
.tx-head { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid #F1EEE7; border-left: 4px solid var(--tx-accent, #DC2626); }
.tx-badge { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; font-weight: 700; color: #fff; background: var(--tx-accent, #DC2626); }
.tx-title { font-size: 14px; font-weight: 600; color: #1A1816; }
.tx-vol { font-size: 11.5px; color: #7A766F; font-variant-numeric: tabular-nums; }
.tx-body { padding: 6px 16px 14px; }
.tx-l2 { padding: 12px 0 4px; }
.tx-l2 + .tx-l2 { border-top: 1px solid #F4F1EA; }
.tx-l2-name { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #9A968F; display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tx-l2-vol { font-size: 10.5px; color: #B0ABA1; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; font-weight: 500; }
.tx-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tx-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border-radius: 7px; background: #F7F5F0; border: 1px solid #EDE9DF; font-size: 12px; color: #3A3833; }
.tx-chip-vol { font-size: 10.5px; font-weight: 600; color: #8A857A; background: #fff; border: 1px solid #E4DFD4; border-radius: 5px; padding: 0 5px; font-variant-numeric: tabular-nums; }

/* ============================================================
   Results & analytics (API_CONTRACT Addendum 1)
   ============================================================ */

/* ---- Hash-driven tab bar ---- */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid #EDEAE3; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 10px 14px; font-size: 13px; font-weight: 500; color: #7A766F; white-space: nowrap; cursor: pointer; border: 0; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s; }
.tab:hover { color: #1A1816; }
.tab.is-active { color: #1A1816; font-weight: 600; border-bottom-color: #DC2626; }

/* ---- Horizontal distribution bars ---- */
.hbar-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.hbar-label { width: 168px; flex-shrink: 0; font-size: 12.5px; color: #3A3833; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; min-width: 40px; height: 8px; border-radius: 999px; background: #F1EEE7; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.hbar-val { width: 96px; flex-shrink: 0; text-align: right; font-size: 12px; color: #3A3833; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .hbar-label { width: 120px; } .hbar-val { width: 76px; } }
/* Compact variant for narrow multi-column lists (People tab) */
.people-list .hbar-label { width: auto; flex: 1; min-width: 0; }
.people-list .hbar-track { flex: 0 0 52px; min-width: 52px; }
.people-list .hbar-val { width: 46px; }

/* ---- Compact mini-stat ---- */
.mini { background: #FBFAF7; border: 1px solid #EDEAE3; border-radius: 9px; padding: 11px 12px; }
.mini-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #9A968F; }
.mini-value { font-size: 19px; font-weight: 600; color: #1A1816; font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -0.01em; line-height: 1.15; }
.mini-sub { font-size: 11px; color: #9A968F; margin-top: 1px; }

/* ---- Chart wrappers — fixed height, no infinite-growth canvas ---- */
.chart-wrap { position: relative; width: 100%; }
.chart-h-sm { height: 180px; }
.chart-h-md { height: 232px; }
.chart-h-lg { height: 300px; }

/* ---- Category chips ---- */
.cat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 5px; background: #F4F1EA; color: #3A3833; font-size: 11px; font-weight: 500; white-space: nowrap; max-width: 100%; }
.cat-chip .cc-dot { width: 6px; height: 6px; border-radius: 2px; flex-shrink: 0; }
.cat-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ---- Slide-over thread reader ---- */
.slideover { position: fixed; inset: 0; z-index: 60; }
.slideover-backdrop { position: absolute; inset: 0; background: rgba(15,12,8,0.42); }
.slideover-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(660px, 100vw); background: #fff; border-left: 1px solid #E8E3D9; box-shadow: -16px 0 44px rgba(28,24,18,0.16); display: flex; flex-direction: column; }
.slideover-head { padding: 13px 18px; border-bottom: 1px solid #EDEAE3; flex-shrink: 0; }
.slideover-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.slideover-body::-webkit-scrollbar { width: 10px; }
.slideover-body::-webkit-scrollbar-thumb { background: #E0DBD0; border-radius: 5px; border: 3px solid #fff; }

/* ---- Thread messages ---- */
.msg { border: 1px solid #EDEAE3; border-radius: 9px; padding: 11px 13px; margin-bottom: 10px; background: #fff; }
.msg.is-owner { background: #FBFAF7; border-color: #E8E3D9; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.msg-avatar { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-size: 11px; font-weight: 600; }
.msg-from { font-size: 12.5px; font-weight: 600; color: #1A1816; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-date { font-size: 11px; color: #9A968F; margin-left: auto; flex-shrink: 0; }
.msg-body { font-size: 12.5px; color: #3A3833; line-height: 1.55; white-space: pre-wrap; word-break: break-word; font-family: inherit; }

/* ---- Enrich gradient panel ---- */
.enrich-panel { border: 1px solid #E6DFF3; border-radius: 11px; padding: 15px 16px; background: linear-gradient(135deg, #F6F3FF 0%, #F0F5FF 100%); }
.enrich-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #7C3AED; }
.enrich-ai-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: rgba(124,58,237,0.10); color: #7C3AED; font-size: 10.5px; font-weight: 600; }

/* ---- Spinner ---- */
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.dark { border-color: rgba(124,58,237,0.25); border-top-color: #7C3AED; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Faceted explorer layout ---- */
.conv-layout { display: flex; gap: 16px; align-items: flex-start; }
.conv-main { flex: 1; min-width: 0; }
.facet-panel { width: 268px; flex-shrink: 0; align-self: flex-start; position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow-y: auto; background: #fff; border: 1px solid #EDEAE3; border-radius: 10px; }
.facet-panel::-webkit-scrollbar { width: 8px; }
.facet-panel::-webkit-scrollbar-thumb { background: #E5E0D5; border-radius: 4px; border: 2px solid #fff; }
.facet-mobile-toggle { display: none; }
@media (max-width: 900px) {
  .facet-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 92vw); z-index: 60; border-radius: 0; border: 0; border-left: 1px solid #E8E3D9; box-shadow: -16px 0 44px rgba(28,24,18,0.16); max-height: none; transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.61,.36,1); }
  .facet-panel.is-open { transform: translateX(0); }
  .facet-mobile-toggle { display: inline-flex; }
}
.facet-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(15,12,8,0.42); }
@media (min-width: 901px) { .facet-backdrop { display: none; } }

/* ---- Facet sections (from HR OS filter drawer) ---- */
.fsec { padding: 4px 0 10px; }
.fsec + .fsec { border-top: 1px solid #EFEBE1; }
.fsec-head { width: 100%; display: flex; align-items: center; gap: 7px; padding: 9px 8px 7px; border: 0; background: transparent; cursor: pointer; font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: #7A766F; border-radius: 6px; text-align: left; }
.fsec-head:hover { color: #1A1816; }
.fsec-n { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #DC2626; color: #fff; font-size: 10px; letter-spacing: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.fsec-chev { margin-left: auto; color: #B5B0A4; transition: transform .18s; flex-shrink: 0; }
.fsec.is-open .fsec-chev { transform: rotate(180deg); }
.fsec-body { padding: 1px 8px 0; }
.fs-list { display: flex; flex-direction: column; gap: 1px; max-height: 240px; overflow-y: auto; margin: 0 -4px; padding-right: 2px; }
.fs-list::-webkit-scrollbar { width: 8px; }
.fs-list::-webkit-scrollbar-thumb { background: #E5E0D5; border-radius: 4px; border: 2px solid #fff; }
.fs-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; font-size: 12.5px; color: #3A3833; cursor: pointer; user-select: none; transition: background .1s; }
.fs-item:hover { background: #F1EDE3; }
.fs-item.is-active { color: #1A1816; }
.fs-item.is-active .fs-label { font-weight: 600; }
.fs-check { width: 15px; height: 15px; border: 1.5px solid #C9C4B9; border-radius: 4.5px; display: inline-flex; align-items: center; justify-content: center; background: #fff; flex-shrink: 0; transition: background .12s, border-color .12s; }
.fs-item.is-active .fs-check { background: #DC2626; border-color: #DC2626; }
.fs-check svg { display: none; color: #fff; }
.fs-item.is-active .fs-check svg { display: block; }
.fs-radio .fs-check { border-radius: 50%; }
.fs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-count { font-size: 11px; color: #A39E92; font-variant-numeric: tabular-nums; }
.fs-item.is-active .fs-count { color: #DC2626; font-weight: 600; }
.fhead { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 10px 0 16px; border-bottom: 1px solid #EDE9DF; flex-shrink: 0; }
.fhead-title { font-size: 13px; font-weight: 600; color: #1A1816; }
.fbtn { width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #8A8579; background: transparent; border: 0; cursor: pointer; transition: background .12s, color .12s; }
.fbtn:hover { background: #F0EDE4; color: #1A1816; }
.ffoot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid #EDE9DF; background: #FBFAF6; font-size: 12px; color: #7A766F; position: sticky; bottom: 0; }
.ffoot b { color: #1A1816; font-weight: 600; font-variant-numeric: tabular-nums; }
.ffoot-clear { margin-left: auto; border: 0; background: transparent; cursor: pointer; font-size: 11.5px; font-weight: 600; color: #DC2626; padding: 4px 8px; border-radius: 6px; }
.ffoot-clear:hover { background: rgba(220,38,38,0.07); }
.filter-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #DC2626; color: #fff; font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Pagination buttons (from HR OS) ---- */
.flist-page-btn { min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 12.5px; color: #3A3833; border: 1px solid transparent; cursor: pointer; user-select: none; background: transparent; }
.flist-page-btn:hover:not([disabled]) { background: #F4F1EA; }
.flist-page-btn.is-current { background: #1A1816; color: #fff; }
.flist-page-btn[disabled] { color: #C5C0B6; cursor: not-allowed; }

/* ---- Facet date inputs ---- */
.fdate { width: 100%; height: 32px; padding: 0 9px; border: 1px solid #E2DDD2; border-radius: 7px; background: #fff; color: #1A1816; font-size: 12px; outline: none; }
.fdate:focus { border-color: #1A1816; box-shadow: 0 0 0 3px rgba(28,24,18,0.05); }

/* ============================================================
   Work-type proportional hierarchy (Work Types tab)
   L1 > L2 > L3 expandable rows; each bar's width encodes volume
   relative to the largest sibling at its level.
   ============================================================ */
.wt-tree { display: flex; flex-direction: column; gap: 14px; }
.wt-row { display: flex; align-items: center; gap: 12px; border-radius: 8px; text-decoration: none; }
.wt-l1 { padding: 8px 12px; cursor: pointer; user-select: none; }
.wt-l2 { padding: 5px 12px; border-radius: 6px; }
.wt-l2.has-l3 { cursor: pointer; }
.wt-l2.has-l3:hover { background: #F4F1EA; }
.wt-l3 { padding: 3px 12px; border-radius: 6px; cursor: pointer; }
.wt-l3:hover { background: #F4F1EA; }

.wt-chev { flex-shrink: 0; width: 14px; height: 14px; color: #B5B0A4; display: inline-flex; align-items: center; justify-content: center; transition: transform .18s ease; }
.wt-chev svg { width: 14px; height: 14px; }
.wt-chev.is-collapsed { transform: rotate(-90deg); }
.wt-chev.is-hidden { visibility: hidden; }

.wt-label { flex-shrink: 0; width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-l1 .wt-label { font-size: 13px; font-weight: 600; }
.wt-l2 .wt-label { font-size: 12px; color: #57534E; }
.wt-l3 .wt-label { font-size: 11px; color: #7A766F; width: 11rem; }

.wt-track { flex: 1; min-width: 40px; position: relative; border-radius: 999px; overflow: hidden; }
.wt-l1 .wt-track { height: 20px; }
.wt-l2 .wt-track { height: 14px; background: #F4F1EA; }
.wt-l3 .wt-track { height: 10px; background: #F4F1EA; }
.wt-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; transition: width .4s ease; }

.wt-cnt { flex-shrink: 0; width: 4rem; text-align: right; font-variant-numeric: tabular-nums; text-decoration: none; }
.wt-l1 .wt-cnt { font-size: 13px; font-weight: 700; }
.wt-l2 .wt-cnt { font-size: 12px; color: #9A968F; }
.wt-l3 .wt-cnt { font-size: 11px; color: #9A968F; }
a.wt-cnt:hover { text-decoration: underline; }

.wt-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 999px; margin-left: 2px; }

/* Two dim stat mini-columns (automated %, median reply) — md+ only */
.wt-stats { flex-shrink: 0; display: none; gap: 8px; }
@media (min-width: 768px) { .wt-stats { display: flex; } }
.wt-stat { width: 4.25rem; text-align: right; font-size: 10.5px; color: #9A968F; font-variant-numeric: tabular-nums; }

.wt-l2-wrap { margin-top: 6px; margin-left: 1rem; display: flex; flex-direction: column; gap: 2px; }
.wt-l3-wrap { margin-top: 2px; margin-left: 1.25rem; display: flex; flex-direction: column; gap: 1px; }

@media (max-width: 640px) {
  .wt-row { gap: 8px; }
  .wt-label { width: 7.5rem; }
  .wt-l3 .wt-label { width: 6.5rem; }
  .wt-cnt { width: 3.25rem; }
  .wt-l1, .wt-l2, .wt-l3 { padding-left: 8px; padding-right: 8px; }
}
