.case-data-empty .timeline-empty-add { justify-self: stretch; min-height: 42px; margin-top: 10px; }
html body.case-route #app #caseContent .case-timeline-screen { display: grid; gap: 12px; }
html body.case-route #app #caseContent .timeline-document-search { width: 100%; box-sizing: border-box; min-width: 0; margin: 0; }
html body.case-route #app #caseContent [data-timeline-search-results] > :first-child { margin-top: 0; }
html body.case-route #app #caseContent .case-timeline-list { padding-top: 0; }
.timeline-document-search input { min-width: 0; width: 100%; }
.case-insight-limit.error { color: var(--red, #ef5a5a); }

.case-timeline-item time small { display: block; margin-top: 2px; font-weight: 500; opacity: .75; }
.case-timeline-item .timeline-type { display: block; margin-bottom: 2px; color: var(--muted, #68758a); font-size: calc(11px * var(--ui-font-scale, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.case-timeline-item footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
/* Each chronology entry is a card in its own right, not one connected timeline row. */
.case-timeline-list { gap: 10px; }
.case-timeline-item {
  grid-template-columns: minmax(68px, 78px) minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line, rgba(255, 255, 255, .08));
  border-radius: 20px;
  background: var(--panel, #131b2e);
}
.case-timeline-item::before,
.case-timeline-item::after { content: none; display: none; }
.case-timeline-item > div { min-width: 0; padding-left: 0; overflow-wrap: anywhere; }
.case-timeline-item > time { overflow-wrap: anywhere; }
button.timeline-add-event {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: min(100%, 220px);
  min-height: 50px !important;
  margin: 0 auto 12px;
  padding: 0 24px;
  border: 1px solid color-mix(in srgb, var(--accent, #a895ff) 38%, var(--line, transparent));
  border-radius: 16px !important;
  background: color-mix(in srgb, var(--accent, #a895ff) 10%, var(--panel, #131b2e));
  color: var(--accent, #a895ff);
  font-size: calc(15px * var(--ui-font-scale, 1));
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 3px 8px rgba(0,0,0,.12);
  cursor: pointer;
}
.timeline-add-event:active { transform: scale(.94); }
.timeline-add-event:focus-visible { outline: 2px solid var(--accent, #a895ff); outline-offset: 3px; }
.timeline-scroll-down { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
#caseContent:has(.case-timeline-screen) + .case-brain-fab { display: none !important; }
.timeline-hidden-item {
  align-items: center;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line, rgba(255, 255, 255, .08));
  border-radius: 16px;
  background: var(--panel, #131b2e);
}
.timeline-source {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green, #30c37c);
  -webkit-text-fill-color: var(--green, #30c37c);
  background-image: none;
  -webkit-background-clip: border-box;
  font: inherit;
  font-size: calc(12px * var(--ui-font-scale, 1));
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.timeline-source-text { color: var(--muted, #68758a); font-size: calc(12px * var(--ui-font-scale, 1)); }
.timeline-origin { padding: 1px 8px; border-radius: 999px; background: rgba(143, 125, 255, .14); font-size: calc(11px * var(--ui-font-scale, 1)); color: var(--muted, #8f9bb3); }
.timeline-origin.edited,
.timeline-origin.manual { background: rgba(48, 195, 124, .14); color: var(--green, #30c37c); }
.timeline-origin.warn { background: rgba(241, 167, 62, .16); color: #f1a73e; }
.timeline-actions { display: inline-flex; gap: 12px; margin-left: auto; }
.timeline-actions .link-button,
.timeline-hidden .link-button { padding: 0; border: 0; background: none; color: var(--accent, #a895ff); font: inherit; font-size: calc(12px * var(--ui-font-scale, 1)); font-weight: 600; }
.timeline-actions .link-button:not(.danger) {
  color: var(--green, #30c37c);
  -webkit-text-fill-color: var(--green, #30c37c);
  background-image: none;
  -webkit-background-clip: border-box;
}
.timeline-actions .link-button.danger { color: var(--red, #ef5a5a); }

.timeline-hidden { margin: 12px 0; }
.timeline-hidden summary { color: var(--muted, #68758a); font-size: calc(13px * var(--ui-font-scale, 1)); cursor: pointer; }
.timeline-hidden-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line, rgba(255, 255, 255, .06)); font-size: calc(13px * var(--ui-font-scale, 1)); }

.timeline-sheet .form { display: grid; gap: 12px; }
.timeline-sheet label { display: grid; gap: 6px; }
.timeline-sheet input,
.timeline-sheet select,
.timeline-sheet textarea { width: 100%; box-sizing: border-box; }
.timeline-sheet-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
