/* ============================================================
   inbox.css · Halcyon candidate-branch demo · Lane C (Inbox).

   Styles the inbox control surface and its two results (the rolling summary +
   the consolidated draft). Three columns on desktop:
     sources + filters  |  unified message list  |  summary + draft
   (240px | minmax(0,1fr) | 360px). Single column on mobile, the draft panel
   sitting last as a bottom sheet a person scrolls to after marking items read.

   All color comes from the shared Datum theme vars (--surface / --accent /
   --gold / --border / --text-dim), so the inbox inherits light + dark and the
   trust grammar (.km-agent-work / .km-agent-suggestion / .km-human-gate)
   already defined in halcyon.css drops straight in. Zero horizontal scroll at
   1280px and 375px: every column is min-width:0 and every long string wraps.

   Motion lives ONLY inside @media (prefers-reduced-motion: no-preference).
   Under reduce, every item is shown instantly, fully readable, no transition.
   ============================================================ */

/* visually-hidden live region: present for assistive tech, off-screen for
   sighted readers. Defined here (the shared CSS has no such class) so the
   mark-as-read / approve announcements never render as visible text. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- the 3-column grid ---- */
.inbox-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.inbox-grid > * { min-width: 0; }

/* each column is a calm panel that scrolls inside its own height on desktop */
.inbox-col {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 0;
}
.inbox-col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
}
.inbox-col-head h2 {
  font-size: 14px;
  margin: 0;
  letter-spacing: -0.01em;
}
.inbox-col-head .inbox-col-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* the middle (list) + right (summary/draft) columns stack their inner panels */
.inbox-center { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inbox-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ============================================================
   SOURCES + FILTERS column (.inbox-sources)
   ============================================================ */
.inbox-sources .inbox-meta-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 2px solid var(--border-accent);
  background: var(--accent-pale);
  border-radius: var(--radius-sm);
}

.inbox-source-list { display: flex; flex-direction: column; gap: 8px; }
.inbox-source {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  min-width: 0;
}
.inbox-source:hover { border-color: var(--border-accent); }
.inbox-source-box {
  flex: none;
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.inbox-source-ico {
  flex: none;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}
.inbox-source-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.inbox-source-name { font-size: 13px; font-weight: 600; color: var(--text); }
.inbox-source-detail {
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-source-count {
  flex: none;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.inbox-source-count.has-unread {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border-accent);
}

/* import + auto-consolidate controls */
.inbox-source-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.inbox-auto {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  background: var(--accent-pale);
  cursor: pointer;
}
.inbox-auto-box { flex: none; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.inbox-auto-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-auto-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.inbox-auto-beta {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 1px 6px;
}
.inbox-auto-detail { font-size: 11px; color: var(--text-dim); line-height: 1.4; }

/* domain filter chips */
.inbox-filters { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.inbox-filters-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.inbox-filter-list { display: flex; flex-direction: column; gap: 6px; }
.inbox-filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.inbox-filter-chip:hover { border-color: var(--border-accent); color: var(--text); }
.inbox-filter-chip.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border-accent);
}
.inbox-filter-ico { font-family: var(--mono); font-weight: 700; flex: none; }

/* ============================================================
   DOMAIN PILL — shared little tag used in the list, summary, and draft
   ============================================================ */
.inbox-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
}
.inbox-domain-ico {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 1px 5px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.inbox-domain-pill.domain-supply_chain { border-color: var(--border-accent); color: var(--accent); }
.inbox-domain-pill.domain-supply_chain .inbox-domain-ico { color: var(--accent); }
.inbox-domain-pill.domain-it_networking { border-color: var(--border); color: var(--text); }
.inbox-domain-pill.domain-finance { border-color: var(--gold); color: var(--gold); }
.inbox-domain-pill.domain-finance .inbox-domain-ico { color: var(--gold); }

/* ============================================================
   LIST column (.inbox-list)
   ============================================================ */
.inbox-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.inbox-list-subhead {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 6px 0 -2px;
}

/* a single message item */
.inbox-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.inbox-item:hover { border-color: var(--border-accent); box-shadow: var(--shadow-sm); }
.inbox-item:hover .inbox-item-subject { color: var(--accent); }
.inbox-item.is-read { opacity: 0.6; }
.inbox-item.in-group {
  background: var(--surface-3);
  border-style: dashed;
}

.inbox-item-dot {
  flex: none;
  width: 14px; height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  cursor: pointer;
  padding: 0;
  transition: none;
}
.inbox-item.is-read .inbox-item-dot {
  background: transparent;
  border-color: var(--border);
}
.inbox-item-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.inbox-item-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 auto; cursor: pointer; }
.inbox-item-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.inbox-item-src {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.inbox-item-time { font-family: var(--mono); font-size: 10.5px; color: var(--text-dimmer); flex: none; }
.inbox-item-subject { font-size: 14px; font-weight: 600; margin: 0; color: var(--text); line-height: 1.35; overflow-wrap: anywhere; }
.inbox-item-from { font-size: 11.5px; color: var(--accent); }
.inbox-item-preview { font-size: 12.5px; color: var(--text-dim); margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.inbox-item-trust { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.inbox-item-draft-btn { margin-top: 6px; align-self: flex-start; font-size: 12px; padding: 6px 12px; }

/* ---- consolidated group block ---- */
.inbox-group {
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  background: var(--surface-3);
  padding: 14px;
  min-width: 0;
}
.inbox-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; min-width: 0; }
.inbox-group-head-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.inbox-group-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.inbox-group-merge { flex: none; }
.inbox-group-sub { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin: 8px 0 10px; overflow-wrap: anywhere; }
.inbox-group-draft-btn { font-size: 12.5px; padding: 7px 14px; margin-bottom: 12px; }
.inbox-group-items { display: flex; flex-direction: column; gap: 8px; }

/* ============================================================
   SUMMARY result (.inbox-summary)
   ============================================================ */
.inbox-summary { border-top: 3px solid var(--accent); }
.inbox-summary-headline {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 12px;
}
.inbox-summary-domain { margin-bottom: 14px; }
.inbox-summary-domain:last-child { margin-bottom: 0; }
.inbox-summary-domain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}
.inbox-summary-domain-count { font-family: var(--mono); font-size: 11px; color: var(--text-dim); flex: none; }
.inbox-summary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.inbox-summary-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  min-width: 0;
}
.inbox-summary-line-badge { flex: none; }
.inbox-summary-line-text { min-width: 0; overflow-wrap: anywhere; }

/* ============================================================
   DRAFT result (.inbox-draft)
   ============================================================ */
.inbox-draft { border-top: 3px solid var(--gold); }
.inbox-draft-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.inbox-draft-labelrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.inbox-draft-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  flex: none;
}
.inbox-draft-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }

.inbox-draft-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.inbox-draft-kicker { font-size: 12.5px; font-weight: 600; color: var(--text); }

.inbox-draft-field {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.inbox-draft-field-label {
  flex: none;
  width: 64px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.inbox-draft-field-value { font-size: 13px; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

/* the merged-from transparency block (the error-reduction point) */
.inbox-draft-merged {
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  background: var(--accent-pale);
  padding: 12px;
  min-width: 0;
}
.inbox-draft-merged-head { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.inbox-draft-merged-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.inbox-draft-merged-list li { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text); min-width: 0; }
.inbox-draft-merged-id {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}
.inbox-draft-merged-list li span:last-child { min-width: 0; overflow-wrap: anywhere; }
.inbox-draft-merged-note { font-size: 11px; color: var(--text-dim); line-height: 1.5; margin: 0; }

/* the editable body */
.inbox-draft-bodywrap { display: flex; flex-direction: column; gap: 6px; }
.inbox-draft-body {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.inbox-draft-body:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--border-accent); }

/* basis (what the draft rests on: facts vs estimates) */
.inbox-draft-basis {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px;
  min-width: 0;
}
.inbox-draft-basis-head {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.inbox-draft-basis-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* the human gate (Approve) row */
.inbox-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.inbox-draft-approve { font-size: 13px; }
.inbox-draft-approve:disabled { opacity: 0.7; cursor: default; }
.inbox-draft-edit { font-size: 12px; }
.inbox-draft-approved-note {
  flex: 1 0 100%;
  font-size: 12px;
  color: var(--gold);
  line-height: 1.5;
  margin: 4px 0 0;
}

/* the packet pointer at the foot of the page */
.inbox-packet-foot {
  margin-top: 18px;
  text-align: center;
}

/* ============================================================
   MOTION — only inside no-preference. Items enter with a calm fade + rise.
   The list is the busiest region so it gets the stagger via --enter-delay.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .inbox-item.anim-in {
    animation: inboxFadeInUp 0.34s ease both;
    animation-delay: var(--enter-delay, 0ms);
  }
  @keyframes inboxFadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}
/* reduce: no animation, items are simply present at rest. (No rule needed
   because .anim-in is only added under no-preference by the JS, but pin it
   to be certain a future change cannot animate under reduce.) */
@media (prefers-reduced-motion: reduce) {
  .inbox-item { animation: none !important; }
}

/* ============================================================
   RESPONSIVE — single column below the rail-collapse breakpoint. The draft
   panel sits last so a reader marks items read first, then scrolls to the
   draft (the bottom-sheet behavior on a phone). Zero horizontal scroll at
   375px: columns become full width and every long token wraps.
   ============================================================ */
@media (max-width: 1080px) {
  .inbox-grid {
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-areas:
      "sources center"
      "right   right";
  }
  .inbox-sources { grid-area: sources; }
  .inbox-center  { grid-area: center; }
  .inbox-right   { grid-area: right; }
  .inbox-right { flex-direction: row; flex-wrap: wrap; }
  .inbox-right > * { flex: 1 1 320px; }
}
@media (max-width: 760px) {
  .inbox-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "sources"
      "center"
      "right";
  }
  .inbox-right { flex-direction: column; }
  .inbox-right > * { flex: 1 1 auto; }
  .inbox-col { padding: 14px; }
  .inbox-draft-field-label { width: 56px; }
}
@media (max-width: 420px) {
  .inbox-item { padding: 11px; gap: 8px; }
  .inbox-item-subject { font-size: 13.5px; }
  .inbox-col { padding: 12px; border-radius: var(--radius); }
  .inbox-draft-body { font-size: 12px; }
}

/* ============================================================
   DEPARTMENT PANEL — the surface where BOTH toggles materially change
   what renders. The "Viewing as <department>" switcher re-derives every
   value from that department's own items; the Guided / Visual / Detailed
   mode re-renders the SAME items as a short walkthrough, a compact chart,
   or a full table. Token-driven so light (the default) and dark hold WCAG
   AA, no text-on-text, and no horizontal overflow at 375px. All motion
   sits behind prefers-reduced-motion: no-preference.
   ============================================================ */
.dept-panel {
  margin: 0 0 var(--space-4);
  padding: var(--space-4) var(--space-4) calc(var(--space-4) + 2px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.dept-panel:empty { display: none; }
.dept-head { min-width: 0; }
.dept-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-deep);
  margin: 0 0 6px;
}
.dept-eyebrow .dept-mode-tag {
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-pale); border: 1px solid var(--border-accent);
  color: var(--accent-deep);
}
.dept-title {
  margin: 0 0 4px; font-size: 19px; line-height: 1.25;
  font-weight: 800; color: var(--text); overflow-wrap: anywhere;
}
.dept-lead {
  margin: 0; font-size: 14px; line-height: 1.55;
  color: var(--text-dim); overflow-wrap: anywhere;
}
.dept-lead strong { color: var(--text); font-weight: 700; }
.dept-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: var(--space-3) 0 0;
}
.dept-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-dim); white-space: nowrap;
}
.dept-chip b { font-size: 14px; color: var(--text); font-weight: 800; }
.dept-guided { margin-top: var(--space-4); }
.dept-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dept-step {
  display: grid; grid-template-columns: 28px 1fr; gap: 12px;
  align-items: start; min-width: 0;
}
.dept-step-n {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-pale); border: 1px solid var(--border-accent);
  color: var(--accent-deep); font-weight: 800; font-size: 13px;
  font-family: var(--mono);
}
.dept-step-text { font-size: 14px; line-height: 1.5; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.dept-step-text .dept-step-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-dim); }
.dept-guided-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--space-4);
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font-size: 13.5px; font-weight: 700; text-decoration: none;
  border: 1px solid var(--accent); box-shadow: var(--shadow-teal);
}
.dept-guided-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dept-visual { margin-top: var(--space-4); }
.dept-bars { display: grid; gap: 12px; margin: 0; }
.dept-bar-row {
  display: grid; grid-template-columns: minmax(96px, 132px) 1fr auto;
  gap: 12px; align-items: center; min-width: 0;
}
.dept-bar-label { font-size: 12.5px; color: var(--text-dim); min-width: 0; overflow-wrap: anywhere; }
.dept-bar-track {
  height: 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  overflow: hidden; min-width: 0;
}
.dept-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); width: 0; }
.dept-bar-fill.is-gate { background: var(--gold); }
.dept-bar-fill.is-dim { background: var(--text-dimmer); }
.dept-bar-count {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  color: var(--text); min-width: 1.5em; text-align: right;
}
.dept-visual-note { margin: var(--space-4) 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.dept-detailed { margin-top: var(--space-4); }
.dept-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dept-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.dept-table caption { text-align: left; caption-side: top; margin-bottom: 8px; font-size: 12.5px; color: var(--text-dim); }
.dept-table th, .dept-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dept-table th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim); font-weight: 700; white-space: nowrap;
}
.dept-table td { color: var(--text); }
.dept-table tbody tr:hover { background: var(--accent-pale); }
.dept-cell-id { font-family: var(--mono); font-size: 11.5px; color: var(--accent-deep); white-space: nowrap; }
.dept-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid var(--border);
}
.dept-pill.is-linked   { color: var(--ok); background: var(--ok-wash); border-color: var(--ok); }
.dept-pill.is-reviewed { color: var(--accent-deep); background: var(--accent-pale); border-color: var(--border-accent); }
.dept-pill.is-missing  { color: var(--warn-color); background: var(--warn-wash); border-color: var(--warn-color); }
.dept-pill.is-blocked  { color: var(--gold); background: var(--gold-pale); border-color: var(--gold); }
.dept-detailed-foot { margin: var(--space-3) 0 0; font-size: 12px; color: var(--text-dim); }
.dept-empty { margin-top: var(--space-3); font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
@media (prefers-reduced-motion: no-preference) {
  .dept-panel { transition: border-color 0.2s ease; }
  .dept-mode-body { animation: dept-fade 0.34s cubic-bezier(0.18, 0.9, 0.28, 1.05) both; }
  @keyframes dept-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .dept-bar-fill { transition: width 0.5s cubic-bezier(0.18, 0.9, 0.28, 1.05); }
  .dept-step { animation: dept-fade 0.4s cubic-bezier(0.18, 0.9, 0.28, 1.05) both; animation-delay: var(--dept-stagger, 0ms); }
}
@media (prefers-reduced-motion: reduce) {
  .dept-mode-body, .dept-step { animation: none; opacity: 1; transform: none; }
  .dept-bar-fill { transition: none; }
}
@media (max-width: 520px) {
  .dept-bar-row { grid-template-columns: 1fr auto; }
  .dept-bar-label { grid-column: 1 / -1; }
}

/* ---- view-mode density on the inbox itself ------------------------------
   The mode toggle changes the inbox layout, not only the panel:
     Visual   collapses to a single column with the message list as the focus,
              the right-hand summary + draft stack below it.
     Detailed widens every preview so the full text reads, source + summary
              columns get more room.
   Guided keeps the default three-column reading layout. Body class set by
   shell.js. Each holds inside its width, no horizontal overflow. */
body.mode-visual .inbox-grid {
  grid-template-columns: minmax(0, 1fr);
}
body.mode-visual .inbox-right { flex-direction: row; flex-wrap: wrap; }
body.mode-visual .inbox-right > * { flex: 1 1 320px; min-width: 0; }
body.mode-visual .inbox-item-preview { display: none; }
body.mode-visual .inbox-item-subject { font-size: 15px; }

body.mode-detailed .inbox-item-preview {
  display: block;
  -webkit-line-clamp: unset; line-clamp: unset;
  max-height: none; overflow: visible;
}
body.mode-detailed .inbox-item { padding-top: 16px; padding-bottom: 16px; }
body.mode-detailed .inbox-item-trust { margin-top: 8px; }
