/* Portable Tor router 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-mono { font-family: var(--code); font-size: 0.78rem; color: var(--gray); }

.w-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 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 { background: var(--primary); color: var(--background); }
.w-btn[disabled] { opacity: 0.45; cursor: default; }
.w-btn:focus-visible, .seg-option:focus-visible, .pt-input: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); }

.pt-ctrls { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0; padding-top: 6px; border-top: 1px solid var(--light-gray); }
.pt-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pt-ctl-label { font-family: var(--code); font-size: 0.75rem; color: var(--gray); min-width: 4.5rem; }
.pt-input {
  min-height: 34px; padding: 4px 8px; width: 14rem; max-width: 100%;
  border: 1px solid var(--light-gray); border-radius: 0; background: var(--background); color: var(--text);
  font-family: var(--code); font-size: 0.8rem;
}
.w-range { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 3rem; align-items: center; gap: 4px 10px; margin: 6px 0; max-width: 520px; font-family: var(--code); font-size: 0.78rem; color: var(--gray); }
.w-range input[type="range"] { width: 100%; accent-color: var(--primary); }
.w-range output { text-align: right; color: var(--text); }

/* charts */
.pt-chain, .pt-hist, .pt-pipe { 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(--text); stroke-width: 1.5; stroke-dasharray: 2 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; }

.pt-wire { stroke: var(--light-gray); stroke-width: 2; }
.pt-node { fill: var(--background-alt); stroke: var(--primary); stroke-width: 1.5; }
.pt-node.on { stroke: var(--accent); stroke-width: 2.5; }
.pt-layer { fill: none; stroke-width: 3; }
.pt-layer.l3 { stroke: var(--primary); opacity: 0.45; }
.pt-layer.l2 { stroke: var(--primary); opacity: 0.7; }
.pt-layer.l1 { stroke: var(--primary); }
.pt-core { fill: var(--accent); }
.pt-core.locked { fill: var(--text); }

.pt-bar.tor { fill: var(--accent); opacity: 0.85; }
.pt-bar.dir { fill: var(--primary); opacity: 0.75; }
.pt-axis { stroke: var(--gray); stroke-width: 1; }

.pt-pipe-seg { fill: var(--background-alt); stroke: var(--primary); stroke-width: 1.5; }
.pt-pipe-seg.slow { stroke: var(--accent); stroke-width: 2.5; }
.pt-flow { fill: var(--accent); opacity: 0.35; }

.pt-key { font-family: var(--code); font-size: 0.75rem; }
.pt-key span { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: 3px; }
.pt-k-tor { background: var(--accent); }
.pt-k-dir { background: var(--primary); opacity: 0.75; }
.pt-k-avg { width: 0 !important; height: 12px !important; border-left: 2px dotted var(--text); }

.pt-readout { margin: 6px 0; font-size: 0.95rem; max-width: 72ch; }
.pt-readout strong { color: var(--accent); }
.pt-readout p { margin: 6px 0; }

/* onion rows */
.pt-rows { margin: 8px 0; border-top: 1px solid var(--light-gray); }
.pt-row { padding: 6px 0; border-bottom: 1px solid var(--light-gray); }
.pt-row.on { background: var(--background-alt); }
.pt-row.dim { opacity: 0.45; }
.pt-row-head { font-size: 0.88rem; }
.pt-bytes {
  margin: 4px 0 0; padding: 0; background: transparent; border: 0;
  font-family: var(--code); font-size: 0.75rem; color: var(--gray);
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all;
}
.pt-bytes.plain { color: var(--accent); }
.pt-keyline { margin: 6px 0; overflow-wrap: anywhere; }

/* tables */
.pt-table-wrap { overflow-x: auto; max-width: 760px; }
.paper-body .results-table { width: 100%; min-width: 520px; border-collapse: collapse; margin: 12px 0; overflow-wrap: normal; }
.paper-body .results-table th, .paper-body .results-table td { padding: 6px 8px; border-bottom: 1px solid var(--light-gray); text-align: left; vertical-align: top; }
.paper-body .results-table caption { text-align: left; }
.paper-body .results-table th { font-family: var(--code); font-size: 0.75rem; color: var(--gray); font-weight: 500; }
.paper-body .pt-times { min-width: 340px; }
.pt-num { font-family: var(--code); font-size: 0.82rem; white-space: nowrap; }
.pt-yes { color: var(--accent); font-weight: var(--semi-bold); }
.pt-no { color: var(--gray); }
.pt-why { font-size: 0.84rem; color: var(--dark-gray); }
.pt-flag { color: var(--accent); font-size: 0.75rem; }

.paper-body li { text-align: left; }
