.tally-form{display:flex;align-items:end;gap:.7rem;flex-wrap:wrap;margin:1rem 0}
.tally-form[hidden]{display:none}
.tally-form label{display:grid;flex:1 1 12rem;min-width:0;gap:.18rem;font-weight:700}
.tally-form select,.tally-form button{font:inherit;color:inherit;max-width:100%;padding:.45rem .65rem;border:1px solid #aa9876;border-radius:.42rem;background:#fffdfa;min-height:2.6rem}
.tally-form button{background:#f4c779;cursor:pointer;font-weight:700}
.tally-status{padding:.6rem .8rem;background:#fcf4df;border:1px solid #e0cda6;border-radius:.45rem}
.tally-panels{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:.65rem}
.tally-panel{min-width:0;border:1px solid #deccb1;border-radius:.55rem;padding:.6rem .7rem;background:#fffcf4}
.tally-panel h3{font-size:1rem;margin:.2rem 0}
.tally-table{border-collapse:collapse;width:100%;margin:.5rem 0;table-layout:fixed}
.tally-table caption{text-align:left;font-size:.85rem;color:#625642}
.tally-table tr:not(:last-child){border-bottom:1px solid #deccb1}
.tally-table th,.tally-table td{text-align:left;padding:.35rem .15rem;overflow-wrap:anywhere;vertical-align:top}
.tally-table th{width:68%;font-weight:600}
.tally-table td{font-variant-numeric:tabular-nums}
.tally-table meter{display:block;width:100%;height:.6rem;accent-color:#8e5909}
.tally-hits{padding-inline-start:1.3rem}
.tally-hits li{padding:.25rem 0;overflow-wrap:anywhere}
.tally-context-example+.tally-context-example{border-top:1px solid #deccb1;margin-top:.65rem;padding-top:.65rem}
.tally-context-example h3{font-size:.98rem;margin:0}
.tally-context-example p{margin:.1rem 0 .3rem;font-size:.88rem}
.tally-context{font-size:.88rem;margin:.25rem 0 .45rem}
.tally-context summary{width:fit-content;color:#805008;cursor:pointer}
.tally-context ol{list-style:none;background:#fcf7e9;border:1px solid #deccb1;border-radius:.45rem;margin:.35rem 0;padding:.3rem .65rem}
.tally-context li{display:grid;grid-template-columns:minmax(5.2rem,max-content) minmax(0,1fr);gap:.55rem;padding:.18rem 0}
.tally-context li span{color:#5f5341}
@media(max-width:390px){.tally-context li{grid-template-columns:1fr;gap:0}}
.tally-form input{box-sizing:border-box;font:inherit;color:inherit;max-width:100%;min-width:0;width:100%;padding:.45rem .65rem;border:1px solid #aa9876;border-radius:.42rem;background:#fffdfa;min-height:2.6rem}
.tally-live-fields{align-items:start}
.tally-live-fields .tally-live-wide{flex-basis:22rem}
.tally-live-meta{display:flex;align-items:center;gap:.5rem 1rem;flex-wrap:wrap}
.tally-live-meta [hidden]{display:none}
.tally-live-controls{display:flex;gap:.65rem;flex-wrap:wrap;align-items:center}
.tally-live-controls button{min-height:44px;padding:.4rem .7rem;border:1px solid #aa9876;border-radius:.4rem;background:#fffdfa;color:inherit;font:inherit;cursor:pointer}
.tally-live-controls button:disabled,.tally-form button:disabled{cursor:not-allowed;opacity:.6}
.tally-live-controls[hidden]{display:none}
.tally-live-drill{display:block;min-height:44px;margin:.15rem 0;padding:.15rem .3rem;border:1px solid #aa9876;border-radius:.35rem;background:#fffdfa;color:#694409;font:inherit;font-size:.82rem;text-align:start;cursor:pointer}
.tally-live-drill:disabled{opacity:.7;cursor:not-allowed}
.tally-period-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:.55rem}
.tally-period-field{display:flex;flex-wrap:wrap;gap:.25rem;align-items:end}
.tally-period-field label{display:grid;gap:.2rem;flex:1 1 7.5rem}
.tally-period-field select,.tally-period-field button,#tally-live-copy{min-height:44px;padding:.25rem .45rem;border:1px solid #aa9876;border-radius:.35rem;background:#fffdfa;color:inherit;font:inherit;cursor:pointer}
.tally-period-field button:disabled{opacity:.65;cursor:not-allowed}
.tally-live-meta[hidden]{display:none}
.tally-live-distribution{margin:.6rem 0;border:1px solid #deccb1;border-radius:.5rem;padding:.35rem .6rem;background:#fffcf4}
.tally-live-distribution summary{min-height:44px;padding:.55rem .2rem;color:#694409;cursor:pointer;font-weight:700}
.tally-period-chart{margin:1rem 0 0;padding:.8rem;border:1px solid #ded0b4;border-radius:.6rem;background:#faf6e8}
.tally-period-chart figcaption{font-size:1rem;font-weight:750;margin-bottom:.65rem;overflow-wrap:anywhere}
.tally-period-bars{list-style:none;display:grid;gap:.45rem;padding:0;margin:0}
.tally-period-bars li{display:grid;grid-template-columns:minmax(8rem,auto) minmax(0,1fr) minmax(8rem,auto);align-items:center;gap:.25rem .65rem;padding:.45rem .55rem;margin:0;background:#fffcf4;border:1px solid #ded0b4;border-radius:.45rem}
.tally-period-bars .tally-period-count{font-variant-numeric:tabular-nums;font-weight:750;text-align:right;grid-column:3}
.tally-period-bars meter{width:100%;height:1rem;display:block;grid-row:1;grid-column:2;accent-color:#477b72}
.tally-period-bars meter::-webkit-meter-bar{border:none;background:#eae2ce;border-radius:99px;box-shadow:none}
.tally-period-bars meter::-webkit-meter-optimum-value{background:#477b72;border-radius:99px}
.tally-period-bars meter::-moz-meter-bar{background:#477b72;border-radius:99px}
.tally-period-bars .tally-period-partial meter::-webkit-meter-optimum-value{background:#a87320}
.tally-period-bars .tally-period-partial meter::-moz-meter-bar{background:#a87320}
.tally-period-bars a{grid-column:1/-1;min-height:44px;display:flex;align-items:center;width:fit-content}
.tally-period-share{padding-top:.65rem}
.tally-period-share button{min-height:44px;padding:.25rem .45rem;border:1px solid #aa9876;border-radius:.35rem;background:#fffdfa;color:inherit;font:inherit;cursor:pointer}
.tally-period-share [hidden]{display:none}
@media(max-width:525px){
 .tally-period-bars li{grid-template-columns:minmax(0,1fr) minmax(2rem,auto)}
 .tally-period-bars .tally-period-count{grid-column:2}
 .tally-period-bars meter{grid-column:1/-1;grid-row:auto}
}
