/* SDMLp 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-big { margin: 8px 0; font-family: var(--heading); font-size: 1.05rem; }
.w-big strong { color: var(--accent); font-size: 1.25rem; }
.w-sim { font-family: var(--code); font-size: 0.72rem; color: var(--gray); letter-spacing: 0.02em; text-transform: uppercase; }

.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:focus-visible, .seg-option:focus-visible, .w-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sd-bit { font-family: var(--code); min-width: 5.2rem; }

.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); }

.w-range { display: grid; grid-template-columns: auto minmax(0, 1fr) 3rem; align-items: center; gap: 4px 10px; margin: 6px 0; width: min(100%, 340px); 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); }
.w-check { display: inline-flex; align-items: center; gap: 6px; font-family: var(--code); font-size: 0.78rem; color: var(--text); min-height: 34px; cursor: pointer; }
.w-check input { accent-color: var(--primary); width: 16px; height: 16px; }

/* charts */
.sd-chart { display: block; width: 100%; max-width: 760px; height: auto; margin: 8px 0; overflow: visible; }
.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; }
.c-grid { stroke: var(--light-gray); stroke-width: 1; }
.c-axis { stroke: var(--gray); stroke-width: 1; }
.sd-wave { fill: none; stroke: var(--primary); stroke-width: 2; }
.sd-wave.cmos { stroke: var(--gray); }
.sd-rise { fill: var(--accent); font-family: var(--code); font-size: 11px; }
.sd-tick-hot { fill: var(--accent); }

.sd-edge { stroke: var(--gray); stroke-width: 1; opacity: 0.75; }
.sd-edge.lo { stroke-dasharray: 3 3; }
.sd-edge.neg { stroke: var(--accent); opacity: 1; }
.sd-node { fill: var(--primary); stroke: var(--background); stroke-width: 1; }
.sd-lit { fill: var(--background); stroke: var(--gray); stroke-width: 1; }
.sd-term { fill: var(--background); stroke: var(--text); stroke-width: 1; }
.sd-root { fill: var(--accent); font-family: var(--code); font-size: 11px; }

.sd-bar.scmos { fill: var(--gray); }
.sd-bar.sdmlp { fill: var(--primary); }
.sd-bar.wddl { fill: var(--accent); opacity: 0.8; }
.sd-bar.guess { fill: var(--gray); opacity: 0.55; }
.sd-bar.key { fill: var(--accent); }
.sd-line { fill: none; stroke-width: 1; }
.sd-line.other { stroke: var(--gray); opacity: 0.22; }
.sd-line.key { stroke: var(--accent); stroke-width: 2.2; }
.sd-ref { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 3; }
.sd-paperref { stroke: var(--text); stroke-width: 1; stroke-dasharray: 1 3; }
.sd-legend .sd-key { display: inline-block; width: 0.9rem; height: 0.6rem; margin-right: 5px; vertical-align: baseline; }
.sd-key.scmos { background: var(--gray); }
.sd-key.sdmlp { background: var(--primary); }
.sd-key.wddl { background: var(--accent); }

/* tables */
.sd-table-wrap { overflow-x: auto; max-width: 100%; }
.paper-body .results-table { width: 100%; min-width: 460px; 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: middle; }
.paper-body .results-table th { font-family: var(--code); font-size: 0.75rem; color: var(--gray); font-weight: 500; }
.paper-body .results-table td { font-size: 0.88rem; }
.paper-body .results-table td.num { font-family: var(--code); font-size: 0.82rem; }
.paper-body .results-table caption { caption-side: top; text-align: left; }
.paper-body .results-table tbody tr.on td:first-child { color: var(--accent); font-weight: 600; }
.paper-body .sd-nodes { min-width: 520px; }
.paper-body .sd-nodes td { font-family: var(--code); font-size: 0.82rem; }
.paper-body .sd-nodes td.sd-hot { color: var(--accent); font-weight: 600; }
.sd-paper { color: var(--gray); }

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