.tt-article {
  --tt-em: var(--amber);
  --tt-sigma: var(--cyan);
  --tt-merged: #9abaff;
  --tt-smart: var(--violet);
  container-type: inline-size;
  overflow-wrap: anywhere;
}

.tt-article .tt-hero h1 {
  max-width: 28ch;
}

.tt-hero h1 span {
  display: block;
  max-width: 42ch;
  margin-top: 0.65rem;
  color: var(--violet);
  font-size: clamp(1.05rem, 3.2cqi, 1.5rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.tt-article .lede {
  margin-top: 1rem;
}

.tt-article .lede em { font-style: normal; }

.tt-article h2:not(#tt-range-scope) {
  padding-top: 1.15rem;
  border-top: 1px solid var(--line-strong);
  margin-top: 2.8rem;
}

.tt-metrics,
.tt-scope dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.tt-metrics {
  margin: 1.4rem 0;
}

.tt-metric {
  --tt-metric-color: var(--tt-sigma);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: clamp(0.85rem, 3cqi, 1.2rem);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--tt-metric-color);
  border-radius: var(--radius);
  background: linear-gradient(145deg, color-mix(in srgb, var(--tt-metric-color) 11%, var(--bg-2)), var(--bg-2) 75%);
}

.tt-metric:nth-child(2) { --tt-metric-color: var(--tt-em); }
.tt-metric:nth-child(3) { --tt-metric-color: var(--tt-merged); }
.tt-metric:nth-child(4) { --tt-metric-color: var(--tt-merged); }

.tt-metric span {
  font-weight: 800;
  font-size: 0.85rem;
}

.tt-metric strong {
  order: -1;
  color: var(--tt-metric-color);
  font-size: clamp(1.4rem, 5cqi, 2.6rem);
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.tt-metric small,
.tt-scope dd,
.tt-scope p {
  color: var(--muted);
  font-size: 0.85rem;
}

.tt-scope,
.tt-toc,
.tt-prompt {
  margin: 1.3rem 0;
  padding: clamp(1rem, 3cqi, 1.4rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.tt-scope h2 {
  margin: 0;
  font-size: 1.15rem;
}

.tt-scope dl {
  margin: 0.9rem 0;
}

.tt-scope dl > div {
  padding-left: 0.75rem;
  border-left: 2px solid var(--tt-range-color);
}

.tt-scope-em { --tt-range-color: var(--tt-em); }
.tt-scope-sigma { --tt-range-color: var(--tt-sigma); }
.tt-scope-merged { --tt-range-color: var(--tt-merged); }
.tt-scope-smart { --tt-range-color: var(--tt-smart); }

.tt-scope dt {
  color: var(--tt-range-color);
  font-size: 0.88rem;
  font-weight: 800;
}

.tt-scope dd { margin: 0.25rem 0 0; }
.tt-scope p { margin: 0; }
.tt-scope dd code { color: var(--text); }

.tt-toc summary {
  cursor: pointer;
  font-weight: 800;
}

.tt-toc nav { display: grid; gap: 0.45rem; margin-top: 0.75rem; }
.tt-toc a { font-size: 0.88rem; }

.tt-article :is(summary, [tabindex="0"], button, textarea):focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

.tt-table-wrap { margin-block: 1.15rem; }
.tt-table-wrap table { min-width: 32rem; font-variant-numeric: tabular-nums; }
.tt-table-wrap table:not(:has(th:nth-child(3))) { min-width: 0; }
.tt-table-wrap th { color: var(--muted); background: var(--elev-2); }
.tt-table-wrap tbody tr:nth-child(even) { background: var(--elev); }
.tt-table-wrap tbody tr:last-child td { border-bottom: 0; }
.tt-table-wrap :is(td, th)[style="text-align:right"] { white-space: nowrap; }

.tt-product-examples { margin: 1.5rem 0 1.8rem; }
.tt-product-examples h3 { margin-top: 0; }

.tt-shot-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tt-product-examples .shot {
  max-width: none;
  margin: 0;
  min-width: 0;
}

.tt-product-examples :is(.shot-frame, picture) { display: block; }
.tt-product-examples .shot-frame img { width: 100%; max-height: none; }
.tt-product-examples > .shot { max-width: 760px; }

.tt-figure { margin: 1.45rem 0; }

.tt-chart-scroll {
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #141827;
}

.tt-chart-scroll svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 680px;
  font-family: var(--font);
}

.tt-chart-scroll [fill="#101b2b"] { fill: #141827; }
.tt-chart-scroll [fill="#294f52"] { fill: #345a5b; }
.tt-chart-scroll [fill="#d4a257"] { fill: var(--tt-em); }
.tt-chart-scroll [fill="#57c3ad"] { fill: var(--tt-sigma); }
.tt-chart-scroll [fill="#83a5e9"] { fill: var(--tt-merged); }
.tt-chart-scroll [stroke="#83a5e9"] { stroke: var(--tt-merged); }
.tt-chart-scroll [fill="#e28977"] { fill: #fa9b9a; }

.tt-article .tt-figure figcaption,
.tt-chart-hint {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.tt-chart-hint { display: none; color: var(--violet); }

.tt-prompt {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(155deg, rgba(var(--accent-rgb), 0.09), transparent 22rem), var(--bg-2);
}

.tt-prompt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 1rem;
}

.tt-prompt-header .kicker { color: var(--violet); }
.tt-prompt-header h3 { margin: 0.4rem 0 0; }

.tt-prompt button {
  flex: none;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--violet);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.25);
  color: var(--text);
  font: 800 0.86rem/1.5 var(--font);
  white-space: nowrap;
  cursor: pointer;
}

.tt-prompt button:hover { background: rgba(var(--accent-rgb), 0.45); }
.tt-prompt pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.tt-copy-controls { display: grid; justify-items: start; gap: 0.45rem; }
.tt-copy-controls [role="status"] { color: var(--muted); font-size: 0.8rem; }
.tt-copy-controls [role="status"]:empty { margin-top: -0.45rem; }

.tt-prompt textarea {
  width: 100%;
  min-height: 10rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--bg);
  font: 0.85rem/1.5 var(--mono);
}

.tt-prompt textarea.is-copying {
  position: fixed;
  top: 0;
  left: -9999px;
}

@container (max-width: 682px) {
  .tt-chart-hint { display: block; }
  .tt-shot-pair { grid-template-columns: minmax(0, 1fr); }
}

@container (max-width: 490px) {
  .tt-scope dl { grid-template-columns: minmax(0, 1fr); }
  .tt-prompt-header { flex-direction: column; }
}

@media print {
  .tt-chart-scroll svg { min-width: 0; }
  .tt-chart-hint, .tt-copy-controls, .tt-toc { display: none !important; }
  .tt-figure, .tt-metric, .tt-table-wrap tr { break-inside: avoid; }
}
