/* Topic detail (Entity.dc.html). Classes are prefixed td- because all page stylesheets are loaded together. */
.td-hero { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.td-hero .page-title { margin-top: 0; overflow-wrap: anywhere; }
.td-hero-row { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: flex-end; justify-content: space-between; }
.td-hero-main { flex: 1 1 520px; min-width: 0; }
.td-hero-main .lead { margin-top: 12px; max-width: 720px; }
.td-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.td-actions .btn { padding: 0 18px; }

/* summary (summarizer agent) */
.td-sum { gap: 10px; }
.td-sum[hidden] { display: none; }
.td-sum-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.td-sum-head h2.eyebrow { margin: 0; font-weight: 500; }
.td-sum-meta { font-size: 12px; color: var(--ink-3); }
.td-sum-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
@media (max-width: 900px) { .td-sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .td-sum-grid { grid-template-columns: 1fr; } }
.td-sum-grid div { padding: 12px 0 4px; border-top: var(--rule-row); min-width: 0; }
.td-sum-grid dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.td-sum-grid dd { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.td-sum-grid dd.none { color: var(--ink-3); }
.td-sum-wait { display: grid; gap: 10px; padding: 8px 0 4px; }
.td-sum-wait span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-sunken) 0%, var(--border) 50%, var(--surface-sunken) 100%); background-size: 200% 100%; animation: td-sum-shimmer 1.4s linear infinite; }
.td-sum-wait span:nth-child(2) { width: 86%; } .td-sum-wait span:nth-child(3) { width: 62%; }
@keyframes td-sum-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .td-sum-wait span { animation: none; } }

/* timeline under the summary: one line, one word per point */
.td-tl { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-top: 18px; border-top: var(--rule-row); }
.td-tl[hidden] { display: none; }
.td-tl h3.eyebrow { margin: 0; font-weight: 500; }
.td-tl-key { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); }
.td-tl-key span { display: inline-flex; align-items: center; gap: 5px; }
.td-tl-key i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink-2); background: var(--surface); }
.td-tl-key i.fact { background: var(--ink-2); }
.td-tl-scroll { overflow-x: auto; overflow-y: hidden; margin: 0 -8px; padding: 0 8px; }
/* all text sits above the line on one row (label over date); today is a short blue tick. Positions are set in JS. */
.td-tl-track { position: relative; height: 66px; }
.td-tl-line { position: absolute; top: 52px; height: 2px; }
.td-tl-line.past { background: var(--ink-2); }
.td-tl-line.future { background: repeating-linear-gradient(90deg, var(--ink-faint) 0 6px, transparent 6px 11px); }
.td-tl-now { position: absolute; top: 43px; height: 20px; border-left: 2px solid var(--accent); }
.td-tl-pts { list-style: none; margin: 0; padding: 0; }
.td-tl-pt { position: absolute; top: 0; height: 100%; width: 0; }
.td-tl-txt { position: absolute; top: 12px; left: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; line-height: 1.25; padding: 0 3px; background: var(--surface); z-index: 1; }
.td-tl-label { font-weight: 600; font-size: 12px; }
.td-tl-date { font-size: 11px; color: var(--ink-3); }
.td-tl-dot { position: absolute; top: 48px; left: -5px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-2); background: var(--surface); }
.td-tl-pt.fact .td-tl-dot { background: var(--ink-2); }
.td-tl-pt.start .td-tl-dot, .td-tl-pt.end .td-tl-dot { top: 46px; left: -7px; width: 14px; height: 14px; border-color: var(--accent); border-width: 3px; }
.td-tl-pt.start.fact .td-tl-dot, .td-tl-pt.end.fact .td-tl-dot { background: var(--accent); }
.td-tl-pt.start .td-tl-label, .td-tl-pt.end .td-tl-label { color: var(--accent); }

/* key figures */
.td-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.td-fig { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 24px 28px; }
.td-fig + .td-fig:not(.hl) { border-left: var(--rule-row); }
.td-fig-row { display: flex; align-items: flex-end; gap: 12px; color: var(--ink-2); }
.td-fig-row .kpi-l { color: var(--ink); }
.td-fig-row > span:last-child { padding-bottom: 4px; }
.td-fig .squares { margin-top: 4px; }
.td-fig.hl { background: var(--accent); color: #fff; border-bottom-left-radius: var(--radius-panel-corner); }
.td-fig.hl .eyebrow { color: rgba(255,255,255,0.85); }
.td-date { font: 400 34px/1 var(--font-display); letter-spacing: -0.03em; }
.td-date-sub { color: rgba(255,255,255,0.9); }
@media (max-width: 800px) { .td-fig.hl { border-bottom-left-radius: 0; } }
@media (max-width: 560px) { .td-fig + .td-fig:not(.hl) { border-left: 0; border-top: var(--rule-row); } }

/* two columns */
.td-cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.td-cols [hidden] { display: none !important; }
.td-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.td-col.wide { flex: 2 1 520px; }
.td-card { gap: 12px; }
.td-empty { margin: 0; padding: 12px 0 4px; color: var(--ink-3); }

/* who knows this */
.td-person { display: grid; grid-template-columns: 32px minmax(140px, 1fr) 110px 2fr; gap: 6px 14px; align-items: center; min-height: 44px; padding: 12px 0; border-top: var(--rule-row); }
.td-person .disc { width: 32px; height: 32px; font-size: 12px; }
.td-who { min-width: 0; }
.td-who b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.td-who span { display: block; font-size: 12px; color: var(--ink-3); }
.td-person:hover .td-who b { text-decoration: underline; }
.td-level { font-size: 13px; font-weight: 500; }
.td-level .level { gap: 6px; }
.td-note { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .td-person { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .td-note { grid-column: 2 / -1; }
  .td-note:empty { display: none; }
}

/* captured knowledge */
.td-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin-top: 4px; }
.td-item { min-width: 0; padding: 16px 18px; border-radius: var(--radius-tile); background: var(--surface-sunken); }
.td-item.hot { background: var(--accent); color: #fff; }
.td-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.td-item.hot .td-item-top { color: rgba(255,255,255,0.88); }
.td-item h3 { margin: 6px 0; font: 600 16px/1.25 var(--font-display); overflow-wrap: anywhere; }
.td-item-body { margin: 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.td-item.hot .td-item-body { color: rgba(255,255,255,0.94); }
.td-item-body.open { display: block; overflow: visible; }
.td-item-labels { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.td-item.hot .td-item-labels { color: rgba(255,255,255,0.75); }
.td-more { display: inline-flex; align-items: center; min-height: 40px; margin-bottom: -10px; padding: 0; border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--accent); cursor: pointer; }
.td-item.hot .td-more { color: #fff; text-decoration: underline; }
.td-more:hover { text-decoration: underline; }
.td-toggle { padding: 0; border: 0; background: transparent; cursor: pointer; }

/* right column */
.td-side { background: var(--surface); border-radius: var(--radius-card); padding: 22px 24px; min-width: 0; }
.td-side h2.eyebrow { margin: 0 0 8px; font-weight: 500; }
.td-side-head { display: flex; justify-content: space-between; align-items: baseline; }
.td-side-n { font: 500 18px/1 var(--font-display); }
.td-side .note { margin-top: 6px; }
.td-group { padding: 10px 0; border-top: var(--rule-row); }
.td-group-label { font-size: 12px; color: var(--ink-3); }
.td-chips { display: flex; flex-wrap: wrap; gap: 8px 6px; margin-top: 6px; }
.td-chips .chip { position: relative; min-height: 32px; padding: 4px 12px; border-radius: 16px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.td-chips .chip::after { content: ""; position: absolute; inset: -4px 0; } /* 40px touch target */
.td-chips .chip small { font-size: 11px; font-weight: 400; color: var(--ink-3); }
#td-chain:empty { display: none; }
.td-source { display: block; padding: 10px 0; border-top: var(--rule-row); color: inherit; }
.td-source b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.td-source:hover b { text-decoration: underline; }
.td-source span { display: block; font-size: 12px; color: var(--ink-3); }
.td-src-more { display: flex; align-items: center; width: 100%; min-height: 44px; border-top: var(--rule-row); color: var(--accent); font-weight: 500; text-align: left; }
.td-src-more:hover { text-decoration: underline; }

/* risk callout */
.td-risk { background: var(--risk-soft-bg); color: var(--risk-soft-text); border-radius: var(--radius-card); padding: 22px 24px; }
.td-risk-head { display: flex; align-items: center; gap: 8px; }
.td-risk-head h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--risk-soft-label); }
.td-risk-mark { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--risk-high); }
.td-risk-mark.medium { background: var(--risk-medium); }
.td-risk p, .td-risk ul { margin: 10px 0 0; font-size: 13px; }
.td-risk ul { padding-left: 18px; }
.td-risk li + li { margin-top: 4px; }
.td-risk .td-risk-lead { font: 500 18px/1.3 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
