/* TVLA on GIFT-COFB 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.35rem; }
.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, .tv-hex: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); }

.w-range { display: grid; grid-template-columns: auto minmax(0, 1fr) 3.4rem; 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); }

/* charts */
.tv-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; }
.tv-band { fill: var(--light-gray); opacity: 0.35; }
.tv-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.tv-line.thin { stroke-width: 1; opacity: 0.55; }
.tv-line.fixed { stroke: var(--accent); }
.tv-line.random { stroke: var(--primary); }
.tv-line.tline { stroke: var(--primary); stroke-width: 1.4; }
.tv-line.alarm.a { stroke: var(--accent); stroke-width: 2.2; }
.tv-line.alarm.b { stroke: var(--primary); }
.tv-line.alarm.c { stroke: var(--gray); stroke-dasharray: 4 3; }
.tv-mark { stroke-dasharray: 3 3; }
.tv-thr { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 5 4; }
.tv-hit { fill: var(--accent); }
.tv-bar { fill: var(--gray); opacity: 0.5; }
.tv-bar.hot { fill: var(--accent); opacity: 0.85; }

/* inputs and readouts */
.tv-inputs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0; }
.tv-inputs label { display: flex; flex-direction: column; gap: 3px; font-family: var(--code); font-size: 0.72rem; color: var(--gray); min-width: 0; max-width: 100%; }
.tv-hex {
  font-family: var(--code); font-size: 0.8rem; padding: 6px 8px; min-height: 36px;
  border: 1px solid var(--light-gray); background: var(--background); color: var(--text); border-radius: 0;
  width: min(100%, 26rem); box-sizing: border-box;
}
.tv-msg { color: var(--accent); font-size: 0.72rem; }
.tv-out, .tv-stats { margin: 8px 0; max-width: 760px; border-top: 1px solid var(--light-gray); }
.tv-out > div, .tv-stats > div { display: grid; grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr); gap: 4px 12px; padding: 5px 0; border-bottom: 1px solid var(--light-gray); font-size: 0.88rem; }
.tv-out code { font-family: var(--code); font-size: 0.8rem; overflow-wrap: anywhere; word-break: break-all; background: none; padding: 0; }
.tv-k { font-family: var(--code); font-size: 0.75rem; color: var(--gray); }
.tv-legend { font-size: 0.82rem; }

/* S-box strip and table */
.tv-strip { display: grid; grid-template-columns: 3.2rem repeat(16, minmax(0, 1fr)); margin: 10px 0; max-width: 760px; border-top: 1px solid var(--light-gray); font-family: var(--code); font-size: 0.8rem; }
.tv-strip span { padding: 4px 0; text-align: center; border-bottom: 1px solid var(--light-gray); }
.tv-strip .tv-rowlab { text-align: left; color: var(--gray); font-size: 0.7rem; }
.tv-strip .tv-out { color: var(--accent); }
.tv-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 .tv-scores td { font-family: var(--code); font-size: 0.82rem; }
.paper-body .tv-scores tr.tv-pick td:first-child { color: var(--accent); font-weight: 600; }
.tv-miss { color: var(--accent); font-weight: 600; }
.tv-printed { color: var(--gray); font-weight: 400; }
.tv-printed-cell { color: var(--gray); }
