/* 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; position: relative; }
/* 44px touch halo on the two remaining 28px icon buttons (integrated gate
   2026-08-01) — same ::before idiom as .switch; visual size unchanged. */
@media (max-width: 640px) {
  .modal-x::before, .fbtn::before { content: ""; position: absolute; inset: -8px; }
}
.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; }
/* Disabled segments must READ disabled — same affordance as .switch:disabled,
   and no hover reaction (a segment you can't pick shouldn't light up). */
.seg-btn:disabled { opacity: .45; cursor: not-allowed; }
.seg-btn:disabled:hover { background: #fff; }
.seg-btn.is-active:disabled:hover { background: #1A1816; }

/* ---- 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); }
.switch:disabled { opacity: .5; cursor: default; }

/* ---- 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; scroll-behavior: smooth; }
.tabs::-webkit-scrollbar { display: none; }
/* The scrollbar is hidden (deliberately — it is a chrome-less strip), so below
   the width where eight tabs stop fitting there is nothing to say the row
   continues. A right-edge fade is that affordance. It is a MASK, not an opaque
   overlay: the page canvas carries a dot-grid texture that a solid gradient
   would blank out. Desktop is untouched — the tabs fit, so no fade. The
   companion behaviour is activate()'s scrollIntoView(inline:"center"), which
   keeps the active tab out from under the fade. */
@media (max-width: 900px) {
  .tabs { -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%); }
}
.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; position: relative; }
.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; }

/* Labels are always fully visible (owner request 2026-07-31): wider column,
   and long names WRAP instead of ellipsising away. */
.wt-label { flex-shrink: 0; width: 18rem; white-space: normal; overflow-wrap: break-word; line-height: 1.25; }
.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: 17rem; }

.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; }

/* Dim stat mini-columns (automated %, median reply, sent). 900px, not 768:
   at exactly 768 the sidebar leaves the card at its narrowest and the three
   stat columns overflowed it by 15px (final-QA 2026-08-01). */
.wt-stats { flex-shrink: 0; display: none; gap: 8px; }
@media (min-width: 900px) { .wt-stats { display: flex; } }
.wt-stat { width: 4.25rem; text-align: right; font-size: 10.5px; color: #9A968F; font-variant-numeric: tabular-nums; }
/* Addendum 3 — "work done" sent column, dimmer + a touch wider for the label. */
.wt-stat-sent { width: 5rem; color: #B5B0A4; }

.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: 8.5rem; }
  .wt-l3 .wt-label { width: 7.5rem; }
  .wt-cnt { width: 3.25rem; }
  .wt-l1, .wt-l2, .wt-l3 { padding-left: 8px; padding-right: 8px; }
}

/* ---- Shared category picker (Addendum 2) ---- */
.catpick-overlay { position: fixed; inset: 0; z-index: 120; }
.catpick { position: fixed; display: flex; flex-direction: column; max-height: min(440px, 82vh); padding: 0; overflow: hidden; }
.catpick-head { padding: 10px 10px 9px; border-bottom: 1px solid #EDEAE3; flex-shrink: 0; }
.catpick-title { font-size: 12.5px; font-weight: 600; color: #1A1816; }
.catpick-scope { font-size: 11px; color: #7A766F; margin-top: 2px; line-height: 1.45; }
.catpick-search { height: 32px; margin-top: 9px; font-size: 12.5px; }
.catpick-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; min-height: 0; }
.catpick-list::-webkit-scrollbar { width: 8px; }
.catpick-list::-webkit-scrollbar-thumb { background: #E5E0D5; border-radius: 4px; border: 2px solid #fff; }
.catpick-l1 { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #9A968F; padding: 8px 8px 2px; }
.catpick-l2 { font-size: 10.5px; font-weight: 600; color: #7A766F; padding: 3px 8px 2px 14px; }
.catpick-item { justify-content: space-between; padding-left: 20px; }
.catpick-item.is-selected, .catpick-item.is-selected:hover { background: #FBE9E9; color: #B91C1C; }
.catpick-l3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catpick-current { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #0F7A3C; background: #E7F3EC; border-radius: 4px; padding: 1px 5px; flex-shrink: 0; margin-left: 8px; }
.catpick-empty { padding: 18px; text-align: center; font-size: 12px; color: #9A968F; }
.catpick-foot { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-top: 1px solid #EDEAE3; background: #FBFAF6; flex-shrink: 0; }
.catpick-sel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #7A766F; }
.catpick-confirm { height: 30px; padding: 0 12px; font-size: 12px; flex-shrink: 0; }

/* ---- New Analysis: mailbox address + Browse button row ---- */
.mbx-input-row { display: flex; gap: 8px; align-items: stretch; }
.mbx-input-row .input { flex: 1 1 auto; min-width: 0; }
.mbx-browse-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mbx-browse-btn svg { color: #7A766F; }

/* ---- New Analysis: mailbox-discovery picker (modal sub-view) ---- */
.mbxpick-list { margin-top: 12px; max-height: min(340px, 52vh); overflow-y: auto; border: 1px solid #ECE7DC; border-radius: 9px; padding: 5px; }
.mbxpick-list::-webkit-scrollbar { width: 8px; }
.mbxpick-list::-webkit-scrollbar-thumb { background: #E5E0D5; border-radius: 4px; border: 2px solid #fff; }
.mbxpick-row {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px 10px; border-radius: 7px; background: transparent; border: 0; cursor: pointer;
}
.mbxpick-row:hover { background: #F6F3EC; }
.mbxpick-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.mbxpick-name { font-size: 13px; font-weight: 600; color: #1A1816; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbxpick-addr { font-size: 11.5px; color: #7A766F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbxpick-row.is-disabled .mbxpick-name { color: #8A857A; }
.mbxpick-row.is-disabled .mbxpick-addr { color: #A8A399; }
.mbxpick-tag {
  flex-shrink: 0; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #8A857A; background: #F1EEE7; border-radius: 4px; padding: 2px 6px;
}
.mbxpick-msg { padding: 22px 12px; text-align: center; font-size: 12.5px; color: #9A968F; line-height: 1.5; }
.mbxpick-msg.is-error { color: #A02323; }
.mbxpick-fix { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: #B91C1C; text-decoration: none; }
.mbxpick-fix:hover { text-decoration: underline; }
/* Loading skeleton rows */
.mbxpick-skel { display: flex; flex-direction: column; gap: 5px; padding: 9px 10px; }
.mbxpick-skel-a { height: 11px; width: 45%; border-radius: 4px; background: #EEEAE1; }
.mbxpick-skel-b { height: 10px; width: 65%; border-radius: 4px; background: #F2EFE8; }
.mbxpick-skel { animation: mbxpick-pulse 1.2s ease-in-out infinite; }
@keyframes mbxpick-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---- Taxonomy per-L3 cluster affordance (Addendum 2) ---- */
.tx-l3-item { display: flex; flex-direction: column; gap: 6px; }
.tx-l3-item.is-open { flex-basis: 100%; width: 100%; }
.tx-chip.tx-chip-btn { cursor: pointer; }
.tx-chip.tx-chip-btn:hover { background: #F1ECE1; }
.tx-chip.tx-chip-btn.is-open { background: #EFE9FB; border-color: #E0D5F5; color: #4338CA; }
.tx-chip-caret { color: #B5B0A4; transition: transform .16s; flex-shrink: 0; }
.tx-chip.is-open .tx-chip-caret { transform: rotate(180deg); color: #7C3AED; }
.tx-clusters { width: 100%; margin-top: 2px; padding: 8px; background: #FBFAF6; border: 1px solid #EFEBE1; border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.cl-chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fff; border: 1px solid #ECE7DC; border-radius: 7px; }
.cl-count { font-size: 10.5px; font-weight: 600; color: #7A766F; background: #F4F1EA; border-radius: 5px; padding: 1px 6px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cl-sample { flex: 1; min-width: 0; font-size: 11.5px; color: #3A3833; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-move { flex-shrink: 0; height: 24px; padding: 0 9px; font-size: 11px; }

/* ---- Taxonomy edit mode (Addendum 4): rename / move / merge ---- */
.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-xs { padding: 3px 9px; font-size: 11px; border-radius: 5px; }
.btn-disabled { opacity: 0.5; pointer-events: none; }

/* Per-row kebab (only visible in edit mode). Sits at the row end, after the
   stat columns, so proportional bars/tracks are never disturbed. */
.wt-kebab-wrap { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; }
.wt-kebab {
  width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #9A968F; cursor: pointer; border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.wt-kebab:hover { background: #F1ECE1; color: #3A3833; }
.wt-kebab svg { width: 15px; height: 15px; }

/* Anchored menu / rename popover, reuses .pop / .pop-item visuals. */
.wt-menu { position: absolute; right: 0; top: 100%; margin-top: 5px; z-index: 45; min-width: 158px; }
.wt-menu-items { display: flex; flex-direction: column; }
.wt-menu .pop-item svg { width: 14px; height: 14px; color: #9A968F; flex-shrink: 0; }
.wt-menu .pop-item.is-danger { color: #B91C1C; }
.wt-menu .pop-item.is-danger svg { color: #DC2626; }
.wt-rename-panel { display: flex; flex-direction: column; gap: 8px; padding: 4px; width: 224px; }
.wt-rename-panel .input { height: 32px; font-size: 12.5px; }
.wt-rename-hint { font-size: 11px; color: #7A766F; line-height: 1.4; }
.wt-rename-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* Centered modal shell for the move picker + merge confirmation. */
.wt-modal-overlay { position: fixed; inset: 0; z-index: 130; background: rgba(26,24,22,0.28); display: flex; align-items: center; justify-content: center; padding: 16px; }
.wt-move-panel { display: flex; flex-direction: column; width: 340px; max-width: calc(100vw - 32px); max-height: min(460px, 82vh); padding: 0; overflow: hidden; }
.wt-move-panel .catpick-list { padding: 6px; }
.wt-confirm { width: 340px; max-width: calc(100vw - 32px); padding: 18px; }
.wt-confirm-msg { font-size: 13px; color: #1A1816; line-height: 1.55; }
.wt-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---- Taxonomy edit-at-the-gate (Addendum 4 ported to the approval gate) ----
   Reuses .wt-kebab / .wt-menu / .wt-rename-panel / .wt-move-panel / .wt-confirm.
   These rules only re-home the affordances inside the taxonomy L1 cards. */
.tx-card.is-editable { overflow: visible; }               /* let anchored menus escape the card */
.tx-card.is-editable .tx-head { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.tx-head .wt-kebab-wrap { margin-left: 6px; }
.tx-l2-name .wt-kebab-wrap { margin-left: auto; }
.tx-l3-head { display: inline-flex; align-items: center; gap: 2px; }
.tx-l3-head .wt-kebab { width: 22px; height: 22px; }
.tx-l3-head .wt-kebab svg { width: 13px; height: 13px; }
/* Guidance line under the Approve/Reject card while a draft is at the gate. */
.tx-guidance { display: flex; align-items: flex-start; gap: 8px; margin-top: 11px; padding: 9px 11px; background: #FBFAF6; border: 1px solid #EFEBE1; border-radius: 8px; font-size: 12px; color: #6A665E; line-height: 1.5; }
.tx-guidance svg { width: 15px; height: 15px; color: #B5B0A4; flex-shrink: 0; margin-top: 1px; }
/* Sticky repeat of Approve/Reject so they stay reachable on a long/mobile tree. */
.tx-approve-bar { position: sticky; bottom: 12px; z-index: 40; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding: 11px 14px; background: rgba(255,255,255,0.94); backdrop-filter: blur(6px); border: 1px solid #E8E3D9; border-radius: 12px; box-shadow: 0 6px 20px rgba(28,24,18,0.10); }
.tx-approve-bar-text { flex: 1; min-width: 160px; font-size: 12px; color: #7A766F; line-height: 1.45; }
.tx-approve-bar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ============================================================
   Addendum 5 — Operational metrics batch
   ============================================================ */

/* ---- Global period control (mailbox header, all tabs) ---- */
.period-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 9px 12px; background: #fff; border: 1px solid #E8E3D9; border-radius: 10px; box-shadow: 0 1px 2px rgba(28,24,18,0.04); }
.period-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: #9A968F; display: inline-flex; align-items: center; gap: 6px; }
.period-label svg { width: 14px; height: 14px; color: #B5B0A4; }
.period-custom { display: inline-flex; align-items: center; gap: 6px; }
.period-custom .fdate { width: 148px; height: 32px; }
.period-dash { color: #B5B0A4; }
.period-summary { font-size: 11.5px; color: #7A766F; margin-left: auto; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .period-custom { width: 100%; }
  .period-custom .fdate { flex: 1 1 0; width: auto; min-width: 0; }
  .period-summary { margin-left: 0; width: 100%; }
}

/* ---- KPI card as a link + accent state (awaiting reply > 0) ---- */
a.stat { text-decoration: none; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.stat:hover { border-color: #DDD8CE; box-shadow: 0 6px 18px -8px rgba(28,24,18,0.16); transform: translateY(-1px); }
.stat.is-accent { border-color: #F1C7C7; background: linear-gradient(135deg, #FEF4F4 0%, #FFF 60%); }
.stat.is-accent .stat-value { color: #B91C1C; }
.stat.is-accent .stat-label { color: #C05252; }

/* ---- Hour x weekday heatmap (Performance) ---- */
.heatmap-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.heatmap-scroll::-webkit-scrollbar { height: 8px; }
.heatmap-scroll::-webkit-scrollbar-thumb { background: #E0DBD0; border-radius: 4px; border: 2px solid #fff; }
.heatmap-table { border-collapse: separate; border-spacing: 2px; }
.heatmap-table th { font-size: 9.5px; font-weight: 600; color: #9A968F; font-variant-numeric: tabular-nums; padding: 0 0 3px; text-align: center; }
/* Phone widths: 24 hour ticks merge into one digit run — keep every 3rd
   (0/3/6/…/21). nth-child(3n) because the row is [corner, template-anchor,
   th0..th23]: Alpine's <template> stays in the DOM, so hour h is child h+3
   (integrated gate 2026-08-01). Layout preserved via transparent ink. */
@media (max-width: 640px) {
  .heatmap-table thead th { color: transparent; }
  .heatmap-table thead th:nth-child(3n) { color: #9A968F; }
}
/* The l1 variant spends 88px on its sticky label column, so its 24 ticks are
   still merged at 641-700px — carry the thinning further for it alone. */
@media (max-width: 700px) {
  .heatmap-table[data-fluid="l1"] thead th { color: transparent; }
  .heatmap-table[data-fluid="l1"] thead th:nth-child(3n) { color: #9A968F; }
}
.heatmap-table th.hm-corner, .heatmap-table td.hm-daylabel { position: sticky; left: 0; z-index: 1; background: #fff; }
.heatmap-table td.hm-daylabel { font-size: 10.5px; font-weight: 600; color: #7A766F; text-align: right; padding-right: 7px; white-space: nowrap; }
.hm-cell { width: 20px; height: 20px; min-width: 20px; border-radius: 3px; display: block; text-decoration: none; transition: outline .1s; outline: 1px solid transparent; }
.hm-cell:hover { outline: 1.5px solid #1A1816; }

/* ---- FLUID heatmaps (mobile + FHD audit, 2026-08) ----
   A 20px cell made every day x hour grid a 560px island in a 1600px card at
   FHD ("the calendars only use a third of the space"). Opt IN per table with
   data-fluid, because portfolio.html shares .heatmap-table / .hm-cell and owns
   its own cell box (.pf-hm-cell): an unscoped width:100% would relayout that
   page too. data-fluid also carries WHICH label column the table has, since
   table-layout:fixed takes every column width from the first row and the two
   shapes need very different first columns (a weekday abbreviation vs a
   work-type name).
     - width:100% + table-layout:fixed  => the 24 hour columns split the card.
     - .hm-cell width:auto + aspect-ratio => the cell fills its column, square.
     - max-width caps the cell so 3440 doesn't paint 120px blocks; the cell then
       CENTRES in its column (margin-inline:auto) so it stays under its own
       <th> hour number — without that the capped cell hugs the left edge and
       the header drifts off the body by half a column.
     - the table max-width is the width at which a column reaches the cell cap,
       so past it the grid stops growing instead of spreading into gaps.
   The working-hours outline (mos.js .hm-cell.is-wh.wh-*) is per-cell and
   inset-anchored, so it scales with the cell at every size. */
.heatmap-table[data-fluid] { width: 100%; table-layout: fixed; }
.heatmap-table[data-fluid] .hm-cell { width: auto; height: auto; min-width: 14px; max-width: 44px; aspect-ratio: 1; margin-inline: auto; }
.heatmap-table[data-fluid="day"] { max-width: 1180px; }
.heatmap-table[data-fluid="day"] th.hm-corner { width: 36px; }
.heatmap-table[data-fluid="l1"] { max-width: 1340px; }
.heatmap-table[data-fluid="l1"] th.hm-corner { width: 190px; }
/* Phone: 24 columns of 20px + 2px border-spacing needed ~570px and scrolled on
   every phone. 11px cells fit a 640px viewport outright; below 430px the cells
   AND the spacing shrink once more so the grid still lands inside the card. */
@media (max-width: 640px) {
  .heatmap-table[data-fluid] .hm-cell { min-width: 9px; max-width: 11px; }
  .heatmap-table[data-fluid="day"] th.hm-corner { width: 32px; }
  .heatmap-table[data-fluid="l1"] th.hm-corner { width: 88px; }
}
@media (max-width: 430px) {
  .heatmap-table[data-fluid] { border-spacing: 1px; }
  .heatmap-table[data-fluid] .hm-cell { min-width: 8px; max-width: 9px; }
  .heatmap-table[data-fluid="l1"] th.hm-corner { width: 70px; }
}
.heatmap-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: #9A968F; }
.heatmap-legend .hm-ramp { display: inline-flex; gap: 2px; }
.heatmap-legend .hm-ramp span { width: 14px; height: 12px; border-radius: 2px; }

/* ---- Signal tier KPI cards + tier composition bars ---- */
.tier-card { display: block; text-decoration: none; }
.tiers-l1-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.tiers-l1-label { width: 168px; flex-shrink: 0; font-size: 12.5px; color: #3A3833; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiers-l1-track { flex: 1; min-width: 60px; height: 14px; border-radius: 4px; overflow: hidden; display: flex; background: #F1EEE7; }
.tiers-seg { height: 100%; transition: width .4s ease; }
.tiers-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.tiers-legend .tl-key { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #3A3833; }
.tiers-legend .tl-sw { width: 10px; height: 10px; border-radius: 2px; }
/* Phone: a 108px nowrap track truncated 7 of the 10 work types to one word,
   which makes the tier mix unreadable. Wrap to at most TWO lines instead —
   .tiers-l1-row is align-items:center, so a taller label still centres against
   its track and the row rhythm survives. */
@media (max-width: 640px) { .tiers-l1-label { width: 130px; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.28; } }

/* ---- People: participant bars + split proportion bar ---- */
.split-bar { display: flex; height: 16px; border-radius: 5px; overflow: hidden; background: #F1EEE7; }
.split-seg { height: 100%; transition: width .4s ease; }
.split-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.split-legend .sl-key { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #3A3833; }
.split-legend .sl-sw { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.ppl-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; text-decoration: none; border-bottom: 1px solid #F4F1EA; }
.ppl-row:last-child { border-bottom: 0; }
.ppl-row:hover { background: #FCFBF7; }
.ppl-name { min-width: 0; flex: 1; }
/* display:BLOCK is load-bearing, not cosmetic — the SAME bug the Sent tab's
   .rt-primary/.rt-sub hit (mos.js §8.4.1). These are grandchildren of the flex
   .ppl-row, so they are NOT flex items: left as the default inline they hug
   their own text, the nowrap/overflow/ellipsis trio never fires, and a long
   subject or address chops raw and pushes the ledger past the viewport
   (body-level h-scroll on Volumes / Sent / People). Blocks fill the
   min-width:0 parent, so the ellipsis engages and the sub stacks under the
   primary the way every one of these ledgers assumes. */
.ppl-name .pn-primary { display: block; font-size: 12.5px; color: #1A1816; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-name .pn-sub { display: block; font-size: 11px; color: #9A968F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-track { flex: 0 0 90px; height: 8px; border-radius: 999px; background: #F1EEE7; overflow: hidden; }
.ppl-fill { height: 100%; border-radius: 999px; }
.ppl-val { flex: 0 0 auto; text-align: right; font-size: 12px; color: #3A3833; font-variant-numeric: tabular-nums; min-width: 40px; }
.ppl-tag { font-size: 9.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }
.ppl-tag.is-internal { background: #EDEBE6; color: #57534E; }
.ppl-tag.is-external { background: #FBE9E9; color: #B91C1C; }
@media (max-width: 640px) { .ppl-track { flex-basis: 52px; } }

/* ---- Conversations: active-filter chips ---- */
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; background: #F4F1EA; border: 1px solid #E4DFD4; font-size: 11.5px; color: #3A3833; }
.fchip b { font-weight: 600; color: #1A1816; }
.fchip-x { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #8A8579; cursor: pointer; border: 0; background: transparent; flex-shrink: 0; }
.fchip-x:hover { background: #E4DFD4; color: #1A1816; }
.fchip-x svg { width: 10px; height: 10px; }
.fchip-clear { border: 0; background: transparent; color: #DC2626; font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 3px 8px; border-radius: 999px; }
.fchip-clear:hover { background: rgba(220,38,38,0.07); }

/* ---- Thread reader: visual timeline ---- */
.thread-timeline { position: relative; margin: 4px 0 18px; padding: 22px 8px 6px; }
.tl-track { position: relative; height: 2px; background: #EDEAE3; border-radius: 999px; }
.tl-msg-dot { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 0 0 1px #E0DBD0; cursor: pointer; padding: 0; transition: transform .12s; }
.tl-msg-dot:hover { transform: translate(-50%, -50%) scale(1.28); z-index: 3; }
.tl-msg-dot.is-outbound { background: #DC2626; box-shadow: 0 0 0 1px #DC2626; }
.tl-msg-dot.is-inbound { background: #7A766F; box-shadow: 0 0 0 1px #7A766F; }
.tl-msg-dot.is-first { width: 15px; height: 15px; z-index: 2; }
.tl-gap { position: absolute; top: -2px; transform: translateX(-50%); font-size: 9.5px; font-weight: 600; color: #B0ABA1; background: #fff; padding: 0 4px; white-space: nowrap; }
.tl-gap::after { content: ""; position: absolute; left: 50%; top: 15px; width: 1px; height: 8px; background: #E0DBD0; }
.thread-tl-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 10.5px; color: #9A968F; }
.thread-tl-legend .ttl-key { display: inline-flex; align-items: center; gap: 5px; }
.thread-tl-legend .ttl-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---- Thread message extras (folder / attachment / importance / unread) ---- */
.msg-flags { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; flex-shrink: 0; }
.msg-folder { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; color: #7A766F; background: #F1EEE7; border-radius: 4px; padding: 1px 5px; }
.msg-folder svg { width: 10px; height: 10px; }
.msg-clip { color: #9A968F; display: inline-flex; }
.msg-clip svg { width: 13px; height: 13px; }
.msg-flag { color: #DC2626; display: inline-flex; }
.msg-flag svg { width: 12px; height: 12px; }
.msg-flag.is-low { color: #B0ABA1; }
.msg-unread { width: 8px; height: 8px; border-radius: 50%; background: #1D6FB8; flex-shrink: 0; box-shadow: 0 0 0 2px #E3EEF7; }
.msg.is-unread { border-color: #CFE0F0; }
.msg-scroll-flash { animation: msg-flash 1.1s ease; }
@keyframes msg-flash { 0%, 40% { box-shadow: 0 0 0 2px rgba(220,38,38,0.45); } 100% { box-shadow: 0 0 0 2px rgba(220,38,38,0); } }

/* ---- Overview summary dashboard (additions) ---- */
/* Bug fix: .hbar-fill / .ppl-fill are inline spans by default, so width/height
   are ignored and the proportional coloured fill collapses to 0x0 (only the grey
   track shows). Blockify them so the fill paints, matching the .wt-fill idiom. */
.hbar-fill { display: block; }
.ppl-fill { display: block; }

/* "View details ->" card-header links */
.card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: #B91C1C; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.card-link:hover { text-decoration: underline; }
.card-link svg { width: 13px; height: 13px; }

/* Compact tier-composition rows (Overview summary reuse of the Signal markup) */
.tiers-compact .tiers-l1-row { padding: 3px 0; gap: 9px; }
.tiers-compact .tiers-l1-label { width: 132px; font-size: 12px; }
.tiers-compact .tiers-l1-track { height: 11px; }
@media (max-width: 640px) { .tiers-compact .tiers-l1-label { width: 130px; font-size: 11.5px; } }

/* Overview tier mini-boxes (clickable) */
.ov-tier { display: block; text-decoration: none; transition: border-color .12s, background .12s; }
.ov-tier:hover { border-color: #D8D2C6; background: #fff; }
.ov-tier .mini-label { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   Addendum 6 — Deletion (runs + mailboxes)
   ============================================================ */

/* Per-row / per-card overflow (kebab) affordance + anchored menu.
   Reuses the .pop / .pop-item popover visuals. */
.kebab-wrap { position: relative; display: inline-flex; align-items: center; }
.kebab-btn {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #9A968F; cursor: pointer; border: 1px solid transparent; background: transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.kebab-btn:hover { background: #F1ECE1; color: #3A3833; }
.kebab-btn svg { width: 16px; height: 16px; }
.kebab-menu { position: absolute; right: 0; top: 100%; margin-top: 5px; z-index: 45; min-width: 170px; }
.kebab-menu .pop-item svg { width: 15px; height: 15px; color: #9A968F; flex-shrink: 0; }
.pop-item.is-danger { color: #B91C1C; }
.pop-item.is-danger:hover { background: #FBE9E9; }
.pop-item.is-danger svg { color: #DC2626; }

/* Mailbox-card kebab sits at the card's top-right without disturbing the link. */
.mbx-card { position: relative; }
.mbx-kebab { flex-shrink: 0; }
.mbx-kebab .kebab-menu { min-width: 176px; }

/* Danger-confirmation modal callout + inline error (reuses .modal-* shell). */
.del-warn { display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px; border-radius: 10px; background: #FBFAF7; border: 1px solid #EDEAE3; }
.del-warn.is-danger { background: #FFF6F3; border-color: #F0D2C8; }
.del-warn-icon { flex-shrink: 0; color: #8A857A; margin-top: 1px; }
.del-warn.is-danger .del-warn-icon { color: #A02323; }
.del-warn-title { font-size: 13px; font-weight: 600; color: #1A1816; }
.del-warn-text { font-size: 12.5px; color: #57534E; line-height: 1.5; margin-top: 3px; }
.del-warn-text b { color: #1A1816; font-weight: 600; }
.del-confirm-label { font-size: 12px; color: #57534E; margin: 16px 0 7px; line-height: 1.5; }
.del-confirm-label b { color: #1A1816; font-weight: 600; word-break: break-all; }
.del-error { font-size: 12px; color: #A02323; margin-top: 12px; background: #FFF6F3; border: 1px solid #F0D2C8; border-radius: 8px; padding: 9px 11px; line-height: 1.45; }

/* Mobile: modal action buttons meet the 44px touch target (375px-safe). */
@media (max-width: 767px) {
  .modal-foot .btn { min-height: 44px; }
  .modal-foot { flex-wrap: wrap; }
}

/* ============================================================
   Taxonomy drag-and-drop editing (desktop >=1024px, draft only)
   Pointer-event engine — not native HTML5 DnD. See setupTaxonomyDnd().
   Grips/highlights/clone are additive: the kebab menus remain the
   universal (and only mobile / a11y) editing path.
   ============================================================ */

/* Drag grip — six-dot handle, absolutely positioned at the row start so flex
   gap never reserves space for it. Revealed (and made interactive) on row hover
   in draft mode; the row makes room via an animated padding-left. */
.tx-l3-head, .tx-l2-name, .cl-chip { position: relative; transition: padding-left .12s ease; }
.tx-grip {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 15px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  color: #C0BBB0; cursor: grab; opacity: 0; pointer-events: none;
  transition: opacity .12s ease; touch-action: none; -webkit-user-select: none; user-select: none;
}
.tx-grip svg { width: 13px; height: 13px; }
.cl-chip > .tx-grip { left: 6px; }
.tx-l3-head:hover { padding-left: 16px; }
.tx-l2-name:hover { padding-left: 16px; }
.cl-chip:hover { padding-left: 23px; }
.tx-l3-head:hover > .tx-grip,
.tx-l2-name:hover > .tx-grip,
.cl-chip:hover > .tx-grip { opacity: 1; pointer-events: auto; }
.tx-grip:hover { color: #8A857A; }
.tx-grip:active { cursor: grabbing; }
/* Below the desktop breakpoint: no grips at all — mobile keeps kebabs only. */
@media (max-width: 1023px) {
  .tx-grip { display: none !important; }
  .tx-l3-head:hover, .tx-l2-name:hover, .cl-chip:hover { padding-left: initial; }
}

/* Force the grabbing cursor everywhere while a drag is in flight. */
body.tx-dragging, body.tx-dragging * { cursor: grabbing !important; }
body.tx-dragging { -webkit-user-select: none; user-select: none; }

/* Lifted clone that tracks the pointer (position:fixed + transform only). */
.tx-drag-clone {
  position: fixed; top: 0; left: 0; z-index: 200; margin: 0; pointer-events: none;
  will-change: transform; opacity: 0.97; background: #fff; border-radius: 9px; padding: 4px 6px;
  box-shadow: 0 16px 38px -10px rgba(28,24,18,0.45), 0 0 0 1px rgba(28,24,18,0.07);
}
.tx-drag-clone .tx-chip { background: #fff; }
/* Original dims to 40% while its clone is airborne. */
.tx-drag-source { opacity: 0.4 !important; }

/* Live drop-target affordances. */
.tx-drop-move   { outline: 2px solid #DC2626; outline-offset: -2px; background: rgba(220,38,38,0.06) !important; border-radius: 8px; }
.tx-drop-merge  { outline: 2px dashed #DC2626; outline-offset: -2px; background: rgba(220,38,38,0.05) !important; border-radius: 8px; }
/* Current parent — shown, but inert (cannot drop onto where it already lives). */
.tx-drop-current { outline: 1.5px dashed #C9C4B9; outline-offset: -2px; opacity: 0.65; border-radius: 8px; }

/* Floating "merge into …" hint chip that trails the pointer. */
.tx-hint-chip {
  position: fixed; top: 0; left: 0; z-index: 210; pointer-events: none; will-change: transform;
  background: #B91C1C; color: #fff; font-size: 11px; font-weight: 600; line-height: 1;
  padding: 5px 8px; border-radius: 6px; box-shadow: 0 6px 18px rgba(28,24,18,0.28);
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}

/* Post-drop flash — a ~1s background/ring pulse on the node's new location. */
@keyframes tx-flash-pulse {
  0%   { box-shadow: 0 0 0 3px rgba(220,38,38,0.0); background: rgba(220,38,38,0.18); }
  18%  { box-shadow: 0 0 0 3px rgba(220,38,38,0.55); }
  100% { box-shadow: 0 0 0 3px rgba(220,38,38,0.0); background: transparent; }
}
.tx-flash { animation: tx-flash-pulse 1s ease; border-radius: 8px; }

/* Desktop-only DnD tip line, sits under the guidance text. */
.tx-tip-dnd { display: none; }
.tx-tip-dnd .tx-tip-grip { width: 12px; height: 12px; vertical-align: -2px; color: #B5B0A4; }
@media (min-width: 1024px) {
  .tx-tip-dnd { display: block; margin-top: 6px; color: #8A857A; font-weight: 500; }
}

/* ============================================================
   Phone ergonomics (app-wide, <=640px only — desktop is untouched)
   ============================================================ */
@media (max-width: 640px) {
  /* iOS Safari auto-zooms the whole page when a focused form control's
     font-size is below 16px, and never zooms back out. Every text control
     therefore renders at 16px on a phone. (.ppl-select is Settings' compact
     People select — named here because it is the one control that opts BELOW
     the .input baseline; the page also re-states it so source order can't
     defeat this rule.) */
  .input, .ppl-select { font-size: 16px; }

  /* The 38x22 switch is far under the 44px minimum touch target. Keep the
     VISUAL pill byte-identical and expand only the hit area with a
     transparent, centred ::before — the knob is ::after, painted after it,
     so the thumb still renders on top. */
  .switch::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 44px; height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
  }

  /* Segmented controls and inline text buttons get a real finger target. */
  .seg-btn { min-height: 38px; }
  .btn-link { padding-top: 5px; padding-bottom: 5px; }
}
