/* Customer timeline ("klanttijdlijn", docs/telephony/TIMELINE.md). Tokens only (tokens.css). */

.tl { display: grid; gap: var(--gap-sm); }
.tl-day { display: grid; gap: 6px; }
.tl-day-label { margin: 6px 0 0; font-size: var(--t-2xs, var(--t-xs)); font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.tl-list::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }

.tl-item { --tl-tone: var(--muted); --tl-soft: var(--surface-2);
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 8px 0; position: relative; }
.tl-item.tl-accent { --tl-tone: var(--accent-text, var(--accent)); --tl-soft: var(--accent-soft); }
.tl-item.tl-violet { --tl-tone: var(--violet); --tl-soft: var(--violet-soft); }
.tl-item.tl-warn { --tl-tone: var(--warn); --tl-soft: var(--warn-soft); }
.tl-item.tl-ok { --tl-tone: var(--ok); --tl-soft: var(--ok-soft); }
.tl-item.tl-info { --tl-tone: var(--info); --tl-soft: var(--info-soft); }

.tl-dot { width: 32px; height: 32px; border-radius: var(--pill); display: grid; place-items: center; position: relative;
  background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--border); color: var(--tl-tone); }
.tl-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tl-soft); }
.tl-dot .icon { width: 16px; height: 16px; position: relative; z-index: 1; }

.tl-body { display: grid; gap: 3px; min-width: 0; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.tl-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.tl-title a { color: inherit; text-decoration: none; }
.tl-title a:hover { color: var(--accent-text, var(--accent)); text-decoration: underline; }
.tl-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tl-meta { font-variant-numeric: tabular-nums; }
.tl-text { margin: 2px 0 0; color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.tl-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.tl-thread { margin-top: 4px; }
.tl-thread > summary { cursor: pointer; font-size: var(--t-sm); color: var(--muted); }
.tl-messages { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tl-msg { display: grid; gap: 2px; max-width: min(520px, 92%); padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); font-size: var(--t-sm); overflow-wrap: anywhere; }
.tl-msg.out { justify-self: end; background: var(--ok-soft); }

.tl-notes { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tl-note { display: inline-flex; align-items: center; gap: 6px; }
.tl-note .icon { width: 14px; height: 14px; color: var(--warn); }

.tl-customer { display: flex; align-items: center; gap: 14px; }
.tl-avatar { width: 44px; height: 44px; border-radius: var(--pill); display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-text, var(--accent)); box-shadow: inset 0 0 0 1px var(--accent-line, var(--border)); }
.tl-avatar .icon { width: 20px; height: 20px; }
.tl-name { font-size: var(--t-lg); letter-spacing: -.015em; }

/* minmax(0, 1fr): long manual titles in a <select> must never widen the card. */
.tl, .tl-send, .tl-send .stack-sm { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.tl-send select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.tl-send textarea, .tl-send input[type="search"] { width: 100%; max-width: 100%; box-sizing: border-box; }
.tl-send textarea { resize: vertical; }
.tl-send .row > select { flex: 1 1 200px; min-width: 0; max-width: 100%; }
.tl-search { flex-wrap: nowrap; }
.tl-search > input { flex: 1 1 auto; min-width: 0; max-width: 420px; }
.tl-over { color: var(--danger); font-weight: 600; }

@media (max-width: 860px) {
  .tl-item { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
  .tl-dot { width: 26px; height: 26px; }
  .tl-list::before { left: 12px; }
}
