/* Interactive parts of the Tracking Conversations write-up. Uses the site's theme variables. */
.tc { --tc-third: #c22a17; --tc-first: #17794a; --tc-both: #a85f00; --tc-ads: #c22a17; --tc-analytics: var(--blue); --tc-other: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tc { --tc-third: #ff8a78; --tc-first: #6fd3a0; --tc-both: #f0b45a; --tc-ads: #ff8a78; } }
:root[data-theme="dark"] .tc { --tc-third: #ff8a78; --tc-first: #6fd3a0; --tc-both: #f0b45a; --tc-ads: #ff8a78; }

.tc-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin-top: 0.9rem; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.tc-legend i { display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.35rem; vertical-align: -1px; border: 1px solid currentColor; }
.tc-legend .third i, .tc-m .third { background: color-mix(in srgb, var(--tc-third) 16%, transparent); color: var(--tc-third); }
.tc-legend .first i, .tc-m .first { background: color-mix(in srgb, var(--tc-first) 16%, transparent); color: var(--tc-first); }
.tc-legend .both i, .tc-m .both { background: color-mix(in srgb, var(--tc-both) 18%, transparent); color: var(--tc-both); }
.tc-legend .ads i { background: var(--tc-ads); color: var(--tc-ads); }
.tc-legend .analytics i { background: var(--tc-analytics); color: var(--tc-analytics); }
.tc-legend .other i { background: var(--tc-other); color: var(--tc-other); }

/* matrix */
.w-body .tc-scroll { margin-top: 0.9rem; overflow-x: auto; border: 1px solid var(--rule); }
.w-body table.tc-m { display: table; margin: 0; border: 0; border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.tc-m th, .tc-m td { padding: 0; border-bottom: 1px solid var(--hair); border-right: 1px solid var(--hair); text-align: center; }
.tc-m thead th { position: static; height: 6.8rem; vertical-align: bottom; background: var(--bg); padding: 0.4rem 0; font-size: 0.66rem; letter-spacing: 0; text-transform: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.tc-m thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.tc-m thead th b { color: var(--blue); font-weight: 500; }
.tc-m th.rh { position: sticky; left: 0; z-index: 1; background: var(--bg); text-align: left; padding: 0.45rem 0.7rem; min-width: 8.5rem; font-family: var(--sans); font-size: 0.9rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); border-right: 1px solid var(--rule); }
.tc-m thead th.rh { vertical-align: bottom; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.tc-m tr.grp th { text-align: left; padding: 0.35rem 0.7rem; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--ink) 5%, var(--bg)); position: sticky; left: 0; }
.w-body .tc-m td, .w-body .tc-m td:first-child { width: 2.1rem; min-width: 2.1rem; height: 2.1rem; font-family: var(--mono); font-size: 0.62rem; font-weight: 600; line-height: 1.1; }
.tc-m td.none { color: var(--hair); font-weight: 400; }
.tc-m td.note { box-shadow: inset 0 -2px 0 currentColor; cursor: help; }
.w-body .tc-notes { margin-top: 0.6rem; }
.tc-notes summary, .tc-case summary { cursor: pointer; }
.tc-notes summary { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.tc-notes li { font-size: 0.95rem; }

/* flows */
.tc-tabs { display: flex; gap: 0; margin-top: 0.9rem; }
.tc-tabs button { font-family: var(--mono); font-size: 0.74rem; font-weight: 500; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); padding: 0.55rem 0.9rem; cursor: pointer; }
.tc-tabs button + button { border-left: 0; }
.tc-tabs button[aria-pressed="true"] { background: var(--blue); color: var(--onblue); }
.w-body .tc-flow { margin-top: 0.9rem; overflow-x: auto; border: 1px solid var(--rule); }
.w-body .tc-flow svg { display: block; max-width: none; font-family: var(--mono); font-size: 10px; }
.tc-flow text { fill: var(--ink); }
.tc-flow .lk { fill: none; stroke-opacity: 0.22; }
.tc-flow .nd { cursor: pointer; }
.tc-flow .lk.ads { stroke: var(--tc-ads); }
.tc-flow .lk.analytics { stroke: var(--tc-analytics); }
.tc-flow .lk.other { stroke: var(--tc-other); }
.tc-flow rect.ads { fill: var(--tc-ads); }
.tc-flow rect.analytics { fill: var(--tc-analytics); }
.tc-flow rect.other { fill: var(--tc-other); }
.tc-flow .bot { fill: var(--ink); }
.tc-flow.pick .lk { stroke-opacity: 0.05; }
.tc-flow.pick .lk.on { stroke-opacity: 0.75; }
.tc-flow.pick g.nd:not(.on) { opacity: 0.3; }
.w-body .tc-hint { margin-top: 0.5rem; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); min-height: 1.2em; }

/* case studies */
.w-body .tc-case { margin-top: 0.9rem; border: 1px solid var(--rule); }
.tc-case summary { padding: 0.8rem 1rem; list-style: none; }
.tc-case summary::-webkit-details-marker { display: none; }
.tc-case summary b { display: block; font-weight: 650; }
.tc-case summary b::before { content: "+ "; font-family: var(--mono); color: var(--blue); }
.tc-case[open] summary b::before { content: "\2212 "; }
.tc-case summary span { display: block; margin-top: 0.15rem; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.tc-case .in { padding: 0 1rem 1rem; border-top: 1px solid var(--hair); }
.w-body .tc-case pre { font-size: 0.7rem; }
