/* Phase 4.4: the inbox, the bell, the Needs-you strip, the replied chip, deep-link highlights and palette recents.
   Tokens only: no new colour. Unread is a dot and bold text, never colour alone; the highlight is an outline and a word
   in the accessible name, not only a wash. */

/* ---------------------------------------------------------------- the bell (side bar and top bar) */
.nav-count.nav-count-inbox, .topbar-bell .nav-count { background: var(--accent-wash); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 45%, transparent); }
.topbar-bell { position: relative; }
.topbar-bell .nav-count { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; }
.topbar-bell[aria-current="page"] { color: var(--accent); }

/* ---------------------------------------------------------------- the Inbox page */
.inbox-toolbar { gap: var(--sp-2) var(--sp-3); }
.inbox-filters { min-width: 0; max-width: 100%; }
.inbox-filters .segmented { flex-wrap: nowrap; }
.inbox-filters .segmented button { white-space: nowrap; }
.inbox-agent-chip { gap: 6px; cursor: pointer; border: 0; min-height: 32px; }
.inbox-agent-chip .icon { width: 13px; height: 13px; }
/* "Unread only" with a kind filter (#/inbox?filter=chats&unread=1): the filled dot and the words, as on an unread row. */
.inbox-unread-chip .inbox-dot { margin-top: 0; background: var(--accent); box-shadow: none; }
@media (pointer: coarse) { .inbox-agent-chip { min-height: var(--target); } }
.inbox-body .day + .day { margin-top: var(--sp-6); }
.inbox-days .day-head { display: flex; align-items: baseline; gap: var(--sp-2); margin: 0 0 var(--sp-2); font: var(--text-title-3); }
.inbox-days .day-head .muted { font: var(--text-body-sm); }
.inbox-list { list-style: none; margin: 0; padding: var(--sp-1); display: grid; gap: 2px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.inbox-row { min-width: 0; }
.inbox-link { display: grid; grid-template-columns: 10px 18px minmax(0, 1fr) 16px; gap: var(--sp-3); align-items: start; min-height: var(--target); padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md); color: var(--ink-2); text-decoration: none; transition: background-color var(--dur-1) var(--ease-out); }
.inbox-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink-1); }
.inbox-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.inbox-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.inbox-row.is-unread .inbox-dot { background: var(--accent); box-shadow: none; }
.inbox-kind { display: inline-flex; margin-top: 2px; color: var(--ink-3); }
.inbox-kind .icon { width: 16px; height: 16px; }
.inbox-main { min-width: 0; display: grid; gap: 2px; }
.inbox-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); min-width: 0; }
.inbox-title { font: var(--text-body); color: var(--ink-1); overflow-wrap: anywhere; }
.inbox-row.is-unread .inbox-title { font-weight: 600; }
.inbox-agent { height: 20px; padding: 0 7px; font: var(--text-micro); white-space: nowrap; }
.inbox-time { margin-left: auto; color: var(--ink-3); font: var(--text-caption); font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inbox-body-line { display: block; color: var(--ink-2); font: var(--text-body-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row.is-unread .inbox-body-line { color: var(--ink-1); }
.inbox-chev { display: inline-flex; margin-top: 3px; color: var(--ink-3); }
.inbox-chev .icon { width: 14px; height: 14px; }
.inbox-more { display: flex; justify-content: center; margin-top: var(--sp-4); }
.inbox-end { margin: var(--sp-4) 0 0; text-align: center; font: var(--text-body-sm); }
.inbox-end:empty { display: none; }
.inbox-sk { padding: var(--sp-2) var(--sp-3); display: grid; gap: var(--sp-2); }
.inbox-sk-row { display: grid; gap: 6px; padding: var(--sp-3) 0; }
@media (max-width: 719px) {
  .inbox-toolbar { margin-bottom: var(--sp-4); }
  .inbox-filters { margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .inbox-filters::-webkit-scrollbar { display: none; }
  .inbox-link { padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--sp-3); gap: var(--sp-2); }
  .inbox-time { flex-basis: 100%; margin-left: 0; }
}

/* ---------------------------------------------------------------- Fleet: Needs you */
.needs { display: grid; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); box-shadow: var(--shadow-1), inset 3px 0 0 var(--accent); }
.needs-title { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font: var(--text-title-3); }
.needs-title .icon { width: 16px; height: 16px; color: var(--accent); }
.needs-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.needs-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--surface-1); color: var(--ink-2); font: var(--text-body-sm); cursor: pointer; text-decoration: none; transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.needs-chip:hover { background: var(--surface-2); border-color: var(--line-input); color: var(--ink-1); text-decoration: none; }
.needs-chip b { color: var(--ink-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.needs-chip .icon { width: 14px; height: 14px; color: var(--ink-3); }
.needs-chip .icon:last-child { width: 12px; height: 12px; }
.needs-who { color: var(--ink-3); }
.needs-pop { padding: var(--sp-2); display: grid; gap: 2px; }
.needs-pop .menu-head { padding: var(--sp-2) var(--sp-3); }
.needs-pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.needs-pop-list .menu-item { text-decoration: none; }
@media (pointer: coarse) { .needs-chip { min-height: var(--target); } }
@media (max-width: 719px) { .needs { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); } .needs-list { gap: var(--sp-2); } }

/* ---------------------------------------------------------------- Fleet cards: the replied chip; the Chat tab's dot */
.chip-replied { gap: 5px; color: var(--ink-1); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 60%, var(--line-strong)); text-decoration: none; position: relative; z-index: 2; }
.chip-replied:hover { background: var(--accent-wash); text-decoration: none; }
.chip-replied .icon { width: 12px; height: 12px; color: var(--accent); }
.chip-replied time { color: var(--ink-3); font-weight: 400; }
.chip-replied .replied-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tab-mark.is-unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------------------------------------------------------------- deep links: the card you opened */
.is-linked { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-lg); animation: linked-fade var(--dur-3) var(--ease-out) both; position: relative; z-index: 1; }
tr.is-linked { outline-offset: -2px; }
tr.is-linked > td, tr.is-linked > th { background: var(--accent-wash); }
.inbox-row.is-linked { outline-offset: 0; border-radius: var(--r-md); }
@keyframes linked-fade { from { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .is-linked { animation: none; } }
.gone-note { margin-bottom: var(--sp-4); }

/* ---------------------------------------------------------------- the palette: Recent */
.palette-item .hint .kbd { margin-left: 4px; }
.palette-recent-time { color: var(--ink-3); font: var(--text-caption); font-weight: 400; }
