.fx-tally { display: grid; gap: 16px; }
.fx-tally .fx-tally-steps { margin: 0; padding-left: 24px; }
.fx-tally .fx-tally-steps li { padding: 3px 0; }
.fx-tally .fx-tally-goal { margin: 0; color: var(--fx-ink); }
.fx-tally .fx-tally-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.fx-tally .fx-tally-controls legend { padding: 0; font-weight: 800; }
.fx-tally .fx-tally-help { margin: 8px 0 14px; font-size: 14px; line-height: 1.5; }
.fx-tally .fx-tally-tray { padding: 12px; border: 2px solid var(--fx-ink); border-radius: 12px; background: var(--fx-sky-pale); }
.fx-tally .fx-tally-caption { margin: 0 0 8px; font-size: 16px; line-height: 24px; }
.fx-tally .fx-tally-choices { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; }
.fx-tally .fx-tally-card { box-sizing: border-box; position: relative; display: grid; grid-template-rows: 20px 70px 36px; align-items: center; min-width: 0; min-height: 142px; margin: 0; padding: 6px 3px; border: 2px solid var(--fx-muted); border-radius: 8px; background: var(--fx-paper); color: var(--fx-ink); text-align: center; pointer-events: none; }
.fx-tally .fx-tally-card:has(input:checked) { background: var(--fx-paper); color: var(--fx-ink); }
.fx-tally .fx-tally-card input { visibility: hidden; }
.fx-tally .fx-tally-card:first-child:not(:has(input:checked)), .fx-tally .fx-tally-card:has(input:checked) + .fx-tally-card:not(:has(input:checked)), .fx-tally .fx-tally-card:has(input:checked):not(:has(+ .fx-tally-card input:checked)) { pointer-events: auto; cursor: pointer; }
.fx-tally .fx-tally-card:first-child:not(:has(input:checked)) input, .fx-tally .fx-tally-card:has(input:checked) + .fx-tally-card:not(:has(input:checked)) input, .fx-tally .fx-tally-card:has(input:checked):not(:has(+ .fx-tally-card input:checked)) input { visibility: visible; }
.fx-tally .fx-tally-card:first-child:not(:has(input:checked)), .fx-tally .fx-tally-card:has(input:checked) + .fx-tally-card:not(:has(input:checked)) { border-color: var(--fx-sun); background: var(--fx-sun-pale); box-shadow: 0 0 0 2px var(--fx-sun); }
.fx-tally:has(#fx-tally-s4:checked):not(:has(#fx-tally-s5:checked)) .fx-tally-card:has(#fx-tally-s5) { box-shadow: 0 0 0 5px var(--fx-sun); border-color: var(--fx-ink); }
.fx-tally .fx-tally-card:has(input:focus-visible) { outline: 3px solid var(--fx-ink); outline-offset: 4px; }
.fx-tally .fx-tally-tag { display: grid; font-size: 12px; line-height: 18px; font-weight: 800; }
.fx-tally .fx-tally-tag > span { grid-area: 1 / 1; visibility: hidden; }
.fx-tally .fx-tally-card:first-child:not(:has(input:checked)) .fx-tally-tap, .fx-tally .fx-tally-card:has(input:checked) + .fx-tally-card:not(:has(input:checked)) .fx-tally-tap, .fx-tally .fx-tally-card:has(input:checked) .fx-tally-sold { visibility: visible; }
.fx-tally .fx-tally-card:has(input:checked):not(:has(+ .fx-tally-card input:checked)) .fx-tally-sold { visibility: hidden; }
.fx-tally .fx-tally-card:has(input:checked):not(:has(+ .fx-tally-card input:checked)) .fx-tally-undo { visibility: visible; }
.fx-tally .fx-tally-window { display: block; height: 70px; overflow: hidden; }
.fx-tally .fx-tally-sandwich { position: relative; display: block; width: 100%; max-width: 84px; height: 64px; margin: 3px auto; transition: transform .4s, opacity .3s, visibility .3s; }
.fx-tally .fx-tally-sandwich svg { display: block; width: 100%; height: 64px; }
.fx-tally .fx-tally-sandwich polygon { fill: var(--fx-sun); stroke: var(--fx-ink); stroke-width: 3; stroke-linejoin: round; }
.fx-tally .fx-tally-egg { position: absolute; bottom: 7px; left: 0; width: 100%; color: var(--fx-ink); font-size: 12px; line-height: 16px; font-weight: 800; }
.fx-tally .fx-tally-card:has(input:checked) .fx-tally-sandwich { visibility: hidden; opacity: 0; transform: translateX(110%) translateY(-10px); }
.fx-tally .fx-tally-name { font-size: 12px; line-height: 18px; }
.fx-tally .fx-tally-stage { box-sizing: border-box; height: 280px; padding: 12px; display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 16px; align-items: center; }
.fx-tally .fx-tally-chart { min-width: 0; }
.fx-tally .fx-tally-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--fx-paper); color: var(--fx-ink); }
.fx-tally .fx-tally-table th, .fx-tally .fx-tally-table td { border: 2px solid var(--fx-ink); padding: 4px; text-align: center; }
.fx-tally .fx-tally-table thead th { height: 28px; background: var(--fx-sky-pale); font-size: 14px; }
.fx-tally .fx-tally-table th:first-child { width: 38%; }
.fx-tally .fx-tally-marks { display: block; width: 100%; height: 128px; }
.fx-tally .fx-tally-mark { opacity: 0; stroke: var(--fx-ink); stroke-width: 4; stroke-linecap: round; transition: opacity .25s, transform .4s; }
.fx-tally .fx-tally-m5 { stroke: var(--fx-coral); stroke-width: 5; transform-origin: 43px 55px; transform: rotate(-55deg); }
.fx-tally .fx-tally-five { opacity: 0; transition: opacity .3s; }
.fx-tally .fx-tally-five rect { fill: none; stroke: var(--fx-ink); stroke-width: 2; }
.fx-tally .fx-tally-five text { fill: var(--fx-ink); font-size: 18px; font-weight: 800; }
.fx-tally:has(#fx-tally-s1:checked) .fx-tally-m1, .fx-tally:has(#fx-tally-s2:checked) .fx-tally-m2, .fx-tally:has(#fx-tally-s3:checked) .fx-tally-m3, .fx-tally:has(#fx-tally-s4:checked) .fx-tally-m4, .fx-tally:has(#fx-tally-s5:checked) .fx-tally-m5, .fx-tally:has(#fx-tally-s6:checked) .fx-tally-m6, .fx-tally:has(#fx-tally-s5:checked) .fx-tally-five { opacity: 1; }
.fx-tally:has(#fx-tally-s5:checked) .fx-tally-m5 { transform: rotate(0deg); }
.fx-tally .fx-tally-frequency { box-sizing: border-box; margin: 0; padding: 12px; min-width: 0; text-align: center; }
.fx-tally .fx-tally-stack { display: grid; }
.fx-tally .fx-tally-state { grid-area: 1 / 1; visibility: hidden; margin: 0; color: var(--fx-ink); }
.fx-tally .fx-tally-frequency .fx-score { font-size: 36px; line-height: 44px; }
.fx-tally .fx-tally-frequency .fx-tally-stack { line-height: 24px; }
.fx-tally .fx-tally-says { line-height: 1.5; }
.fx-tally .fx-tally-says > p { box-sizing: border-box; padding: 12px; }
.fx-tally:not(:has(#fx-tally-s1:checked)) .fx-tally-n0, .fx-tally:has(#fx-tally-s1:checked):not(:has(#fx-tally-s2:checked)) .fx-tally-n1, .fx-tally:has(#fx-tally-s2:checked):not(:has(#fx-tally-s3:checked)) .fx-tally-n2, .fx-tally:has(#fx-tally-s3:checked):not(:has(#fx-tally-s4:checked)) .fx-tally-n3, .fx-tally:has(#fx-tally-s4:checked):not(:has(#fx-tally-s5:checked)) .fx-tally-n4, .fx-tally:has(#fx-tally-s5:checked):not(:has(#fx-tally-s6:checked)) .fx-tally-n5, .fx-tally:has(#fx-tally-s6:checked) .fx-tally-n6 { visibility: visible; }
@container (max-width: 480px) { .fx-tally .fx-tally-choices { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; } .fx-tally .fx-tally-stage { grid-template-columns: minmax(0,1fr); height: 380px; gap: 12px; align-content: center; } .fx-tally .fx-tally-card:has(input:checked) .fx-tally-sandwich { transform: translateX(90%) translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .fx-tally .fx-tally-sandwich, .fx-tally .fx-tally-mark, .fx-tally .fx-tally-five { transition: none; } }