/* TLSH and @DisCo widget. Theme colors only; ruled rows, no cards. */

.w-demo {
  margin: 10px 0 8px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--light-gray);
}
.w-demo:not(.w-ready)::before { content: "This demo needs JavaScript."; color: var(--gray); font-size: 0.9rem; }

.w-note { margin: 8px 0; font-size: 0.88rem; color: var(--dark-gray); max-width: 72ch; }

.w-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 6px 0; }
.w-btn {
  appearance: none; min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--background);
  font: inherit; font-family: var(--heading); font-size: 0.88rem; font-weight: var(--semi-bold);
  cursor: pointer; border-radius: 0;
}
.w-btn:hover { background: transparent; color: var(--primary); }
.w-btn-quiet { background: transparent; color: var(--primary); }
.w-btn-quiet:hover, .w-btn-quiet[aria-pressed="true"] { background: var(--primary); color: var(--background); }
.w-btn:focus-visible, .seg-option:focus-visible, .tl-text:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--light-gray); }
.seg-option {
  appearance: none; padding: 6px 10px; border: 0; border-right: 1px solid var(--light-gray);
  background: transparent; color: var(--text); font: inherit; font-family: var(--code); font-size: 0.78rem;
  cursor: pointer; border-radius: 0; min-height: 34px;
}
.seg-option:last-child { border-right: 0; }
.seg-option[aria-checked="true"] { background: var(--light-gray); color: var(--accent); }

.tl-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 6px 0; }
.tl-ctl-label { font-family: var(--code); font-size: 0.75rem; color: var(--gray); min-width: 6.5rem; display: inline-block; }
.tl-ctl input[type="range"] { width: 220px; max-width: 56vw; accent-color: var(--accent); }
.tl-slider { display: inline-flex; align-items: center; gap: 8px; }
.tl-num { font-family: var(--code); font-size: 0.8rem; white-space: nowrap; }

.tl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; max-width: 760px; }
@media (max-width: 640px) { .tl-cols { grid-template-columns: 1fr; } }
.tl-col { min-width: 0; }
.tl-text {
  display: block; width: 100%; box-sizing: border-box; margin: 4px 0; padding: 8px 9px;
  border: 1px solid var(--light-gray); border-bottom: 2px solid var(--primary); border-radius: 0;
  background: var(--background); color: var(--text); font-family: var(--code); font-size: 0.8rem; line-height: 1.45; resize: vertical;
}
.tl-text:disabled { color: var(--gray); }
.tl-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0; padding-top: 6px; border-top: 1px solid var(--light-gray); }
.tl-filelab { font-family: var(--code); font-size: 0.78rem; color: var(--gray); display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.tl-file { font-size: 0.78rem; max-width: 220px; color: var(--text); }

.tl-rows { max-width: 760px; margin: 6px 0; }
.tl-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--light-gray); }
@media (max-width: 520px) { .tl-row { grid-template-columns: 1fr; } }
.tl-row-k { font-family: var(--code); font-size: 0.78rem; color: var(--gray); }
.tl-row-v { min-width: 0; }
.tl-row-v > div { display: flex; gap: 8px; align-items: baseline; margin: 2px 0; }
.tl-tag { font-family: var(--code); font-size: 0.72rem; color: var(--gray); flex: none; }
.tl-row-note { margin: 6px 0 0; font-size: 0.88rem; max-width: 72ch; }
.tl-row-note strong { color: var(--accent); }
.tl-hex { font-family: var(--code); font-size: 0.74rem; overflow-wrap: anywhere; word-break: break-all; color: var(--text); background: none; padding: 0; }
.tl-hex mark { background: var(--light-gray); color: var(--accent); font-weight: 600; padding: 0; }

.tl-window { max-width: 760px; }
.tl-strip { display: inline-flex; border: 1px solid var(--light-gray); }
.tl-byte { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.2rem; padding: 3px 4px; border-right: 1px solid var(--light-gray); }
.tl-byte:last-child { border-right: 0; }
.tl-byte b { font-family: var(--code); font-size: 0.95rem; color: var(--accent); font-weight: 600; }
.tl-byte small { font-family: var(--code); font-size: 0.68rem; color: var(--gray); }
.tl-trips { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; font-size: 0.8rem; font-family: var(--code); }
.tl-trip code { color: var(--accent); background: none; padding: 0; white-space: pre; }
.tl-trip.off { color: var(--gray); }
.tl-trip.off code { color: var(--gray); }

.tl-chart { display: block; width: 100%; max-width: 760px; height: auto; margin: 8px 0; overflow: visible; }
.c-grid { stroke: var(--light-gray); stroke-width: 1; }
.c-ref { stroke: var(--gray); stroke-width: 1.2; stroke-dasharray: 3 3; }
.c-tick { fill: var(--gray); font-family: var(--code); font-size: 11px; }
.c-label { fill: var(--dark-gray); font-family: var(--code); font-size: 11px; }
.tl-bar { fill: var(--primary); }
.tl-bar.q0 { opacity: 0.18; }
.tl-bar.q1 { opacity: 0.4; }
.tl-bar.q2 { opacity: 0.65; }
.tl-bar.q3 { opacity: 0.95; }
.tl-bar.hot { fill: var(--accent); opacity: 1; }
.tl-cell { fill: var(--primary); stroke: none; }
.tl-cell.q0 { opacity: 0.12; }
.tl-cell.q1 { opacity: 0.38; }
.tl-cell.q2 { opacity: 0.66; }
.tl-cell.q3 { opacity: 0.95; }
.tl-cell.ch { stroke: var(--accent); stroke-width: 1.5; opacity: 1; fill-opacity: 0.5; }
.tl-track { fill: var(--light-gray); }
.tl-near { fill: var(--primary); opacity: 0.45; }
.tl-mark { stroke: var(--accent); stroke-width: 3; }
.tl-disco { fill: var(--accent); }
.tl-tlsh { fill: var(--background); stroke: var(--primary); stroke-width: 2; }
.tl-disco-whisk { stroke: var(--accent); stroke-width: 1.5; }
.tl-tlsh-whisk { stroke: var(--primary); stroke-width: 1.5; }
.tl-diffbar { fill: var(--primary); opacity: 0.6; }

.tl-anatomy { max-width: 760px; margin: 6px 0; }
.tl-part { display: grid; grid-template-columns: 8.5rem 1fr; gap: 2px 10px; padding: 5px 0; border-top: 1px solid var(--light-gray); align-items: baseline; }
.tl-part .tl-hex { color: var(--accent); }
.tl-part-note { grid-column: 2; font-size: 0.8rem; color: var(--dark-gray); }
@media (max-width: 520px) { .tl-part { grid-template-columns: 1fr; } .tl-part-note { grid-column: 1; } }

.tl-sim { font-family: var(--code); font-size: 0.78rem; color: var(--accent); margin: 6px 0; max-width: 72ch; }
.tl-heat { display: block; margin: 8px 0; image-rendering: pixelated; border: 1px solid var(--light-gray); max-width: 100%; }
.tl-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--code); font-size: 0.75rem; color: var(--gray); }
.tl-readout { margin: 8px 0; font-size: 0.92rem; max-width: 72ch; }
.tl-readout strong { color: var(--accent); }

.tl-table-wrap { overflow-x: auto; max-width: 760px; }
.paper-body .results-table { width: 100%; min-width: 420px; border-collapse: collapse; margin: 12px 0; overflow-wrap: normal; }
.paper-body .results-table th, .paper-body .results-table td { padding: 5px 8px; border-bottom: 1px solid var(--light-gray); text-align: left; vertical-align: top; }
.paper-body .results-table caption { text-align: left; font-size: 0.85rem; color: var(--dark-gray); caption-side: top; padding-bottom: 4px; }
.paper-body .results-table th { font-family: var(--code); font-size: 0.75rem; color: var(--gray); font-weight: 500; }
.paper-body .results-table tr.on td { background: var(--background-alt); }
.paper-body .tl-wide { min-width: 600px; }
.paper-body .tl-terms td:nth-child(3) { font-size: 0.82rem; color: var(--dark-gray); }

.paper-body li { text-align: left; }
.paper-body code { overflow-wrap: anywhere; }
